discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Clarifying behaviors

MK
Marius Kintel
Fri, Nov 25, 2016 3:04 PM

On Nov 25, 2016, at 08:20, Ronaldo rcmpersiano@gmail.com wrote:

I may do an addition to the Manual but I need beforehand Kintel's agreement.
I understand that equivalence may be ambiguous or too strong but we may say
that both models above express the same geometry and topology eventually
with different internal and external representations.

If you suggest (or simply edit) the manual, we can massage it into place.
To clarify, is this what you’re asking for? “If a user-defined polyhedron describes a polygon soup, we will attempt to reconstruct a manifold mesh from that polygon soup, in a similar way as from triangle soups in STL files”.

I can think of corner cases, e.g.:
Self-intersecting polyhedra which touches itself in one (non-manifold)  point. That point will, at least when represented in e.g. 3mf, need to be represented as two separate topological vertices. We currently don’t have any way of doing this in OpenSCAD but that may change.

-Marius

> On Nov 25, 2016, at 08:20, Ronaldo <rcmpersiano@gmail.com> wrote: > > I may do an addition to the Manual but I need beforehand Kintel's agreement. > I understand that equivalence may be ambiguous or too strong but we may say > that both models above express the same geometry and topology eventually > with different internal and external representations. > If you suggest (or simply edit) the manual, we can massage it into place. To clarify, is this what you’re asking for? “If a user-defined polyhedron describes a polygon soup, we will _attempt_ to reconstruct a manifold mesh from that polygon soup, in a similar way as from triangle soups in STL files”. I can think of corner cases, e.g.: Self-intersecting polyhedra which touches itself in one (non-manifold) point. That point will, at least when represented in e.g. 3mf, need to be represented as two separate topological vertices. We currently don’t have any way of doing this in OpenSCAD but that may change. -Marius
R
Ronaldo
Sat, Nov 26, 2016 5:56 PM

Thank you, Kintel. Your soup recipe bellow is exactly what I would expect:

 “If a user-defined polyhedron describes a polygon soup, we will

attempt to reconstruct a manifold mesh from that polygon soup, in a
similar way as from triangle soups in STL files”

I will try to write some clarifying text to be included in the manual and
submit it here later.

Following Torsten suggestion, here you have a test case that might be
included in the test suite:

// the following should render without any CGAL error or warnings
p = [[0,0,0],[10,0,0],[0,10,0],[0,0,10],[10,0,0],[0,10,0],[0,0,10]];
difference() {
polyhedron(points=p, faces=[[0,2,1], [0,1,3], [0,3,2], [4,5,6] ]);
translate([5,0,0]) cube(10);
}

tp3 wrote

On 25 Nov, 2016 at 11:37, Torsten wrote:
If this clarification is much desired, the best
strategy is to create an issue on github as it's
not as easily lost as some mails/forum entries.

Good suggestion but I am not acquainted enough with issue protocol of github
to do it myself. So I ask your help to do it for me.

--
View this message in context: http://forum.openscad.org/Clarifying-behaviors-tp18492p19371.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Thank you, Kintel. Your soup recipe bellow is exactly what I would expect: > “If a user-defined polyhedron describes a polygon soup, we will > _attempt_ to reconstruct a manifold mesh from that polygon soup, in a > similar way as from triangle soups in STL files” I will try to write some clarifying text to be included in the manual and submit it here later. Following Torsten suggestion, here you have a test case that might be included in the test suite: > // the following should render without any CGAL error or warnings > p = [[0,0,0],[10,0,0],[0,10,0],[0,0,10],[10,0,0],[0,10,0],[0,0,10]]; > difference() { > polyhedron(points=p, faces=[[0,2,1], [0,1,3], [0,3,2], [4,5,6] ]); > translate([5,0,0]) cube(10); > } tp3 wrote > On 25 Nov, 2016 at 11:37, Torsten wrote: > If this clarification is much desired, the best > strategy is to create an issue on github as it's > not as easily lost as some mails/forum entries. Good suggestion but I am not acquainted enough with issue protocol of github to do it myself. So I ask your help to do it for me. -- View this message in context: http://forum.openscad.org/Clarifying-behaviors-tp18492p19371.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Sun, Nov 27, 2016 6:53 PM

On 11/26/2016 06:56 PM, Ronaldo wrote:

Good suggestion but I am not acquainted enough with issue
protocol of github to do it myself. So I ask your help to
do it for me.

I've created https://github.com/openscad/openscad/issues/1874

Please check and comment what's missing / misunderstood...

ciao,
Torsten.

On 11/26/2016 06:56 PM, Ronaldo wrote: > Good suggestion but I am not acquainted enough with issue > protocol of github to do it myself. So I ask your help to > do it for me. > I've created https://github.com/openscad/openscad/issues/1874 Please check and comment what's missing / misunderstood... ciao, Torsten.
RP
Ronaldo Persiano
Sun, Nov 27, 2016 7:24 PM

2016-11-27 16:53 GMT-02:00 Torsten Paul Torsten.Paul@gmx.de:

