discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

degenerate polyhedron faces ok?

A
adrianv
Tue, Nov 19, 2019 1:24 AM

Is it legal to give a polyhedron faces that have zero area, e.g. a face like
[ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]?  Or a degenerate "triangle" like
[[0,0,0],[0,0,0],[0,0,1]]?  What about a completely degenerate faces where
all vertices are equal?

In trying to implement a certain degenerate case in my code I have used some
degenerate faces and it appears to work.  (I can render, and add multiple
polyhedra to the model.)  But I wonder if there might be hidden problems.

--
Sent from: http://forum.openscad.org/

Is it legal to give a polyhedron faces that have zero area, e.g. a face like [ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]? Or a degenerate "triangle" like [[0,0,0],[0,0,0],[0,0,1]]? What about a completely degenerate faces where all vertices are equal? In trying to implement a certain degenerate case in my code I have used some degenerate faces and it appears to work. (I can render, and add multiple polyhedra to the model.) But I wonder if there might be hidden problems. -- Sent from: http://forum.openscad.org/
DM
Doug Moen
Tue, Nov 19, 2019 1:26 AM

Degenerate faces like this should generally be avoided. The face has zero area, and the normal vector is [0,0,0]. That's considered defective, and some programs will not allow you to import such a mesh. Other programs won't have a problem.

On Mon, Nov 18, 2019, at 8:24 PM, adrianv wrote:

Is it legal to give a polyhedron faces that have zero area, e.g. a face like
[ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]?  Or a degenerate "triangle" like
[[0,0,0],[0,0,0],[0,0,1]]?  What about a completely degenerate faces where
all vertices are equal?

In trying to implement a certain degenerate case in my code I have used some
degenerate faces and it appears to work.  (I can render, and add multiple
polyhedra to the model.)  But I wonder if there might be hidden problems.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Degenerate faces like this should generally be avoided. The face has zero area, and the normal vector is [0,0,0]. That's considered defective, and some programs will not allow you to import such a mesh. Other programs won't have a problem. On Mon, Nov 18, 2019, at 8:24 PM, adrianv wrote: > Is it legal to give a polyhedron faces that have zero area, e.g. a face like > [ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]? Or a degenerate "triangle" like > [[0,0,0],[0,0,0],[0,0,1]]? What about a completely degenerate faces where > all vertices are equal? > > In trying to implement a certain degenerate case in my code I have used some > degenerate faces and it appears to work. (I can render, and add multiple > polyhedra to the model.) But I wonder if there might be hidden problems. > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
NH
nop head
Tue, Nov 19, 2019 9:20 AM

I think CGAL will throw an exception if you do a union with a unit cube();

On Tue, 19 Nov 2019 at 01:27, Doug Moen doug@moens.org wrote:

Degenerate faces like this should generally be avoided. The face has zero
area, and the normal vector is [0,0,0]. That's considered defective, and
some programs will not allow you to import such a mesh. Other programs
won't have a problem.

On Mon, Nov 18, 2019, at 8:24 PM, adrianv wrote:

Is it legal to give a polyhedron faces that have zero area, e.g. a face

like

[ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]?  Or a degenerate "triangle" like
[[0,0,0],[0,0,0],[0,0,1]]?  What about a completely degenerate faces

where

all vertices are equal?

In trying to implement a certain degenerate case in my code I have used

some

degenerate faces and it appears to work.  (I can render, and add multiple
polyhedra to the model.)  But I wonder if there might be hidden

problems.

I think CGAL will throw an exception if you do a union with a unit cube(); On Tue, 19 Nov 2019 at 01:27, Doug Moen <doug@moens.org> wrote: > Degenerate faces like this should generally be avoided. The face has zero > area, and the normal vector is [0,0,0]. That's considered defective, and > some programs will not allow you to import such a mesh. Other programs > won't have a problem. > > On Mon, Nov 18, 2019, at 8:24 PM, adrianv wrote: > > Is it legal to give a polyhedron faces that have zero area, e.g. a face > like > > [ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]? Or a degenerate "triangle" like > > [[0,0,0],[0,0,0],[0,0,1]]? What about a completely degenerate faces > where > > all vertices are equal? > > > > In trying to implement a certain degenerate case in my code I have used > some > > degenerate faces and it appears to work. (I can render, and add multiple > > polyhedra to the model.) But I wonder if there might be hidden > problems. > > > > > > > > > > -- > > Sent from: http://forum.openscad.org/ > > > > _______________________________________________ > > OpenSCAD mailing list > > Discuss@lists.openscad.org > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
A
adrianv
Tue, Nov 19, 2019 11:14 AM

Nope.  Adding more geometry doesn't cause render to fail.

nophead wrote

I think CGAL will throw an exception if you do a union with a unit cube();

On Tue, 19 Nov 2019 at 01:27, Doug Moen <

doug@

> wrote:

Degenerate faces like this should generally be avoided. The face has zero
area, and the normal vector is [0,0,0]. That's considered defective, and
some programs will not allow you to import such a mesh. Other programs
won't have a problem.

On Mon, Nov 18, 2019, at 8:24 PM, adrianv wrote:

Is it legal to give a polyhedron faces that have zero area, e.g. a face

like

[ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]?  Or a degenerate "triangle" like
[[0,0,0],[0,0,0],[0,0,1]]?  What about a completely degenerate faces

