DW
Dan White
Sat, Sep 25, 2021 12:30 AM
Trying something with code from Geodesic Maths for OpenScad - ThingiversePreview is fine.Trying to render coughs out Rendering Polygon Mesh using CGAL...ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron.If I take out the cylinder, no error.I even extracted code from maths_geodesic.scad so I might isolate any problem, but no joy.OpenSCAD 2021.01running on a MacBookPro running Big Sur (macOS 11.6)# ------------------- BEGIN CODE -------------------//include <maths_geodesic.scad>//--------------------------------------------//WITHOUT <maths_geodesic.scad>Cepsilon = 0.00000001;function sph(long, lat, rad=1) = [long, lat, rad];// Clean: Correctedfunction clean(n) = (n < 0) ? ((n < -Cepsilon) ? n : 0) : (n < Cepsilon) ? 0 : n;// Convert spherical to cartesianfunction sph_to_cart(s) = [clean(s[2]*sin(s[1])*cos(s[0])), clean(s[2]*sin(s[1])*sin(s[0])),clean(s[2]*cos(s[1]))];//--------------------------------------------module icosahedron ( radius = 1 ) { foo = atan ( 0.500 ) ; polyhedron( points = [ sph_to_cart ( sph( 0, 0, rad = radius ) ) , // 0 sph_to_cart ( sph( 36, 90 - foo, rad = radius ) ) , // 1 sph_to_cart ( sph( 108, 90 - foo, rad = radius ) ) , // 2 sph_to_cart ( sph( 180, 90 - foo, rad = radius ) ) , // 3 sph_to_cart ( sph( 252, 90 - foo, rad = radius ) ) , // 4 sph_to_cart ( sph( 324, 90 - foo, rad = radius ) ) , // 5 sph_to_cart ( sph( 72, 90 + foo, rad = radius ) ) , // 6 sph_to_cart ( sph( 144, 90 + foo, rad = radius ) ) , // 7 sph_to_cart ( sph( 216, 90 + foo, rad = radius ) ) , // 8 sph_to_cart ( sph( 288, 90 + foo, rad = radius ) ) , // 9 sph_to_cart ( sph( 360, 90 + foo, rad = radius ) ) , // 10 sph_to_cart ( sph( 0, 180, rad = radius ) ) // 11 ], faces = [ [ 0, 1, 2], [ 0, 2, 3 ], [ 0, 3, 4 ], [ 0, 4, 5 ], [ 0, 5, 1 ], [ 1, 6, 10 ], [ 2, 6, 1 ], [ 2, 6, 7 ], [ 2, 3, 7 ], [ 3, 7, 8 ], [ 3, 8, 4 ], [ 4, 8, 9 ], [ 4, 9, 5 ], [ 5, 9, 10 ], [ 5,10, 1 ], [ 11, 6, 7 ], [ 11, 7, 8 ], [ 11, 8, 9 ], [ 11, 9, 10 ], [ 11, 10, 6 ] ], convexity = 1 ) ;}icosahedron ( ) ;cylinder ( h = 0.01, r = 1, $fn = 25 ) ;# ------------------- END CODE -------------------Dan White | d_e_white@icloud.com
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” (Bill Waterson: Calvin & Hobbes)
Trying something with code from Geodesic Maths for OpenScad - ThingiversePreview is fine.Trying to render coughs out Rendering Polygon Mesh using CGAL...ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron.If I take out the cylinder, no error.I even extracted code from maths_geodesic.scad so I might isolate any problem, but no joy.OpenSCAD 2021.01running on a MacBookPro running Big Sur (macOS 11.6)# ------------------- BEGIN CODE -------------------//include <maths_geodesic.scad>//--------------------------------------------//WITHOUT <maths_geodesic.scad>Cepsilon = 0.00000001;function sph(long, lat, rad=1) = [long, lat, rad];// Clean: Correctedfunction clean(n) = (n < 0) ? ((n < -Cepsilon) ? n : 0) : (n < Cepsilon) ? 0 : n;// Convert spherical to cartesianfunction sph_to_cart(s) = [clean(s[2]*sin(s[1])*cos(s[0])), clean(s[2]*sin(s[1])*sin(s[0])),clean(s[2]*cos(s[1]))];//--------------------------------------------module icosahedron ( radius = 1 ) { foo = atan ( 0.500 ) ; polyhedron( points = [ sph_to_cart ( sph( 0, 0, rad = radius ) ) , // 0 sph_to_cart ( sph( 36, 90 - foo, rad = radius ) ) , // 1 sph_to_cart ( sph( 108, 90 - foo, rad = radius ) ) , // 2 sph_to_cart ( sph( 180, 90 - foo, rad = radius ) ) , // 3 sph_to_cart ( sph( 252, 90 - foo, rad = radius ) ) , // 4 sph_to_cart ( sph( 324, 90 - foo, rad = radius ) ) , // 5 sph_to_cart ( sph( 72, 90 + foo, rad = radius ) ) , // 6 sph_to_cart ( sph( 144, 90 + foo, rad = radius ) ) , // 7 sph_to_cart ( sph( 216, 90 + foo, rad = radius ) ) , // 8 sph_to_cart ( sph( 288, 90 + foo, rad = radius ) ) , // 9 sph_to_cart ( sph( 360, 90 + foo, rad = radius ) ) , // 10 sph_to_cart ( sph( 0, 180, rad = radius ) ) // 11 ], faces = [ [ 0, 1, 2], [ 0, 2, 3 ], [ 0, 3, 4 ], [ 0, 4, 5 ], [ 0, 5, 1 ], [ 1, 6, 10 ], [ 2, 6, 1 ], [ 2, 6, 7 ], [ 2, 3, 7 ], [ 3, 7, 8 ], [ 3, 8, 4 ], [ 4, 8, 9 ], [ 4, 9, 5 ], [ 5, 9, 10 ], [ 5,10, 1 ], [ 11, 6, 7 ], [ 11, 7, 8 ], [ 11, 8, 9 ], [ 11, 9, 10 ], [ 11, 10, 6 ] ], convexity = 1 ) ;}icosahedron ( ) ;cylinder ( h = 0.01, r = 1, $fn = 25 ) ;# ------------------- END CODE -------------------Dan White | d_e_white@icloud.com
------------------------------------------------
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” (Bill Waterson: Calvin & Hobbes)