discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

module implies union?

MH
Mark Harrison
Sat, Jul 8, 2017 7:18 AM

Is there any difference, either practical or theoretical, between the
following two module definitions?

module hole() {
translate([0,0,-1])          cylinder(fwthickness+1,d=screwsz);
translate([0,0,fwthickness]) cylinder(100,d=screwhd);
}

module hole() {
union() {
translate([0,0,-1])          cylinder(fwthickness+1,d=screwsz);
translate([0,0,fwthickness]) cylinder(100,d=screwhd);
}
}

Is there any difference, either practical or theoretical, between the following two module definitions? module hole() { translate([0,0,-1]) cylinder(fwthickness+1,d=screwsz); translate([0,0,fwthickness]) cylinder(100,d=screwhd); } module hole() { union() { translate([0,0,-1]) cylinder(fwthickness+1,d=screwsz); translate([0,0,fwthickness]) cylinder(100,d=screwhd); } }
M
MichaelAtOz
Sat, Jul 8, 2017 9:26 PM

ATM no.

At some time in the misty future, the implicit union will be removed,
possibly in some fashion that preserves backward compatibility.
With that, a non unioned group() [the first of your cases] will exist as two
child objects, v's the union()'d case will be one object.
Thus allowing the first case, each object can be accessed via children()
individually.
It may also have performance implications, but that is less clear ATM.


Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/module-implies-union-tp21790p21793.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

ATM no. At some time in the misty future, the implicit union will be removed, possibly in some fashion that preserves backward compatibility. With that, a non unioned group() [the first of your cases] will exist as two child objects, v's the union()'d case will be one object. Thus allowing the first case, each object can be accessed via children() individually. It may also have performance implications, but that is less clear ATM. ----- Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/module-implies-union-tp21790p21793.html Sent from the OpenSCAD mailing list archive at Nabble.com.