I would like to import an stl file and then add a shape.
If I render ONLY the stl file (F6), everything is fine!!!
If I create a base for it, however, it runs into an error:
ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron.
WHY????
$fn=64;
turret_height = 25;
p0 = 0;
p1 = 50;
p2 = 60;
module base(){
difference(){
cylinder(h=15, r1=50, r2=52, center=true);
translate([0,0,5])
cylinder(h=15, r1=47, r2=49, center=true);
}//difference
}
module d_base(){
difference(){
base();
translate([0,0,1])
for (i=[0 : 45 : 360]) {
rotate([0, 0, i])
linear_extrude(height = turret_height) {
polygon( points=[[0,0],[p2,p1],[p1,p2]] );
} //linear_extrude
} //for
} //difference
} //module
module gorilla(){
resize([48,0,0], auto=true)
translate([0,0,3])
import("buddha_gorilla.stl",convexity=10);
}
gorilla();
d_base();
/*union(){
gorilla();
d_base();
}//union
*/
without the stl file to import, it's just a rough guess on my part, not being particularly skilled with OpenSCAD, but I'd venture a guess that the imported file sits on the x/y plane and your d_base is slightly below that level. Translate one down or the other up and aim for a bit of overlap (i.e., 0.0625 mm) to ensure a clean join/union.
On Friday, March 3, 2023 at 08:03:26 AM EST, gmagyar6@gmail.com <gmagyar6@gmail.com> wrote:
I would like to import an stl file and then add a shape.
If I render ONLY the stl file (F6), everything is fine!!!
If I create a base for it, however, it runs into an error:
ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron.
WHY????
$fn=64;
turret_height = 25;
p0 = 0;
p1 = 50;
p2 = 60;
module base(){
difference(){
cylinder(h=15, r1=50, r2=52, center=true);
translate([0,0,5])
cylinder(h=15, r1=47, r2=49, center=true);
}//difference
}
module d_base(){
difference(){
base();
translate([0,0,1])
for (i=[0 : 45 : 360]) {
rotate([0, 0, i])
linear_extrude(height = turret_height) {
polygon( points=[[0,0],[p2,p1],[p1,p2]] );
} //linear_extrude
} //for
} //difference
} //module
module gorilla(){
resize([48,0,0], auto=true)
translate([0,0,3])
import("buddha_gorilla.stl",convexity=10);
}
gorilla();
d_base();
/*union(){
gorilla();
d_base();
}//union
*/
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
... which unfortunately doesn't mention that the geometry calculation
mentioned doesn't really happen until you have a second object.
Thanks!!
“but I'd venture a guess that the imported file sits on the x/y plane and your d_base is slightly below that level“
How can I check this?
The stl file:
https://drive.google.com/file/d/1obJKqO5HVk4BSYG67ADb5i2W3FSeXz0p/view?usp=share_link
I double checked by translating your gorilla below the x/y plane even more than it was. My guess was wrong as the result is the same. I also imported the gorilla into Meshmixer which reports no problem with the mesh.
I changed the code a bit and imported the gorilla into the progam without scaling and it still fails. It doesn't fail when it's the gorilla alone.Bypassing everything except the gorilla and a simple cube creates a failure as well. That code was simple import the gorilla un-scaled, un-translated and add a cube(10) to the scene. Failed.
Perhaps a bug?
On Saturday, March 4, 2023 at 09:40:43 AM EST, gmagyar6@gmail.com <gmagyar6@gmail.com> wrote:
Thanks!!
“but I'd venture a guess that the imported file sits on the x/y plane and your d_base is slightly below that level“
How can I check this?
The stl file:
https://drive.google.com/file/d/1obJKqO5HVk4BSYG67ADb5i2W3FSeXz0p/view?usp=share_link
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org