M
MichaelAtOz
Thu, May 25, 2017 12:35 PM
The issue is related to, but not only, z-fighting
https://en.wikipedia.org/wiki/Z-fighting .
With CSG https://en.wikipedia.org/wiki/Constructive_solid_geometry , and
a difference, or union, you cannot have two object sharing the same
place/surface. The software doesn't know which should or shouldn't be
subtracted or added.
So you need to, for difference - make the subtracted object extend a
'little' beyond the surface of the base object, for union - make the joined
object embed a 'little' into the other object.
See the wiki
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Display .
And this change:
s=0.1;
s2=s*2;
prec=90;
difference() {
hull(){
translate ([-47,2,5])
rotate ([90,0,0]) cylinder (2,r=5, $fn=prec);
translate ([47,2,5])
rotate ([90,0,0]) cylinder (2,r=5, $fn=prec);
translate ([-52,2,22])
rotate ([90,0,0]) cube ([10,10,2], center=false);
translate ([42,2,22])
rotate ([90,0,0]) cube ([10,10,2], center=false);
}
// évidement
hull(){
translate ([-20,2+s,17])
rotate ([90,0,0]) cylinder (2+s2,r=5, $fn=prec);
translate ([20,2+s,17])
rotate ([90,0,0]) cylinder (2+s2,r=5, $fn=prec);
translate ([-25,2+s,22+s])
rotate ([90,0,0]) cube ([10,10,2+s2], center=false);
translate ([15,2+s,22+s])
rotate ([90,0,0]) cube ([10,10,2+s2], center=false);
}
}
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/i-am-crazy-of-openscad-but-openscad-makes-me-crazy-tp21571p21572.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
The issue is related to, but not only, z-fighting
<https://en.wikipedia.org/wiki/Z-fighting> .
With CSG <https://en.wikipedia.org/wiki/Constructive_solid_geometry> , and
a difference, or union, you cannot have two object sharing the same
place/surface. The software doesn't know which should or shouldn't be
subtracted or added.
So you need to, for difference - make the subtracted object extend a
'little' beyond the surface of the base object, for union - make the joined
object embed a 'little' into the other object.
See the wiki
<https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Display> .
And this change:
s=0.1;
s2=s*2;
prec=90;
difference() {
hull(){
translate ([-47,2,5])
rotate ([90,0,0]) cylinder (2,r=5, $fn=prec);
translate ([47,2,5])
rotate ([90,0,0]) cylinder (2,r=5, $fn=prec);
translate ([-52,2,22])
rotate ([90,0,0]) cube ([10,10,2], center=false);
translate ([42,2,22])
rotate ([90,0,0]) cube ([10,10,2], center=false);
}
// évidement
hull(){
translate ([-20,2+s,17])
rotate ([90,0,0]) cylinder (2+s2,r=5, $fn=prec);
translate ([20,2+s,17])
rotate ([90,0,0]) cylinder (2+s2,r=5, $fn=prec);
translate ([-25,2+s,22+s])
rotate ([90,0,0]) cube ([10,10,2+s2], center=false);
translate ([15,2+s,22+s])
rotate ([90,0,0]) cube ([10,10,2+s2], center=false);
}
}
-----
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/i-am-crazy-of-openscad-but-openscad-makes-me-crazy-tp21571p21572.html
Sent from the OpenSCAD mailing list archive at Nabble.com.