I'm new to OpenSCAD, so apologies if this is a rookie error or a know issue,
but I haven't been able to find any references to searching the forum or
github bug tracker. I'm posting here to try and find out if this is a true
bug or if I'm making a mistake!
My issue is that a polyhedron will often render missing some faces; consider
the following minimal example (screenshot of my result at the bottom):
Note that if I render the polyhedron without the cube afterward (i.e. just
the first line), it renders correctly. My workaround has been two wrap the
polyhedron in a "hull", but this seems dangerous; what if a more complex
polyhedron fails such that one of the vertices has no faces meeting it? It
would get miss off the hull, I suspect.
On 2018-11-30 15:09, matt_391 wrote:
> polyhedron( points = [[0,0,0] , [10,0,0] , [0,10,0] , [0,0,10]] , faces
> translate([20,0,0]) cube(5);
> Note that if I render the polyhedron without the cube afterward (i.e.
> the first line), it renders correctly.
Actually, it does not. Press F12 (View -> Thrown Together) to see if any
faces are inside-out, indicated by red color. In this case the triangle
in the XZ-plane and the one that touches each global axis are both
inside-out, making it an invalid polyhedron. All face normals should
point out of the polyhedron to make it valid. To achieve this, the face
vertices must be listed in CW order as seen from outside the polyhedron
(this is opposite convention to other software, but anyway).
Wrapping the polyhedron in a hull will work in this case as the hull
will discard the faces and define new ones with proper orientations.
This will be ok as long as the polyhedron is convex, but will as you
undicate not work for polyhedra with concavities.