CF
Carsten Fuchs
Sat, Feb 5, 2022 9:43 AM
Am 04.02.22 um 16:51 schrieb nop head:
For that example you could subtract the hull of the box from the panel before unioning but you might get errors due the the lack of an overlap then.
If the upstream box needs to have the internals marked, then why not just make the inside a module as well as the complete box? Then you can union the box with the panel and subtract the inside again.
Yes, both are good and pragmatic solutions, but each also has its downsides.
I think that I'll eventually apply the subtraction of the hull to my concrete assembly. It would still be great though if there was a solution in the form of some binary geometry operator like union() or difference().
Best regards,
Carsten
Am 04.02.22 um 16:51 schrieb nop head:
> For that example you could subtract the hull of the box from the panel before unioning but you might get errors due the the lack of an overlap then.
>
> If the upstream box needs to have the internals marked, then why not just make the inside a module as well as the complete box? Then you can union the box with the panel and subtract the inside again.
Yes, both are good and pragmatic solutions, but each also has its downsides.
I think that I'll eventually apply the subtraction of the hull to my concrete assembly. It would still be great though if there was a solution in the form of some binary geometry operator like union() or difference().
Best regards,
Carsten
NH
nop head
Sat, Feb 5, 2022 10:32 AM
I don't think the problem is well defined enough for there to be a new
operator. For a simple box the inside is easy to define but what if it is a
convoluted shape where the outside is concave or is open on one face?
Consider just a round pipe with a hole cut out of it merged with a panel.
Should the hole in the panel be circular or a circle with a flat on it
where the pipe has its hole?
On Sat, 5 Feb 2022 at 09:43, Carsten Fuchs carsten.fuchs@cafu.de wrote:
Am 04.02.22 um 16:51 schrieb nop head:
For that example you could subtract the hull of the box from the panel
before unioning but you might get errors due the the lack of an overlap
then.
If the upstream box needs to have the internals marked, then why not
just make the inside a module as well as the complete box? Then you can
union the box with the panel and subtract the inside again.
Yes, both are good and pragmatic solutions, but each also has its
downsides.
I think that I'll eventually apply the subtraction of the hull to my
concrete assembly. It would still be great though if there was a solution
in the form of some binary geometry operator like union() or difference().
Best regards,
Carsten
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I don't think the problem is well defined enough for there to be a new
operator. For a simple box the inside is easy to define but what if it is a
convoluted shape where the outside is concave or is open on one face?
Consider just a round pipe with a hole cut out of it merged with a panel.
Should the hole in the panel be circular or a circle with a flat on it
where the pipe has its hole?
On Sat, 5 Feb 2022 at 09:43, Carsten Fuchs <carsten.fuchs@cafu.de> wrote:
> Am 04.02.22 um 16:51 schrieb nop head:
> > For that example you could subtract the hull of the box from the panel
> before unioning but you might get errors due the the lack of an overlap
> then.
> >
> > If the upstream box needs to have the internals marked, then why not
> just make the inside a module as well as the complete box? Then you can
> union the box with the panel and subtract the inside again.
>
> Yes, both are good and pragmatic solutions, but each also has its
> downsides.
>
> I think that I'll eventually apply the subtraction of the hull to my
> concrete assembly. It would still be great though if there was a solution
> in the form of some binary geometry operator like union() or difference().
>
> Best regards,
> Carsten
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
AM
Adrian Mariano
Sat, Feb 5, 2022 1:48 PM
Why does there need to be any relationship between how pipe joints are
really made and how you model a pipe-like structure in OpenSCAD? I mean,
obviously you can model a bunch of pipe fittings and then stick them
together. But on the computer we're not constrained the same way we are in
the physical world.
On Sat, Feb 5, 2022 at 2:44 AM MichaelAtOz oz.at.michael@gmail.com wrote:
But that is not how you make real pipe joins.
Think of CSG, union as welding and difference as cutting or drilling, and
intersection as [?]. Polyhedron as casting maybe.
To get a + shaped pipe structure you either
Possibly others.
We have to remember OpenSCAD is fundamentally a CSG machine.
However in my meanderings I found this discussion
https://github.com/SolidCode/SolidPython/issues/11
From: Jordan Brown [mailto:openscad@jordan.maileater.net]
Sent: Sat, 5 Feb 2022 13:11
To: OpenSCAD general discussion; Torsten Paul
Subject: [OpenSCAD] Re: Subtraction from parents?
I think that the most obvious application for "negative objects" is in
intersecting pipes.
module pipe(length, od, id) {
difference() {
cylinder(h=length, d=od, center=true);
cylinder(h=length+2, d=id, center=true);
}
}
pipe(length=5, od=2, id=1.9);
rotate([90,0,0]) pipe(length=5, od=2, id=1.9);
You might think this would work, but of course it doesn't because the hole
isn't part of the definition of the pipe, and so pipe A's walls block pipe
B, and vice versa. If the holes were "negative objects", then pipe A's
hole would cut both pipe A and pipe B, and pipe B's hole would cut both B
and A.
But now I want to put a plug into one of the pipes, and the hole cuts
through the plug.
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#m_3956171884166016723_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Why does there need to be any relationship between how pipe joints are
really made and how you model a pipe-like structure in OpenSCAD? I mean,
obviously you can model a bunch of pipe fittings and then stick them
together. But on the computer we're not constrained the same way we are in
the physical world.
On Sat, Feb 5, 2022 at 2:44 AM MichaelAtOz <oz.at.michael@gmail.com> wrote:
> But that is not how you make real pipe joins.
>
> Think of CSG, union as welding and difference as cutting or drilling, and
> intersection as [?]. Polyhedron as casting maybe.
>
>
>
> To get a + shaped pipe structure you either
>
> - cast it as one + piece
>
> - cut curved ends on four pieces and weld them together
>
> - cut curved ends on two pieces and weld them on a third then drill out
> the centre
>
>
>
> Possibly others.
>
>
>
> We have to remember OpenSCAD is fundamentally a CSG machine.
>
>
>
> However in my meanderings I found this discussion
>
> https://github.com/SolidCode/SolidPython/issues/11
>
>
>
>
>
>
> ------------------------------
>
> *From:* Jordan Brown [mailto:openscad@jordan.maileater.net]
> *Sent:* Sat, 5 Feb 2022 13:11
> *To:* OpenSCAD general discussion; Torsten Paul
> *Subject:* [OpenSCAD] Re: Subtraction from parents?
>
>
>
> I think that the most obvious application for "negative objects" is in
> intersecting pipes.
>
> module pipe(length, od, id) {
>
> difference() {
>
> cylinder(h=length, d=od, center=true);
>
> cylinder(h=length+2, d=id, center=true);
>
> }
>
> }
>
>
>
> pipe(length=5, od=2, id=1.9);
>
> rotate([90,0,0]) pipe(length=5, od=2, id=1.9);
>
> You might think this would work, but of course it doesn't because the hole
> isn't part of the definition of the pipe, and so pipe A's walls block pipe
> B, and vice versa. If the holes were "negative objects", then pipe A's
> hole would cut both pipe A and pipe B, and pipe B's hole would cut both B
> and A.
>
> But now I want to put a plug into one of the pipes, and the hole cuts
> through the plug.
>
>
>
>
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free.
> www.avg.com
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
> <#m_3956171884166016723_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
CF
Carsten Fuchs
Sun, Feb 6, 2022 7:41 AM
I agree with everyone that all this only leads somewhere if it can be formulated for the general case.
But why are many here assuming that such an formulation that is reasonably useful within OpenSCAD does not exist or cannot be found?
a) It seems to have become clear that it is required to have a way to flag negative objects that are intended to have the property to also subtract from parents.
b) And also required is a way to stop the property upwards the hierarchy.
MichaelAtOz found an interesting link about this:
https://github.com/SolidCode/SolidPython/issues/11
which links to an example:
https://github.com/SolidCode/SolidPython/blob/master/solid/examples/hole_example.py
Yes, this is very crude for a spec. But wouldn't you agree that this is the basics of a formulation that meets all requirements that have been requested so far?
Best regards,
Carsten
Am 05.02.22 um 11:32 schrieb nop head:
I don't think the problem is well defined enough for there to be a new operator. For a simple box the inside is easy to define but what if it is a convoluted shape where the outside is concave or is open on one face?
Consider just a round pipe with a hole cut out of it merged with a panel. Should the hole in the panel be circular or a circle with a flat on it where the pipe has its hole?
On Sat, 5 Feb 2022 at 09:43, Carsten Fuchs <carsten.fuchs@cafu.de mailto:carsten.fuchs@cafu.de> wrote:
Am 04.02.22 um 16:51 schrieb nop head:
For that example you could subtract the hull of the box from the panel before unioning but you might get errors due the the lack of an overlap then.
If the upstream box needs to have the internals marked, then why not just make the inside a module as well as the complete box? Then you can union the box with the panel and subtract the inside again.
Yes, both are good and pragmatic solutions, but each also has its downsides.
I think that I'll eventually apply the subtraction of the hull to my concrete assembly. It would still be great though if there was a solution in the form of some binary geometry operator like union() or difference().
Best regards,
Carsten
I agree with everyone that all this only leads somewhere if it can be formulated for the general case.
But why are many here assuming that such an formulation that is reasonably useful within OpenSCAD does not exist or cannot be found?
a) It seems to have become clear that it is required to have a way to flag negative objects that are intended to have the property to also subtract from parents.
b) And also required is a way to stop the property upwards the hierarchy.
MichaelAtOz found an interesting link about this:
https://github.com/SolidCode/SolidPython/issues/11
which links to an example:
https://github.com/SolidCode/SolidPython/blob/master/solid/examples/hole_example.py
Yes, this is very crude for a spec. But wouldn't you agree that this is the basics of a formulation that meets all requirements that have been requested so far?
Best regards,
Carsten
Am 05.02.22 um 11:32 schrieb nop head:
> I don't think the problem is well defined enough for there to be a new operator. For a simple box the inside is easy to define but what if it is a convoluted shape where the outside is concave or is open on one face?
>
> Consider just a round pipe with a hole cut out of it merged with a panel. Should the hole in the panel be circular or a circle with a flat on it where the pipe has its hole?
>
> On Sat, 5 Feb 2022 at 09:43, Carsten Fuchs <carsten.fuchs@cafu.de <mailto:carsten.fuchs@cafu.de>> wrote:
>
> Am 04.02.22 um 16:51 schrieb nop head:
> > For that example you could subtract the hull of the box from the panel before unioning but you might get errors due the the lack of an overlap then.
> >
> > If the upstream box needs to have the internals marked, then why not just make the inside a module as well as the complete box? Then you can union the box with the panel and subtract the inside again.
>
> Yes, both are good and pragmatic solutions, but each also has its downsides.
>
> I think that I'll eventually apply the subtraction of the hull to my concrete assembly. It would still be great though if there was a solution in the form of some binary geometry operator like union() or difference().
>
> Best regards,
> Carsten
NH
nop head
Sun, Feb 6, 2022 7:57 AM
If you need to modify the original object then you can simply export the
inside as a separate module and then subtract that in the client code where
required.
Or you can have the original object take an optional child that gets
unioned before the inside is subtracted. That is how I do customisable
printed boxes. I have children to add or subtract from it so I can add
holes, or pillars, etc. I could also add a panel if I needed to.
On Sun, 6 Feb 2022 at 07:41, Carsten Fuchs carsten.fuchs@cafu.de wrote:
I agree with everyone that all this only leads somewhere if it can be
formulated for the general case.
But why are many here assuming that such an formulation that is reasonably
useful within OpenSCAD does not exist or cannot be found?
a) It seems to have become clear that it is required to have a way
to flag negative objects that are intended to have the property to also
subtract from parents.
b) And also required is a way to stop the property upwards the
hierarchy.
MichaelAtOz found an interesting link about this:
https://github.com/SolidCode/SolidPython/issues/11
which links to an example:
https://github.com/SolidCode/SolidPython/blob/master/solid/examples/hole_example.py
Yes, this is very crude for a spec. But wouldn't you agree that this is
the basics of a formulation that meets all requirements that have been
requested so far?
Best regards,
Carsten
Am 05.02.22 um 11:32 schrieb nop head:
I don't think the problem is well defined enough for there to be a new
operator. For a simple box the inside is easy to define but what if it is a
convoluted shape where the outside is concave or is open on one face?
Consider just a round pipe with a hole cut out of it merged with a
panel. Should the hole in the panel be circular or a circle with a flat on
it where the pipe has its hole?
Am 04.02.22 um 16:51 schrieb nop head:
For that example you could subtract the hull of the box from the
panel before unioning but you might get errors due the the lack of an
overlap then.
If the upstream box needs to have the internals marked, then why
not just make the inside a module as well as the complete box? Then you can
union the box with the panel and subtract the inside again.
Yes, both are good and pragmatic solutions, but each also has its
I think that I'll eventually apply the subtraction of the hull to my
concrete assembly. It would still be great though if there was a solution
in the form of some binary geometry operator like union() or difference().
If you need to modify the original object then you can simply export the
inside as a separate module and then subtract that in the client code where
required.
Or you can have the original object take an optional child that gets
unioned before the inside is subtracted. That is how I do customisable
printed boxes. I have children to add or subtract from it so I can add
holes, or pillars, etc. I could also add a panel if I needed to.
On Sun, 6 Feb 2022 at 07:41, Carsten Fuchs <carsten.fuchs@cafu.de> wrote:
> I agree with everyone that all this only leads somewhere if it can be
> formulated for the general case.
>
> But why are many here assuming that such an formulation that is reasonably
> useful within OpenSCAD does not exist or cannot be found?
>
> a) It seems to have become clear that it is required to have a way
> to flag negative objects that are intended to have the property to also
> subtract from parents.
>
> b) And also required is a way to stop the property upwards the
> hierarchy.
>
> MichaelAtOz found an interesting link about this:
> https://github.com/SolidCode/SolidPython/issues/11
>
> which links to an example:
>
> https://github.com/SolidCode/SolidPython/blob/master/solid/examples/hole_example.py
>
> Yes, this is very crude for a spec. But wouldn't you agree that this is
> the basics of a formulation that meets all requirements that have been
> requested so far?
>
> Best regards,
> Carsten
>
>
> Am 05.02.22 um 11:32 schrieb nop head:
> > I don't think the problem is well defined enough for there to be a new
> operator. For a simple box the inside is easy to define but what if it is a
> convoluted shape where the outside is concave or is open on one face?
> >
> > Consider just a round pipe with a hole cut out of it merged with a
> panel. Should the hole in the panel be circular or a circle with a flat on
> it where the pipe has its hole?
> >
> > On Sat, 5 Feb 2022 at 09:43, Carsten Fuchs <carsten.fuchs@cafu.de
> <mailto:carsten.fuchs@cafu.de>> wrote:
> >
> > Am 04.02.22 um 16:51 schrieb nop head:
> > > For that example you could subtract the hull of the box from the
> panel before unioning but you might get errors due the the lack of an
> overlap then.
> > >
> > > If the upstream box needs to have the internals marked, then why
> not just make the inside a module as well as the complete box? Then you can
> union the box with the panel and subtract the inside again.
> >
> > Yes, both are good and pragmatic solutions, but each also has its
> downsides.
> >
> > I think that I'll eventually apply the subtraction of the hull to my
> concrete assembly. It would still be great though if there was a solution
> in the form of some binary geometry operator like union() or difference().
> >
> > Best regards,
> > Carsten
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
AM
Adrian Mariano
Sun, Feb 6, 2022 2:41 PM
I've been experimenting with the BOSL2 tagging method to do this kind
of thing and it seems like it can do what you want without needing
changes to OpenSCAD. In the example below based on pipes the pipe
interiors are subtracted from higher level parts of the model, the way
you want. The subtraction stops at a certain level. But maybe I
don't fully understand your vision. So I'm curious what is the next
level of challenge for the vision you have? How does this solution
(seem to) fall short?
Also note that there is another library, the General Library of
Relativity, that does something similar (maybe more complicated?).
https://github.com/davidson16807/relativity.scad
include<BOSL2/std.scad>
$fn=16;
module pipe(length, od, id) {
cylinder(h=length, d=od, center=true,$tags="");
cylinder(h=length+.02, d=id, center=true);
children();
}
module plug(length,od) {
cyl(h=length, d=od,rounding2=.2,center=true,$tags="");
}
// Higher level objects don't have pipe interiors removed
down(2.2) ycyl(h=8, d=.3,$tags="keep");
diff("rem",keep="keep"){
up(1) xcyl(h=8, d=1,$tags="keep"); // Don't subtract pipe interiors from this
down(2) xcyl(h=8, d=1);
pipe(length=5, od=2, id=1.9,$tags="rem")
rotate([90,0,0])
pipe(length=5, od=2, id=1.9)
up(5/2) plug(1,od=2.2);
}
On Sun, Feb 6, 2022 at 2:41 AM Carsten Fuchs carsten.fuchs@cafu.de wrote:
I agree with everyone that all this only leads somewhere if it can be formulated for the general case.
But why are many here assuming that such an formulation that is reasonably useful within OpenSCAD does not exist or cannot be found?
a) It seems to have become clear that it is required to have a way to flag negative objects that are intended to have the property to also subtract from parents.
b) And also required is a way to stop the property upwards the hierarchy.
MichaelAtOz found an interesting link about this:
https://github.com/SolidCode/SolidPython/issues/11
which links to an example:
https://github.com/SolidCode/SolidPython/blob/master/solid/examples/hole_example.py
Yes, this is very crude for a spec. But wouldn't you agree that this is the basics of a formulation that meets all requirements that have been requested so far?
Best regards,
Carsten
Am 05.02.22 um 11:32 schrieb nop head:
I don't think the problem is well defined enough for there to be a new operator. For a simple box the inside is easy to define but what if it is a convoluted shape where the outside is concave or is open on one face?
Consider just a round pipe with a hole cut out of it merged with a panel. Should the hole in the panel be circular or a circle with a flat on it where the pipe has its hole?
On Sat, 5 Feb 2022 at 09:43, Carsten Fuchs <carsten.fuchs@cafu.de mailto:carsten.fuchs@cafu.de> wrote:
Am 04.02.22 um 16:51 schrieb nop head:
For that example you could subtract the hull of the box from the panel before unioning but you might get errors due the the lack of an overlap then.
If the upstream box needs to have the internals marked, then why not just make the inside a module as well as the complete box? Then you can union the box with the panel and subtract the inside again.
Yes, both are good and pragmatic solutions, but each also has its downsides.
I think that I'll eventually apply the subtraction of the hull to my concrete assembly. It would still be great though if there was a solution in the form of some binary geometry operator like union() or difference().
Best regards,
Carsten
I've been experimenting with the BOSL2 tagging method to do this kind
of thing and it seems like it can do what you want without needing
changes to OpenSCAD. In the example below based on pipes the pipe
interiors are subtracted from higher level parts of the model, the way
you want. The subtraction stops at a certain level. But maybe I
don't fully understand your vision. So I'm curious what is the next
level of challenge for the vision you have? How does this solution
(seem to) fall short?
Also note that there is another library, the General Library of
Relativity, that does something similar (maybe more complicated?).
https://github.com/davidson16807/relativity.scad
include<BOSL2/std.scad>
$fn=16;
module pipe(length, od, id) {
cylinder(h=length, d=od, center=true,$tags="");
cylinder(h=length+.02, d=id, center=true);
children();
}
module plug(length,od) {
cyl(h=length, d=od,rounding2=.2,center=true,$tags="");
}
// Higher level objects don't have pipe interiors removed
down(2.2) ycyl(h=8, d=.3,$tags="keep");
diff("rem",keep="keep"){
up(1) xcyl(h=8, d=1,$tags="keep"); // Don't subtract pipe interiors from this
down(2) xcyl(h=8, d=1);
pipe(length=5, od=2, id=1.9,$tags="rem")
rotate([90,0,0])
pipe(length=5, od=2, id=1.9)
up(5/2) plug(1,od=2.2);
}
On Sun, Feb 6, 2022 at 2:41 AM Carsten Fuchs <carsten.fuchs@cafu.de> wrote:
>
> I agree with everyone that all this only leads somewhere if it can be formulated for the general case.
>
> But why are many here assuming that such an formulation that is reasonably useful within OpenSCAD does not exist or cannot be found?
>
> a) It seems to have become clear that it is required to have a way to flag negative objects that are intended to have the property to also subtract from parents.
>
> b) And also required is a way to stop the property upwards the hierarchy.
>
> MichaelAtOz found an interesting link about this:
> https://github.com/SolidCode/SolidPython/issues/11
>
> which links to an example:
> https://github.com/SolidCode/SolidPython/blob/master/solid/examples/hole_example.py
>
> Yes, this is very crude for a spec. But wouldn't you agree that this is the basics of a formulation that meets all requirements that have been requested so far?
>
> Best regards,
> Carsten
>
>
> Am 05.02.22 um 11:32 schrieb nop head:
> > I don't think the problem is well defined enough for there to be a new operator. For a simple box the inside is easy to define but what if it is a convoluted shape where the outside is concave or is open on one face?
> >
> > Consider just a round pipe with a hole cut out of it merged with a panel. Should the hole in the panel be circular or a circle with a flat on it where the pipe has its hole?
> >
> > On Sat, 5 Feb 2022 at 09:43, Carsten Fuchs <carsten.fuchs@cafu.de <mailto:carsten.fuchs@cafu.de>> wrote:
> >
> > Am 04.02.22 um 16:51 schrieb nop head:
> > > For that example you could subtract the hull of the box from the panel before unioning but you might get errors due the the lack of an overlap then.
> > >
> > > If the upstream box needs to have the internals marked, then why not just make the inside a module as well as the complete box? Then you can union the box with the panel and subtract the inside again.
> >
> > Yes, both are good and pragmatic solutions, but each also has its downsides.
> >
> > I think that I'll eventually apply the subtraction of the hull to my concrete assembly. It would still be great though if there was a solution in the form of some binary geometry operator like union() or difference().
> >
> > Best regards,
> > Carsten
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
J
jon
Sun, Feb 6, 2022 10:08 PM
The power demonstrated here is amazing. The only quibble I have is that
I often use "#" to figure out which code relates to which visible
object, and if you put that "#" at the start of the line
"pipe(length=5...", you end up highlighting two pipes and a plug. Adding
a ";" at the end of that line does not seem to damage the object being
described. I guess I could separate out each object if I wanted/needed
to be able to get at them separately.
Jon
On 2/6/2022 9:41 AM, Adrian Mariano wrote:
I've been experimenting with the BOSL2 tagging method to do this kind
of thing and it seems like it can do what you want without needing
changes to OpenSCAD. In the example below based on pipes the pipe
interiors are subtracted from higher level parts of the model, the way
you want. The subtraction stops at a certain level. But maybe I
don't fully understand your vision. So I'm curious what is the next
level of challenge for the vision you have? How does this solution
(seem to) fall short?
Also note that there is another library, the General Library of
Relativity, that does something similar (maybe more complicated?).
https://github.com/davidson16807/relativity.scad
include<BOSL2/std.scad>
$fn=16;
module pipe(length, od, id) {
cylinder(h=length, d=od, center=true,$tags="");
cylinder(h=length+.02, d=id, center=true);
children();
}
module plug(length,od) {
cyl(h=length, d=od,rounding2=.2,center=true,$tags="");
}
// Higher level objects don't have pipe interiors removed
down(2.2) ycyl(h=8, d=.3,$tags="keep");
diff("rem",keep="keep"){
up(1) xcyl(h=8, d=1,$tags="keep"); // Don't subtract pipe interiors from this
down(2) xcyl(h=8, d=1);
pipe(length=5, od=2, id=1.9,$tags="rem")
rotate([90,0,0])
pipe(length=5, od=2, id=1.9)
up(5/2) plug(1,od=2.2);
}
The power demonstrated here is amazing. The only quibble I have is that
I often use "#" to figure out which code relates to which visible
object, and if you put that "#" at the start of the line
"pipe(length=5...", you end up highlighting two pipes and a plug. Adding
a ";" at the end of that line does not seem to damage the object being
described. I guess I could separate out each object if I wanted/needed
to be able to get at them separately.
Jon
On 2/6/2022 9:41 AM, Adrian Mariano wrote:
> I've been experimenting with the BOSL2 tagging method to do this kind
> of thing and it seems like it can do what you want without needing
> changes to OpenSCAD. In the example below based on pipes the pipe
> interiors are subtracted from higher level parts of the model, the way
> you want. The subtraction stops at a certain level. But maybe I
> don't fully understand your vision. So I'm curious what is the next
> level of challenge for the vision you have? How does this solution
> (seem to) fall short?
>
> Also note that there is another library, the General Library of
> Relativity, that does something similar (maybe more complicated?).
> https://github.com/davidson16807/relativity.scad
>
> include<BOSL2/std.scad>
>
> $fn=16;
>
> module pipe(length, od, id) {
> cylinder(h=length, d=od, center=true,$tags="");
> cylinder(h=length+.02, d=id, center=true);
> children();
> }
>
> module plug(length,od) {
> cyl(h=length, d=od,rounding2=.2,center=true,$tags="");
> }
>
> // Higher level objects don't have pipe interiors removed
> down(2.2) ycyl(h=8, d=.3,$tags="keep");
>
> diff("rem",keep="keep"){
> up(1) xcyl(h=8, d=1,$tags="keep"); // Don't subtract pipe interiors from this
> down(2) xcyl(h=8, d=1);
> pipe(length=5, od=2, id=1.9,$tags="rem")
> rotate([90,0,0])
> pipe(length=5, od=2, id=1.9)
> up(5/2) plug(1,od=2.2);
> }
>
>
JB
Jordan Brown
Sun, Feb 6, 2022 10:50 PM
On 2/4/2022 11:44 PM, MichaelAtOz wrote:
But that is not how you make real pipe joins.
Think of CSG, union as welding and difference as cutting or drilling,
and intersection as [?]. Polyhedron as casting maybe.
Or think of CSG as set arithmetic, and augment set arithmetic so that
(like numeric arithmetic) it has negative values. That's the mental
model that I use when I think about this, that A-B in set arithmetic
might in some sense be similar to A+(-B).
I'm not sure it really works, but it comes temptingly close.
On 2/4/2022 11:44 PM, MichaelAtOz wrote:
>
> But that is not how you make real pipe joins.
>
> Think of CSG, union as welding and difference as cutting or drilling,
> and intersection as [?]. Polyhedron as casting maybe.
>
Or think of CSG as set arithmetic, and augment set arithmetic so that
(like numeric arithmetic) it has negative values. That's the mental
model that I use when I think about this, that A-B in set arithmetic
might in some sense be similar to A+(-B).
I'm not sure it really works, but it comes temptingly close.