polyhedron no top level geometry to render

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

polyhedron no top level geometry to render

juerg.maier
This post has NOT been accepted by the mailing list yet.
simplified polyhedron test

polyhedron(points=[
[0,0,0],[0,0,10],[0,5,0],[0,5,10],
[8,0,0],[8,0,10],[8,5,0],[8,5,10]],

faces=[
[0,1,5],[5,4,0],[4,5,7],[7,6,4],
[6,7,3],[3,2,6],[1,0,2],[2,3,1],
[1,3,7],[7,5,1],[0,2,6],[6,4,0]
]);

this shows up with F5 but I can not create an STL "no top level geometry to render"

What is missing?
Reply | Threaded
Open this post in threaded view
|

Re: polyhedron no top level geometry to render

kitwallace
The last two faces have the wrong vertex order - previewing with View >> Thrown Together  shows this in purple - it renders  when the faces are replaced with [6,2,0],[0,4,6]

Nowadays the faces don't have to be triangles now so you could just define the 6 quadrilateral faces of the cube

Chris
Reply | Threaded
Open this post in threaded view
|

Re: polyhedron no top level geometry to render

juerg.maier
This post has NOT been accepted by the mailing list yet.
Thanks a million, thought I had done that right but it's a bit hard to remember the points (beeing able to attach identifiers to points would be nice - and show its 3d coordinates when hovering over it ...).
Could you possibly give me an example of the "quadrilateral" face declaration as I hear this word the first time.
Reply | Threaded
Open this post in threaded view
|

Re: polyhedron no top level geometry to render

kitwallace
Oh I know, I often get the winding order wrong = 'Thrown together' is your friend.  

I find a reverse function useful in cases where the natural ordering of points is anti-clockwise.

I meant that faces don't have to be triangles so in this case they could be

faces=[
  [0,2,3,1],[4,5,7,6],[0,1,5,4],[2,6,7,3],[0,4,6,2],[1,3,7,5]
]

Chris
Reply | Threaded
Open this post in threaded view
|

Re: polyhedron no top level geometry to render

Whosawhatsis
CGAL doesn't seem to allow you to have negative closed spaces, and "helpfully" reverses them if it finds one. This prevents exporting objects with hollow spaces, but it should also allow you to fix a polyhedron with all of its faces in the reverse winding order (though not a mix of clockwise and counter-clockwise) by using render().

Note, I haven't tried this, and it's possible (though unlikely, because it probably would have been fixed by now if it were the case) that this check happens right before export, and wouldn't affect render().

On Sunday, April 5, 2015 at 08:13, kitwallace wrote:

Oh I know, I often get the winding order wrong = 'Thrown together' is your
friend.

I find a reverse function useful in cases where the natural ordering of
points is anti-clockwise.

I meant that faces don't have to be triangles so in this case they could be

faces=[
[0,2,3,1],[4,5,7,6],[0,1,5,4],[2,6,7,3],[0,4,6,2],[1,3,7,5]
]

Chris



--
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org