I've created https://github.com/openscad/openscad/issues/1874

Please check and comment what's missing / misunderstood...

Nice, Torsten. Thank you.

2016-11-27 16:53 GMT-02:00 Torsten Paul <Torsten.Paul@gmx.de>: > I've created https://github.com/openscad/openscad/issues/1874 > > Please check and comment what's missing / misunderstood... > Nice, Torsten. Thank you.
R
Ronaldo
Mon, Nov 28, 2016 9:38 PM

kintel wrote

If you suggest (or simply edit) the manual, we can massage it into place.
To clarify, is this what you’re asking for? “If a user-defined polyhedron
describes a polygon soup, we will attempt to reconstruct a manifold mesh
from that polygon soup, in a similar way as from triangle soups in STL
files”.

Kintel, this is my proposal for a text to be included in the Manual:

Repeated vertices in the point list of polyhedron


When the polyhedron is built by a code, it may happen that a point appear
more than once in the polyhedron point list and that they both are
referred by the polyhedron face list. In this case, the repeated point
will be treated as if it is the same polyhedron vertex. That is:  if a
user-defined polyhedron describes a polygon set, OpenSCAD will do its best
to reconstruct a manifold mesh from that polygon set, in a similar way as
from triangle sets in STL files. Here is an example:

p = [[0,0,0],[10,0,0],[0,10,0],[0,0,10],[10,0,0],[0,10,0],[0,0,10]];
polyhedron(points=p, faces=[[0,2,1], [0,1,3], [0,3,2], [4,5,6] ]);

This is the definition of a tetrahedron. The last three points in the
point list p are repetitions of previous vertices in the list. The last
face [4,5,6] refer to them but could also be defined as [1,2,3]. Both
definitions will lead to the same tetrahedron model.

I have changed your "soup" to something more formal. Be free to change
anything in the text including my bad English. Perhaps, it should be
mentioned that spurious points not used by any face are discarded.

--
View this message in context: http://forum.openscad.org/Clarifying-behaviors-tp18492p19394.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

kintel wrote > If you suggest (or simply edit) the manual, we can massage it into place. > To clarify, is this what you’re asking for? “If a user-defined polyhedron > describes a polygon soup, we will _attempt_ to reconstruct a manifold mesh > from that polygon soup, in a similar way as from triangle soups in STL > files”. Kintel, this is my proposal for a text to be included in the Manual: > Repeated vertices in the point list of polyhedron > ________________________________________ > > When the polyhedron is built by a code, it may happen that a point appear > more than once in the polyhedron point list and that they both are > referred by the polyhedron face list. In this case, the repeated point > will be treated as if it is the same polyhedron vertex. That is: if a > user-defined polyhedron describes a polygon set, OpenSCAD will do its best > to reconstruct a manifold mesh from that polygon set, in a similar way as > from triangle sets in STL files. Here is an example: >> p = [[0,0,0],[10,0,0],[0,10,0],[0,0,10],[10,0,0],[0,10,0],[0,0,10]]; >> polyhedron(points=p, faces=[[0,2,1], [0,1,3], [0,3,2], [4,5,6] ]); > This is the definition of a tetrahedron. The last three points in the > point list p are repetitions of previous vertices in the list. The last > face [4,5,6] refer to them but could also be defined as [1,2,3]. Both > definitions will lead to the same tetrahedron model. I have changed your "soup" to something more formal. Be free to change anything in the text including my bad English. Perhaps, it should be mentioned that spurious points not used by any face are discarded. -- View this message in context: http://forum.openscad.org/Clarifying-behaviors-tp18492p19394.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Mon, Nov 28, 2016 10:03 PM

On Nov 28, 2016, at 16:38, Ronaldo rcmpersiano@gmail.com wrote:

Kintel, this is my proposal for a text to be included in the Manual:
I have changed your "soup" to something more formal.

Thanks!
Note: I used the expression “polygon soup” as it’s a very common expression in the computer graphics community: https://en.wikipedia.org/wiki/Polygon_soup

-Marius

> On Nov 28, 2016, at 16:38, Ronaldo <rcmpersiano@gmail.com> wrote: > > Kintel, this is my proposal for a text to be included in the Manual: > I have changed your "soup" to something more formal. Thanks! Note: I used the expression “polygon soup” as it’s a very common expression in the computer graphics community: https://en.wikipedia.org/wiki/Polygon_soup -Marius
RP
Ronaldo Persiano
Mon, Nov 28, 2016 10:47 PM

My ignorance. Let us use it then.

2016-11-28 20:03 GMT-02:00 Marius Kintel marius@kintel.net:

Thanks!
Note: I used the expression “polygon soup” as it’s a very common
expression in the computer graphics community:
https://en.wikipedia.org/wiki/Polygon_soup

-Marius

My ignorance. Let us use it then. 2016-11-28 20:03 GMT-02:00 Marius Kintel <marius@kintel.net>: > Thanks! > Note: I used the expression “polygon soup” as it’s a very common > expression in the computer graphics community: > https://en.wikipedia.org/wiki/Polygon_soup > > -Marius >