Hello
I am encountering something weird. Maybe somebody can explain or give a
hint as to what I am doing wrong.
Consider following script:
color ("red")
translate ([-19.7,0,-68.28])
rotate ([0,0,180])
polyhedron(
points=[
[20,10,0], // 0
[20,-10,0], // 1
[-8,0,0], // 2
[20,0,28] // 3
],
faces=[
[1,2,3],
[0,2,3],
[0,1,3],
[0,1,2],
]
);
color ("blue")
translate ([-7.09,6.52,-68.28])
rotate ([0,0,54.7])
polyhedron(
points=[
[43,10,0], // 0
[43,-10,0], // 1
[-8,0,0], // 2
[40.4,0,28] // 3
],
faces=[
[1,2,3],
[0,2,3],
[0,1,3],
[0,1,2],
]
);
Which looks like this in preview:
[image: image.png]
However, yields this error when rendering... and an empty drawing:
Compiling design (CSG Tree generation)…
Rendering Polygon Mesh using CGAL…
ERROR: The given mesh is not closed! Unable to convert to
CGAL_Nef_Polyhedron.
ERROR: The given mesh is not closed! Unable to convert to
CGAL_Nef_Polyhedron.
Geometries in cache: 50
Geometry cache size in bytes: 300616
CGAL Polyhedrons in cache: 7
CGAL cache size in bytes: 4911720
Total rendering time: 0:00:00.040
WARNING: No top level geometry to render
Even more strange, if I delete any of the two tetrahedrons from the script,
the remaining one is rendered without problem.
Thank you in advance for any advice.
Half of your faces have the wrong winding order.
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#Mis-ordered_faces
On Fri, Sep 17, 2021 at 6:42 AM Zoltán Zörgő zoltan.zorgo@gmail.com wrote:
Hello
I am encountering something weird. Maybe somebody can explain or give a
hint as to what I am doing wrong.
Consider following script:
color ("red")
translate ([-19.7,0,-68.28])
rotate ([0,0,180])
polyhedron(
points=[
[20,10,0], // 0
[20,-10,0], // 1
[-8,0,0], // 2
[20,0,28] // 3
],
faces=[
[1,2,3],
[0,2,3],
[0,1,3],
[0,1,2],
]
);
color ("blue")
translate ([-7.09,6.52,-68.28])
rotate ([0,0,54.7])
polyhedron(
points=[
[43,10,0], // 0
[43,-10,0], // 1
[-8,0,0], // 2
[40.4,0,28] // 3
],
faces=[
[1,2,3],
[0,2,3],
[0,1,3],
[0,1,2],
]
);
Which looks like this in preview:
[image: image.png]
However, yields this error when rendering... and an empty drawing:
Compiling design (CSG Tree generation)…
Rendering Polygon Mesh using CGAL…
ERROR: The given mesh is not closed! Unable to convert to
CGAL_Nef_Polyhedron.
ERROR: The given mesh is not closed! Unable to convert to
CGAL_Nef_Polyhedron.
Geometries in cache: 50
Geometry cache size in bytes: 300616
CGAL Polyhedrons in cache: 7
CGAL cache size in bytes: 4911720
Total rendering time: 0:00:00.040
WARNING: No top level geometry to render
Even more strange, if I delete any of the two tetrahedrons from the
script, the remaining one is rendered without problem.
Thank you in advance for any advice.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On 9/17/2021 6:41 AM, Hans L wrote:
Half of your faces have the wrong winding order.
Yes.
Comment out the "color" settings, because they confuse the issue, and
then select View / Thrown Together, and F5.
Note that some of your faces are yellow (good) and some of your faces
are purple (bad). You need to reverse the order of the vertices in the
purple faces, until all of the faces are yellow. Here's what that looks
like:
Also, a hint: when offering a program for analysis, brutally strip out
everything that is not necessary to demonstrate the problem. Don't make
the reader understand anything other than that. The rotates and
translates in your program are not necessary to demonstrate the problem,
except perhaps a translate to keep the polyhedra from overlapping. Make
the numbers as simple as possible.
Here's such a simplified version of your example:
polyhedron(
points=[
[10,10,0], // 0
[10,0,0], // 1
[0,0,0], // 2
[10,0,10] // 3
],
faces=[
[1,2,3],
[0,2,3],
[0,1,3],
[0,1,2],
]
);
translate([20,0,0]) polyhedron(
points=[
[10,10,0], // 0
[10,0,0], // 1
[0,0,0], // 2
[10,0,10] // 3
],
faces=[
[1,2,3],
[0,2,3],
[0,1,3],
[0,1,2],
]
);