where

all vertices are equal?

In trying to implement a certain degenerate case in my code I have used

some

degenerate faces and it appears to work.  (I can render, and add

multiple

polyhedra to the model.)  But I wonder if there might be hidden

problems.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list

Discuss@.openscad

Discuss@.openscad

Discuss@.openscad

Nope. Adding more geometry doesn't cause render to fail. nophead wrote > I think CGAL will throw an exception if you do a union with a unit cube(); > > On Tue, 19 Nov 2019 at 01:27, Doug Moen &lt; > doug@ > &gt; wrote: > >> Degenerate faces like this should generally be avoided. The face has zero >> area, and the normal vector is [0,0,0]. That's considered defective, and >> some programs will not allow you to import such a mesh. Other programs >> won't have a problem. >> >> On Mon, Nov 18, 2019, at 8:24 PM, adrianv wrote: >> > Is it legal to give a polyhedron faces that have zero area, e.g. a face >> like >> > [ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]? Or a degenerate "triangle" like >> > [[0,0,0],[0,0,0],[0,0,1]]? What about a completely degenerate faces >> where >> > all vertices are equal? >> > >> > In trying to implement a certain degenerate case in my code I have used >> some >> > degenerate faces and it appears to work. (I can render, and add >> multiple >> > polyhedra to the model.) But I wonder if there might be hidden >> problems. >> > >> > >> > >> > >> > -- >> > Sent from: http://forum.openscad.org/ >> > >> > _______________________________________________ >> > OpenSCAD mailing list >> > > Discuss@.openscad >> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > >> >> _______________________________________________ >> OpenSCAD mailing list >> > Discuss@.openscad >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Sent from: http://forum.openscad.org/
NH
nop head
Tue, Nov 19, 2019 12:03 PM

Possibly because simple degenerate triangles get removed but ones where the
sum of two sides equals the third and ones where two sides are equal and
the third is zero don't get removed.

I made a branch where I removed all the degenerate triangles but decided it
was pointless without also removing self intersections because both are
consequences of truncating coordinates and grid snapping.

On Tue, 19 Nov 2019 at 11:01, adrianv avm4@cornell.edu wrote:

Nope.  Adding more geometry doesn't cause render to fail.

nophead wrote

I think CGAL will throw an exception if you do a union with a unit

cube();

On Tue, 19 Nov 2019 at 01:27, Doug Moen <

doug@

> wrote:

Degenerate faces like this should generally be avoided. The face has

zero

area, and the normal vector is [0,0,0]. That's considered defective, and
some programs will not allow you to import such a mesh. Other programs
won't have a problem.

On Mon, Nov 18, 2019, at 8:24 PM, adrianv wrote:

Is it legal to give a polyhedron faces that have zero area, e.g. a

face

like

[ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]?  Or a degenerate "triangle" like
[[0,0,0],[0,0,0],[0,0,1]]?  What about a completely degenerate faces

where

all vertices are equal?

In trying to implement a certain degenerate case in my code I have

used

some

degenerate faces and it appears to work.  (I can render, and add

multiple

polyhedra to the model.)  But I wonder if there might be hidden

problems.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list

Discuss@.openscad

Discuss@.openscad

Discuss@.openscad

Possibly because simple degenerate triangles get removed but ones where the sum of two sides equals the third and ones where two sides are equal and the third is zero don't get removed. I made a branch where I removed all the degenerate triangles but decided it was pointless without also removing self intersections because both are consequences of truncating coordinates and grid snapping. On Tue, 19 Nov 2019 at 11:01, adrianv <avm4@cornell.edu> wrote: > Nope. Adding more geometry doesn't cause render to fail. > > > nophead wrote > > I think CGAL will throw an exception if you do a union with a unit > cube(); > > > > On Tue, 19 Nov 2019 at 01:27, Doug Moen &lt; > > > doug@ > > > &gt; wrote: > > > >> Degenerate faces like this should generally be avoided. The face has > zero > >> area, and the normal vector is [0,0,0]. That's considered defective, and > >> some programs will not allow you to import such a mesh. Other programs > >> won't have a problem. > >> > >> On Mon, Nov 18, 2019, at 8:24 PM, adrianv wrote: > >> > Is it legal to give a polyhedron faces that have zero area, e.g. a > face > >> like > >> > [ [0,0,0],[0,0,0], [0,0,1],[0,0,1]]? Or a degenerate "triangle" like > >> > [[0,0,0],[0,0,0],[0,0,1]]? What about a completely degenerate faces > >> where > >> > all vertices are equal? > >> > > >> > In trying to implement a certain degenerate case in my code I have > used > >> some > >> > degenerate faces and it appears to work. (I can render, and add > >> multiple > >> > polyhedra to the model.) But I wonder if there might be hidden > >> problems. > >> > > >> > > >> > > >> > > >> > -- > >> > Sent from: http://forum.openscad.org/ > >> > > >> > _______________________________________________ > >> > OpenSCAD mailing list > >> > > > > Discuss@.openscad > > >> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >> > > >> > >> _______________________________________________ > >> OpenSCAD mailing list > >> > > > Discuss@.openscad > > >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >> > > > > _______________________________________________ > > OpenSCAD mailing list > > > Discuss@.openscad > > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >