DS
Dan Shriver
Tue, Jul 16, 2019 5:19 PM
I am getting:
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: e->incident_sface() != SFace_const_handle() File:
/opt/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_const_decorator.h
Line: 329
And I am wondering what I should do to avoid it.
If I want to take a 3D shape and make another 3D shape by transposing it so
it overlaps itself (and other shapes) do I have to do a "union () {}"
operation over all of them to clean up intersections between the shapes? I
tried it with and without the union and still get the exception.
I don't think my points are particularly close together. They would be:
[0, 73.2099] [1, 72.66682] [2, 70.4477] [3, 64.1422] [4, 46.9017] [5, 0]
most of the y values are probably irrational but I don't think they are
"too close" (maybe I'm wrong).
I make a polygon with this and then do rotate extrude and scale it [8,8,1]
and [8,12,1]
I am making a catenoidal dome so it is kind of hard for me to avoid
irrational numbers
I am getting:
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: e->incident_sface() != SFace_const_handle() File:
/opt/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_const_decorator.h
Line: 329
And I am wondering what I should do to avoid it.
If I want to take a 3D shape and make another 3D shape by transposing it so
it overlaps itself (and other shapes) do I have to do a "union () {}"
operation over all of them to clean up intersections between the shapes? I
tried it with and without the union and still get the exception.
I don't think my points are particularly close together. They would be:
[0, 73.2099] [1, 72.66682] [2, 70.4477] [3, 64.1422] [4, 46.9017] [5, 0]
most of the y values are probably irrational but I don't think they are
"too close" (maybe I'm wrong).
I make a polygon with this and then do rotate extrude and scale it [8,8,1]
and [8,12,1]
I am making a catenoidal dome so it is kind of hard for me to avoid
irrational numbers
M
MichaelAtOz
Wed, Jul 17, 2019 12:01 AM
If you don't do a union, OpenSCAD does it implicitly, at various places,
including a global one.
Union() does not 'clean up', it just joins objects, if they touch properly.
Don't focus too much on the irrational number issue.
Those points are fine in themselves. Such CGAL errors tend to come from
interactions between objects.
But in this case it comes from the rotate_extrude.
rotate_extrude(angle=360)
{
tip=0; // 0.0001;
polygon(points=[ [tip, 73.2099], [1, 72.66682], [2, 70.4477], [3,
64.1422], [4, 46.9017], [5, 0] ]);
}
cube(); // test for CGAL issues
With tip=0 it gets the CGAL error, I initially suspected it may be a bug. At
first glance I would expect it to be able to make such a shape.
The problem is the tip forms what I call a singularity. If you look at a
sphere it doesn't have such a convergence point. There have been similar
problems with a torus which meets in the middle.
However, I think the problem is at the tip it is infinitely thin. So CGAL
can't tell the difference between the top surface and the inside surface.
A fix is to add a point along the centre axis jut below the tip to provide
thickness.
rotate_extrude(angle=360)
{
thick=0.2; // this value is a design choice you should make
polygon(points=[ [0, 73.2099-thick], [0, 73.2099], [1, 72.66682], [2,
70.4477], [3, 64.1422], [4, 46.9017], [5, 0] ]);
}
cube(1); // test for CGAL issues
That works.
While the base doesn't produce a error, having the taper down to a fine
point is probably asking for trouble.
So I'd also suggest adding a point like [5-0.001, 0] on the end so it isn't
approaching infinitely thin.
Admin - email* me if you need anything, or if I've done something stupid...
- click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Sent from: http://forum.openscad.org/
If you don't do a union, OpenSCAD does it implicitly, at various places,
including a global one.
Union() does not 'clean up', it just joins objects, if they touch properly.
Don't focus too much on the irrational number issue.
Those points are fine in themselves. Such CGAL errors tend to come from
interactions between objects.
But in this case it comes from the rotate_extrude.
rotate_extrude(angle=360)
{
tip=0; // 0.0001;
polygon(points=[ [tip, 73.2099], [1, 72.66682], [2, 70.4477], [3,
64.1422], [4, 46.9017], [5, 0] ]);
}
cube(); // test for CGAL issues
With tip=0 it gets the CGAL error, I initially suspected it may be a bug. At
first glance I would expect it to be able to make such a shape.
The problem is the tip forms what I call a singularity. If you look at a
sphere it doesn't have such a convergence point. There have been similar
problems with a torus which meets in the middle.
However, I think the problem is at the tip it is infinitely thin. So CGAL
can't tell the difference between the top surface and the inside surface.
A fix is to add a point along the centre axis jut below the tip to provide
thickness.
rotate_extrude(angle=360)
{
thick=0.2; // this value is a design choice you should make
polygon(points=[ [0, 73.2099-thick], [0, 73.2099], [1, 72.66682], [2,
70.4477], [3, 64.1422], [4, 46.9017], [5, 0] ]);
}
cube(1); // test for CGAL issues
That works.
While the base doesn't produce a error, having the taper down to a fine
point is probably asking for trouble.
So I'd also suggest adding a point like [5-0.001, 0] on the end so it isn't
approaching infinitely thin.
-----
Admin - email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
--
Sent from: http://forum.openscad.org/
RP
Ronaldo Persiano
Wed, Jul 17, 2019 12:54 AM
In some sense this is a bug of rotate_extrude(). OpenScad complains when
some edge of the polygon crosses the Y Axis because that would generate a
self-intersection 3D object. The current case is a limit case of the
forbiden crossing and OpenScad should issue an error as well.
A terça, 16/07/2019, 21:02, MichaelAtOz oz.at.michael@gmail.com escreveu:
If you don't do a union, OpenSCAD does it implicitly, at various places,
including a global one.
Union() does not 'clean up', it just joins objects, if they touch properly.
Don't focus too much on the irrational number issue.
Those points are fine in themselves. Such CGAL errors tend to come from
interactions between objects.
But in this case it comes from the rotate_extrude.
rotate_extrude(angle=360)
{
tip=0; // 0.0001;
polygon(points=[ [tip, 73.2099], [1, 72.66682], [2, 70.4477], [3,
64.1422], [4, 46.9017], [5, 0] ]);
}
cube(); // test for CGAL issues
With tip=0 it gets the CGAL error, I initially suspected it may be a bug.
At
first glance I would expect it to be able to make such a shape.
The problem is the tip forms what I call a singularity. If you look at a
sphere it doesn't have such a convergence point. There have been similar
problems with a torus which meets in the middle.
However, I think the problem is at the tip it is infinitely thin. So CGAL
can't tell the difference between the top surface and the inside surface.
A fix is to add a point along the centre axis jut below the tip to provide
thickness.
rotate_extrude(angle=360)
{
thick=0.2; // this value is a design choice you should make
polygon(points=[ [0, 73.2099-thick], [0, 73.2099], [1, 72.66682], [2,
70.4477], [3, 64.1422], [4, 46.9017], [5, 0] ]);
}
cube(1); // test for CGAL issues
That works.
While the base doesn't produce a error, having the taper down to a fine
point is probably asking for trouble.
So I'd also suggest adding a point like [5-0.001, 0] on the end so it isn't
approaching infinitely thin.
Admin - email* me if you need anything, or if I've done something stupid...
- click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it!
http://www.ourfairdeal.org/ time is running out!
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
In some sense this is a bug of rotate_extrude(). OpenScad complains when
some edge of the polygon crosses the Y Axis because that would generate a
self-intersection 3D object. The current case is a limit case of the
forbiden crossing and OpenScad should issue an error as well.
A terça, 16/07/2019, 21:02, MichaelAtOz <oz.at.michael@gmail.com> escreveu:
> If you don't do a union, OpenSCAD does it implicitly, at various places,
> including a global one.
> Union() does not 'clean up', it just joins objects, if they touch properly.
>
> Don't focus too much on the irrational number issue.
>
> Those points are fine in themselves. Such CGAL errors tend to come from
> interactions between objects.
>
> But in this case it comes from the rotate_extrude.
>
> rotate_extrude(angle=360)
> {
> tip=0; // 0.0001;
> polygon(points=[ [tip, 73.2099], [1, 72.66682], [2, 70.4477], [3,
> 64.1422], [4, 46.9017], [5, 0] ]);
> }
> cube(); // test for CGAL issues
>
> With tip=0 it gets the CGAL error, I initially suspected it may be a bug.
> At
> first glance I would expect it to be able to make such a shape.
> The problem is the tip forms what I call a singularity. If you look at a
> sphere it doesn't have such a convergence point. There have been similar
> problems with a torus which meets in the middle.
>
> However, I think the problem is at the tip it is infinitely thin. So CGAL
> can't tell the difference between the top surface and the inside surface.
>
> A fix is to add a point along the centre axis jut below the tip to provide
> thickness.
>
> rotate_extrude(angle=360)
> {
> thick=0.2; // this value is a design choice you should make
> polygon(points=[ [0, 73.2099-thick], [0, 73.2099], [1, 72.66682], [2,
> 70.4477], [3, 64.1422], [4, 46.9017], [5, 0] ]);
> }
> cube(1); // test for CGAL issues
>
> That works.
>
> While the base doesn't produce a error, having the taper down to a fine
> point is probably asking for trouble.
> So I'd also suggest adding a point like [5-0.001, 0] on the end so it isn't
> approaching infinitely thin.
>
>
>
>
>
>
> -----
> Admin - email* me if you need anything, or if I've done something stupid...
>
> * click on my MichaelAtOz label, there is a link to email me.
>
> Unless specifically shown otherwise above, my contribution is in the
> Public Domain; to the extent possible under law, I have waived all
> copyright and related or neighbouring rights to this work. Obviously
> inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.” Fight it!
> http://www.ourfairdeal.org/ time is running out!
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
DS
Dan Shriver
Wed, Jul 17, 2019 1:42 AM
Thanks guys.
If it's not my bug but is a kind of error in rotate_extrude I suggest 2
things:
- in the documentation for rotate_extrude mention that all points must be
0 for y value. The documentation I saw mentions it in a way that if you
are skimming through you don't notice right away
"The 2D shape needs to lie completely on either the right (recommended) or
the left side of the Y-axis. More precisely speaking, each vertex of the
shape must have either x >= 0 or x <= 0. If the shape crosses"
I think it would be more clear if the y instructions were written in a
similar vein to the x instructions ("y>0, or y<0 for all vertices"). I
tend to skim over things quickly and the x stuff jumps out whereas the y
stuff just sort of disappears into the background
- if the exception message was different, perhaps the code could check for
a bad vertex and tell the user. It already seems to do that for x values.
I know everyone is busy, I'm just thinking if these suggestions are put on
a list they might get implemented at some point.
On Tue, Jul 16, 2019 at 8:02 PM MichaelAtOz oz.at.michael@gmail.com wrote:
If you don't do a union, OpenSCAD does it implicitly, at various places,
including a global one.
Union() does not 'clean up', it just joins objects, if they touch properly.
Don't focus too much on the irrational number issue.
Those points are fine in themselves. Such CGAL errors tend to come from
interactions between objects.
But in this case it comes from the rotate_extrude.
rotate_extrude(angle=360)
{
tip=0; // 0.0001;
polygon(points=[ [tip, 73.2099], [1, 72.66682], [2, 70.4477], [3,
64.1422], [4, 46.9017], [5, 0] ]);
}
cube(); // test for CGAL issues
With tip=0 it gets the CGAL error, I initially suspected it may be a bug.
At
first glance I would expect it to be able to make such a shape.
The problem is the tip forms what I call a singularity. If you look at a
sphere it doesn't have such a convergence point. There have been similar
problems with a torus which meets in the middle.
However, I think the problem is at the tip it is infinitely thin. So CGAL
can't tell the difference between the top surface and the inside surface.
A fix is to add a point along the centre axis jut below the tip to provide
thickness.
rotate_extrude(angle=360)
{
thick=0.2; // this value is a design choice you should make
polygon(points=[ [0, 73.2099-thick], [0, 73.2099], [1, 72.66682], [2,
70.4477], [3, 64.1422], [4, 46.9017], [5, 0] ]);
}
cube(1); // test for CGAL issues
That works.
While the base doesn't produce a error, having the taper down to a fine
point is probably asking for trouble.
So I'd also suggest adding a point like [5-0.001, 0] on the end so it isn't
approaching infinitely thin.
Admin - email* me if you need anything, or if I've done something stupid...
- click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it!
http://www.ourfairdeal.org/ time is running out!
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Thanks guys.
----
If it's not my bug but is a kind of error in rotate_extrude I suggest 2
things:
1) in the documentation for rotate_extrude mention that all points must be
>0 for y value. The documentation I saw mentions it in a way that if you
are skimming through you don't notice right away
"The 2D shape needs to lie completely on either the right (recommended) or
the left side of the Y-axis. More precisely speaking, each vertex of the
shape must have either x >= 0 or x <= 0. If the shape crosses"
I think it would be more clear if the y instructions were written in a
similar vein to the x instructions ("y>0, or y<0 for all vertices"). I
tend to skim over things quickly and the x stuff jumps out whereas the y
stuff just sort of disappears into the background
2) if the exception message was different, perhaps the code could check for
a bad vertex and tell the user. It already seems to do that for x values.
I know everyone is busy, I'm just thinking if these suggestions are put on
a list they might get implemented at some point.
On Tue, Jul 16, 2019 at 8:02 PM MichaelAtOz <oz.at.michael@gmail.com> wrote:
> If you don't do a union, OpenSCAD does it implicitly, at various places,
> including a global one.
> Union() does not 'clean up', it just joins objects, if they touch properly.
>
> Don't focus too much on the irrational number issue.
>
> Those points are fine in themselves. Such CGAL errors tend to come from
> interactions between objects.
>
> But in this case it comes from the rotate_extrude.
>
> rotate_extrude(angle=360)
> {
> tip=0; // 0.0001;
> polygon(points=[ [tip, 73.2099], [1, 72.66682], [2, 70.4477], [3,
> 64.1422], [4, 46.9017], [5, 0] ]);
> }
> cube(); // test for CGAL issues
>
> With tip=0 it gets the CGAL error, I initially suspected it may be a bug.
> At
> first glance I would expect it to be able to make such a shape.
> The problem is the tip forms what I call a singularity. If you look at a
> sphere it doesn't have such a convergence point. There have been similar
> problems with a torus which meets in the middle.
>
> However, I think the problem is at the tip it is infinitely thin. So CGAL
> can't tell the difference between the top surface and the inside surface.
>
> A fix is to add a point along the centre axis jut below the tip to provide
> thickness.
>
> rotate_extrude(angle=360)
> {
> thick=0.2; // this value is a design choice you should make
> polygon(points=[ [0, 73.2099-thick], [0, 73.2099], [1, 72.66682], [2,
> 70.4477], [3, 64.1422], [4, 46.9017], [5, 0] ]);
> }
> cube(1); // test for CGAL issues
>
> That works.
>
> While the base doesn't produce a error, having the taper down to a fine
> point is probably asking for trouble.
> So I'd also suggest adding a point like [5-0.001, 0] on the end so it isn't
> approaching infinitely thin.
>
>
>
>
>
>
> -----
> Admin - email* me if you need anything, or if I've done something stupid...
>
> * click on my MichaelAtOz label, there is a link to email me.
>
> Unless specifically shown otherwise above, my contribution is in the
> Public Domain; to the extent possible under law, I have waived all
> copyright and related or neighbouring rights to this work. Obviously
> inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.” Fight it!
> http://www.ourfairdeal.org/ time is running out!
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
M
MichaelAtOz
Wed, Jul 17, 2019 2:06 AM
If it's not my bug but is a kind of error in rotate_extrude
Well it sort of is your bug, you are asking CGAL to make something
impossible.
A zero thickness 3D object, at that single point at the top.
What Ronaldo says is if there is a bug it would be that OpenSCAD might be
able to detect such attempts and produce a better error message.
I'll review the wiki tho, there may be a place for some tips.
Admin - email* me if you need anything, or if I've done something stupid...
- click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Sent from: http://forum.openscad.org/
DanS wrote
> If it's not my bug but is a kind of error in rotate_extrude
Well it sort of is your bug, you are asking CGAL to make something
impossible.
A zero thickness 3D object, at that single point at the top.
What Ronaldo says is if there is a bug it would be that OpenSCAD might be
able to detect such attempts and produce a better error message.
I'll review the wiki tho, there may be a place for some tips.
-----
Admin - email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
--
Sent from: http://forum.openscad.org/
RP
Ronaldo Persiano
Wed, Jul 17, 2019 6:16 AM
What Ronaldo says is if there is a bug it would be that OpenSCAD might be
able to detect such attempts and produce a better error message.
The only situation the rotate_extrude() of a simple polygon is clearly a
manifold is when the polygon does not have any intersection with the Y axis
and it rests entirely at left or at right of the Y axis. Then the
rotate_extrude() will be a torus like object.
When the intersection of a simple polygon and the Y axis is a full polygon
edge, I would expect a non-manifold result because that particular edge
would be in the interior of the object. But CGAL does produce a valid
polyhedron which means, I suppose, that OpenSCAD smartly removes that
offending edge before calling CGAL. Then, the rotate_extrude() will not be
the union of torus like objects - it will not have a genus.
In the limit case, when just a simple polygon vertex is on the Y axis,
there is no smartness to avoid non-manifoldness and an error might be
issued.
However, when, the polygon is not simple, like in the example bellow, it is
harder to detect beforehand a non-manifoldness of rotate_extrude():
rotate_extrude(){
polygon([ [2,2],[3,3], [2,4] ]);
translate([1,0]) square(2);
}
cube();
Em qua, 17 de jul de 2019 às 03:07, MichaelAtOz <oz.at.michael@gmail.com>
escreveu:
> What Ronaldo says is if there is a bug it would be that OpenSCAD might be
> able to detect such attempts and produce a better error message.
>
The only situation the rotate_extrude() of a simple polygon is clearly a
manifold is when the polygon does not have any intersection with the Y axis
and it rests entirely at left or at right of the Y axis. Then the
rotate_extrude() will be a torus like object.
When the intersection of a simple polygon and the Y axis is a full polygon
edge, I would expect a non-manifold result because that particular edge
would be in the interior of the object. But CGAL does produce a valid
polyhedron which means, I suppose, that OpenSCAD smartly removes that
offending edge before calling CGAL. Then, the rotate_extrude() will not be
the union of torus like objects - it will not have a genus.
In the limit case, when just a simple polygon vertex is on the Y axis,
there is no smartness to avoid non-manifoldness and an error might be
issued.
However, when, the polygon is not simple, like in the example bellow, it is
harder to detect beforehand a non-manifoldness of rotate_extrude():
rotate_extrude(){
polygon([ [2,2],[3,3], [2,4] ]);
translate([1,0]) square(2);
}
cube();
M
MichaelAtOz
Wed, Jul 17, 2019 6:43 AM
In the limit case, when just a simple polygon vertex is on the Y axis,
there is no smartness to avoid non-manifoldness and an error might be
issued.
However, when, the polygon is not simple, like in the example bellow, it
is
harder to detect beforehand a non-manifoldness of rotate_extrude():
rotate_extrude(){
polygon([ [2,2],[3,3], [2,4] ]);
translate([1,0]) square(2);
}
cube();
So a test would be if polygon vertex.x=0 then at least one adjacent vertex
must have x=0 & a different y.
Admin - email* me if you need anything, or if I've done something stupid...
- click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Sent from: http://forum.openscad.org/
Ronaldo wrote
> In the limit case, when just a simple polygon vertex is on the Y axis,
> there is no smartness to avoid non-manifoldness and an error might be
> issued.
>
> However, when, the polygon is not simple, like in the example bellow, it
> is
> harder to detect beforehand a non-manifoldness of rotate_extrude():
>
> rotate_extrude(){
> polygon([ [2,2],[3,3], [2,4] ]);
> translate([1,0]) square(2);
> }
> cube();
So a test would be if polygon vertex.x=0 then at least one adjacent vertex
must have x=0 & a different y.
-----
Admin - email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
--
Sent from: http://forum.openscad.org/
NH
nop head
Wed, Jul 17, 2019 7:40 AM
Yes that sounds right. Each bit that touches the y axis can't be a single
point because that creates a singularity when rotated.
The zero thickness knife edge at the bottom is dodgy as well. Any CGAL
operations near that point are likely to create self intersections.
Both features are psychically impossible.
On Wed, 17 Jul 2019 at 07:43, MichaelAtOz oz.at.michael@gmail.com wrote:
In the limit case, when just a simple polygon vertex is on the Y axis,
there is no smartness to avoid non-manifoldness and an error might be
issued.
However, when, the polygon is not simple, like in the example bellow, it
is
harder to detect beforehand a non-manifoldness of rotate_extrude():
rotate_extrude(){
polygon([ [2,2],[3,3], [2,4] ]);
translate([1,0]) square(2);
}
cube();
So a test would be if polygon vertex.x=0 then at least one adjacent vertex
must have x=0 & a different y.
Admin - email* me if you need anything, or if I've done something stupid...
- click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it!
http://www.ourfairdeal.org/ time is running out!
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Yes that sounds right. Each bit that touches the y axis can't be a single
point because that creates a singularity when rotated.
The zero thickness knife edge at the bottom is dodgy as well. Any CGAL
operations near that point are likely to create self intersections.
Both features are psychically impossible.
On Wed, 17 Jul 2019 at 07:43, MichaelAtOz <oz.at.michael@gmail.com> wrote:
> Ronaldo wrote
> > In the limit case, when just a simple polygon vertex is on the Y axis,
> > there is no smartness to avoid non-manifoldness and an error might be
> > issued.
> >
> > However, when, the polygon is not simple, like in the example bellow, it
> > is
> > harder to detect beforehand a non-manifoldness of rotate_extrude():
> >
> > rotate_extrude(){
> > polygon([ [2,2],[3,3], [2,4] ]);
> > translate([1,0]) square(2);
> > }
> > cube();
>
> So a test would be if polygon vertex.x=0 then at least one adjacent vertex
> must have x=0 & a different y.
>
>
>
> -----
> Admin - email* me if you need anything, or if I've done something stupid...
>
> * click on my MichaelAtOz label, there is a link to email me.
>
> Unless specifically shown otherwise above, my contribution is in the
> Public Domain; to the extent possible under law, I have waived all
> copyright and related or neighbouring rights to this work. Obviously
> inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.” Fight it!
> http://www.ourfairdeal.org/ time is running out!
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
CA
Carsten Arnholm
Wed, Jul 17, 2019 11:30 AM
On 17.07.2019 08:16, Ronaldo Persiano wrote:
Em qua, 17 de jul de 2019 às 03:07, MichaelAtOz <oz.at.michael@gmail.com
mailto:oz.at.michael@gmail.com> escreveu:
What Ronaldo says is if there is a bug it would be that OpenSCAD
might be
able to detect such attempts and produce a better error message.
The only situation the rotate_extrude() of a simple polygon is clearly a
manifold is when the polygon does not have any intersection with the Y
axis and it rests entirely at left or at right of the Y axis. Then the
rotate_extrude() will be a torus like object.
When the intersection of a simple polygon and the Y axis is a full
polygon edge, I would expect a non-manifold result because that
particular edge would be in the interior of the object. But CGAL does
produce a valid polyhedron
I don't know how rotate_extrude is implemented in OpenSCAD, but I am
guessing CGAL does not provide such a feature, and instead
rotate_extrude is done by OpenSCAD directly to compute the coordinates
of a polyhedron. Implemented this way, there are no boolean operations
involved.
This is certainly the case in AngelCAD where rotate_extrude is not a
feature at all in Carve (Carve is the equivalent to CGAL), it is
computed directly by the application, not the library.
The implication is that the issue is not about manifoldness, but rather
about self intersection and collapsed faces. Manifoldness is about
topology (connectivity), self-intersection and collapsed faces is about
geometry (coordinates in this case). You can have a self-intersecting
polyhedron with collapsed faces which is 2 manifold, as in the below example
When you say "I would expect a non-manifold result because that
particular edge would be in the interior of the object. But CGAL does
produce a valid polyhedron". I would say CGAL that is correct, and the
expectation is incorrect.
Consider the example
rotate_extrude(){
polygon([ [0,-2],[2,0], [0,2] ]);
}
This produces no error by OpenSCAD, and you could argue it is ok at this
stage.
Top level object is a 3D object:
Facets: 42
The visible external faces are only 14. If you export to OFF format and
then analyze it with polyfix...
OFF export finished: O:/STL/rotate1.off
...you will find that OpenSCAD appears to have merged overlapping
vertices, thus creating a non-manifold model and containing collapsed
faces. After repair, the collapsed faces are removed and thus the model
is again 2-manifold.
===
$ polyfix rotate1.off
Parameters:
input_file = rotate1.off
polyhedron 0 ================= volume=14.5942, dtol=0.01, atol=1e-06,
maxiter=10
iteration 0: vertices=9 faces=42
warning: 28 zero area faces.
warning: nonmanifold edges: uc(4)=14 uc(14)=2 uc(28)=1
removed 28 collapsed or zero area faces
total changes=28
no warnings
iteration 1: vertices=9 faces=14
total changes=0
no warnings
Summary:
polyhedron 0: vertices=9 faces=14 : no warnings
Writing: rotate1_1.off
We can repeat the same exercise in AngelCAD (coordinates are a bit
different, because AngelCAD rotates around global Y).
// AngelCAD code.
shape@ main_shape()
{
array<pos2d@> p = { {0,-2},{2,0},{0,2} };
return rotate_extrude(polygon(p),deg:360);
}
void main()
{
shape@ obj = main_shape();
obj.write_xcsg(GetInputFullPath(),secant_tolerance:0.2);
}
This creates the output
xcsg processing: /media/nas_openbzr/STL/xcsg/test1.xcsg
processing solid: rotate_extrude
...completed CSG tree: 0 boolean operations to process.
...Info: rotate_extrude angle>=2*PI implies a torus
...completed boolean operations in 0 [sec]
...result model contains 1 lump.
...lump 1: 21 vertices, 15 polygon faces.
...Polyhedron is water-tight (edge use-count check OK)
Warning: Polyhedron has 1 zero area faces.
...Polyhedron has 15 non-triangular faces
...Triangulating lump ...
...Triangulation completed with 28 triangle faces in 0 [sec]
...Exporting results
Created STL file : /media/nas_openbzr/STL/xcsg/test1.stl
xcsg finished using 0h 0m 0.01s
i.e. 28 faces makes sense = 7x3, of which one third will be collapsed,
due to the way rotate_extrude is implemented.
=====
$ polyfix xcsg/test1.off
Parameters:
input_file = xcsg/test1.off
polyhedron 0 ================= volume=14.5942, dtol=0.01, atol=1e-06,
maxiter=10
iteration 0: vertices=21 faces=28
warning: 14 zero area faces.
warning: nonmanifold edges: uc(1)=14
merged 12 vertices
removed 14 collapsed or zero area faces
total changes=26
no warnings
iteration 1: vertices=9 faces=14
total changes=0
no warnings
Summary:
polyhedron 0: vertices=9 faces=14 : no warnings
Writing: xcsg/test1_1.off
=====
Here, polyfix assumes overlapping vertices is undesired and merges them,
the end result is the same as via OpenSCAD, 14 faces and 9 vertices.
Carsten Arnholm
On 17.07.2019 08:16, Ronaldo Persiano wrote:
> Em qua, 17 de jul de 2019 às 03:07, MichaelAtOz <oz.at.michael@gmail.com
> <mailto:oz.at.michael@gmail.com>> escreveu:
>
> What Ronaldo says is if there is a bug it would be that OpenSCAD
> might be
> able to detect such attempts and produce a better error message.
>
>
> The only situation the rotate_extrude() of a simple polygon is clearly a
> manifold is when the polygon does not have any intersection with the Y
> axis and it rests entirely at left or at right of the Y axis. Then the
> rotate_extrude() will be a torus like object.
>
> When the intersection of a simple polygon and the Y axis is a full
> polygon edge, I would expect a non-manifold result because that
> particular edge would be in the interior of the object. But CGAL does
> produce a valid polyhedron
I don't know how rotate_extrude is implemented in OpenSCAD, but I am
guessing CGAL does not provide such a feature, and instead
rotate_extrude is done by OpenSCAD directly to compute the coordinates
of a polyhedron. Implemented this way, there are no boolean operations
involved.
This is certainly the case in AngelCAD where rotate_extrude is not a
feature at all in Carve (Carve is the equivalent to CGAL), it is
computed directly by the application, not the library.
The implication is that the issue is not about manifoldness, but rather
about self intersection and collapsed faces. Manifoldness is about
topology (connectivity), self-intersection and collapsed faces is about
geometry (coordinates in this case). You can have a self-intersecting
polyhedron with collapsed faces which is 2 manifold, as in the below example
When you say "I would expect a non-manifold result because that
particular edge would be in the interior of the object. But CGAL does
produce a valid polyhedron". I would say CGAL that is correct, and the
expectation is incorrect.
Consider the example
rotate_extrude(){
polygon([ [0,-2],[2,0], [0,2] ]);
}
This produces no error by OpenSCAD, and you could argue it is ok at this
stage.
Top level object is a 3D object:
Facets: 42
The visible external faces are only 14. If you export to OFF format and
then analyze it with polyfix...
OFF export finished: O:/STL/rotate1.off
...you will find that OpenSCAD appears to have merged overlapping
vertices, thus creating a non-manifold model and containing collapsed
faces. After repair, the collapsed faces are removed and thus the model
is again 2-manifold.
===
$ polyfix rotate1.off
Parameters:
input_file = rotate1.off
polyhedron 0 ================= volume=14.5942, dtol=0.01, atol=1e-06,
maxiter=10
iteration 0: vertices=9 faces=42
warning: 28 zero area faces.
warning: nonmanifold edges: uc(4)=14 uc(14)=2 uc(28)=1
removed 28 collapsed or zero area faces
total changes=28
no warnings
iteration 1: vertices=9 faces=14
total changes=0
no warnings
Summary:
polyhedron 0: vertices=9 faces=14 : no warnings
Writing: rotate1_1.off
===
We can repeat the same exercise in AngelCAD (coordinates are a bit
different, because AngelCAD rotates around global Y).
// AngelCAD code.
shape@ main_shape()
{
array<pos2d@> p = { {0,-2},{2,0},{0,2} };
return rotate_extrude(polygon(p),deg:360);
}
void main()
{
shape@ obj = main_shape();
obj.write_xcsg(GetInputFullPath(),secant_tolerance:0.2);
}
This creates the output
xcsg processing: /media/nas_openbzr/STL/xcsg/test1.xcsg
processing solid: rotate_extrude
...completed CSG tree: 0 boolean operations to process.
...Info: rotate_extrude angle>=2*PI implies a torus
...completed boolean operations in 0 [sec]
...result model contains 1 lump.
...lump 1: 21 vertices, 15 polygon faces.
...Polyhedron is water-tight (edge use-count check OK)
>>> Warning: Polyhedron has 1 zero area faces.
...Polyhedron has 15 non-triangular faces
...Triangulating lump ...
...Triangulation completed with 28 triangle faces in 0 [sec]
...Exporting results
Created STL file : /media/nas_openbzr/STL/xcsg/test1.stl
xcsg finished using 0h 0m 0.01s
i.e. 28 faces makes sense = 7x3, of which one third will be collapsed,
due to the way rotate_extrude is implemented.
=====
$ polyfix xcsg/test1.off
Parameters:
input_file = xcsg/test1.off
polyhedron 0 ================= volume=14.5942, dtol=0.01, atol=1e-06,
maxiter=10
iteration 0: vertices=21 faces=28
warning: 14 zero area faces.
warning: nonmanifold edges: uc(1)=14
merged 12 vertices
removed 14 collapsed or zero area faces
total changes=26
no warnings
iteration 1: vertices=9 faces=14
total changes=0
no warnings
Summary:
polyhedron 0: vertices=9 faces=14 : no warnings
Writing: xcsg/test1_1.off
=====
Here, polyfix assumes overlapping vertices is undesired and merges them,
the end result is the same as via OpenSCAD, 14 faces and 9 vertices.
Carsten Arnholm
NH
nop head
Wed, Jul 17, 2019 12:04 PM
I think rotate extrude does its work in PolySets which, just like STL, is a
polygon soup and cannot represent a 2 manifold with self intersections.
Then when that is given to CGAL it barfs.
Since OpenSCAD is aimed at 3D printing and nearly all output is via STL it
gets away with using PolySets and should give an error message for geometry
with self intersections. If an output format other than STL ever becomes
popular and people wanted to export self intersection geometry OpenSCAD
would have to be rewritten to not use PolySets. I don't really see the
point as such geometry only exists in maths, not in physical reality.
On Wed, 17 Jul 2019 at 12:31, Carsten Arnholm arnholm@arnholm.org wrote:
On 17.07.2019 08:16, Ronaldo Persiano wrote:
Em qua, 17 de jul de 2019 às 03:07, MichaelAtOz <oz.at.michael@gmail.com
mailto:oz.at.michael@gmail.com> escreveu:
What Ronaldo says is if there is a bug it would be that OpenSCAD
might be
able to detect such attempts and produce a better error message.
The only situation the rotate_extrude() of a simple polygon is clearly a
manifold is when the polygon does not have any intersection with the Y
axis and it rests entirely at left or at right of the Y axis. Then the
rotate_extrude() will be a torus like object.
When the intersection of a simple polygon and the Y axis is a full
polygon edge, I would expect a non-manifold result because that
particular edge would be in the interior of the object. But CGAL does
produce a valid polyhedron
I don't know how rotate_extrude is implemented in OpenSCAD, but I am
guessing CGAL does not provide such a feature, and instead
rotate_extrude is done by OpenSCAD directly to compute the coordinates
of a polyhedron. Implemented this way, there are no boolean operations
involved.
This is certainly the case in AngelCAD where rotate_extrude is not a
feature at all in Carve (Carve is the equivalent to CGAL), it is
computed directly by the application, not the library.
The implication is that the issue is not about manifoldness, but rather
about self intersection and collapsed faces. Manifoldness is about
topology (connectivity), self-intersection and collapsed faces is about
geometry (coordinates in this case). You can have a self-intersecting
polyhedron with collapsed faces which is 2 manifold, as in the below
example
When you say "I would expect a non-manifold result because that
particular edge would be in the interior of the object. But CGAL does
produce a valid polyhedron". I would say CGAL that is correct, and the
expectation is incorrect.
Consider the example
rotate_extrude(){
polygon([ [0,-2],[2,0], [0,2] ]);
}
This produces no error by OpenSCAD, and you could argue it is ok at this
stage.
Top level object is a 3D object:
Facets: 42
The visible external faces are only 14. If you export to OFF format and
then analyze it with polyfix...
OFF export finished: O:/STL/rotate1.off
...you will find that OpenSCAD appears to have merged overlapping
vertices, thus creating a non-manifold model and containing collapsed
faces. After repair, the collapsed faces are removed and thus the model
is again 2-manifold.
===
$ polyfix rotate1.off
Parameters:
input_file = rotate1.off
polyhedron 0 ================= volume=14.5942, dtol=0.01, atol=1e-06,
maxiter=10
iteration 0: vertices=9 faces=42
warning: 28 zero area faces.
warning: nonmanifold edges: uc(4)=14 uc(14)=2 uc(28)=1
removed 28 collapsed or zero area faces
total changes=28
no warnings
iteration 1: vertices=9 faces=14
total changes=0
no warnings
Summary:
polyhedron 0: vertices=9 faces=14 : no warnings
Writing: rotate1_1.off
We can repeat the same exercise in AngelCAD (coordinates are a bit
different, because AngelCAD rotates around global Y).
// AngelCAD code.
shape@ main_shape()
{
array<pos2d@> p = { {0,-2},{2,0},{0,2} };
return rotate_extrude(polygon(p),deg:360);
}
void main()
{
shape@ obj = main_shape();
obj.write_xcsg(GetInputFullPath(),secant_tolerance:0.2);
}
This creates the output
xcsg processing: /media/nas_openbzr/STL/xcsg/test1.xcsg
processing solid: rotate_extrude
...completed CSG tree: 0 boolean operations to process.
...Info: rotate_extrude angle>=2*PI implies a torus
...completed boolean operations in 0 [sec]
...result model contains 1 lump.
...lump 1: 21 vertices, 15 polygon faces.
...Polyhedron is water-tight (edge use-count check OK)
Warning: Polyhedron has 1 zero area faces.
...Polyhedron has 15 non-triangular faces
...Triangulating lump ...
...Triangulation completed with 28 triangle faces in 0 [sec]
...Exporting results
Created STL file : /media/nas_openbzr/STL/xcsg/test1.stl
xcsg finished using 0h 0m 0.01s
i.e. 28 faces makes sense = 7x3, of which one third will be collapsed,
due to the way rotate_extrude is implemented.
=====
$ polyfix xcsg/test1.off
Parameters:
input_file = xcsg/test1.off
polyhedron 0 ================= volume=14.5942, dtol=0.01, atol=1e-06,
maxiter=10
iteration 0: vertices=21 faces=28
warning: 14 zero area faces.
warning: nonmanifold edges: uc(1)=14
merged 12 vertices
removed 14 collapsed or zero area faces
total changes=26
no warnings
iteration 1: vertices=9 faces=14
total changes=0
no warnings
Summary:
polyhedron 0: vertices=9 faces=14 : no warnings
Writing: xcsg/test1_1.off
=====
Here, polyfix assumes overlapping vertices is undesired and merges them,
the end result is the same as via OpenSCAD, 14 faces and 9 vertices.
Carsten Arnholm
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I think rotate extrude does its work in PolySets which, just like STL, is a
polygon soup and cannot represent a 2 manifold with self intersections.
Then when that is given to CGAL it barfs.
Since OpenSCAD is aimed at 3D printing and nearly all output is via STL it
gets away with using PolySets and should give an error message for geometry
with self intersections. If an output format other than STL ever becomes
popular and people wanted to export self intersection geometry OpenSCAD
would have to be rewritten to not use PolySets. I don't really see the
point as such geometry only exists in maths, not in physical reality.
On Wed, 17 Jul 2019 at 12:31, Carsten Arnholm <arnholm@arnholm.org> wrote:
> On 17.07.2019 08:16, Ronaldo Persiano wrote:
> > Em qua, 17 de jul de 2019 às 03:07, MichaelAtOz <oz.at.michael@gmail.com
> > <mailto:oz.at.michael@gmail.com>> escreveu:
> >
> > What Ronaldo says is if there is a bug it would be that OpenSCAD
> > might be
> > able to detect such attempts and produce a better error message.
> >
> >
> > The only situation the rotate_extrude() of a simple polygon is clearly a
> > manifold is when the polygon does not have any intersection with the Y
> > axis and it rests entirely at left or at right of the Y axis. Then the
> > rotate_extrude() will be a torus like object.
> >
> > When the intersection of a simple polygon and the Y axis is a full
> > polygon edge, I would expect a non-manifold result because that
> > particular edge would be in the interior of the object. But CGAL does
> > produce a valid polyhedron
>
> I don't know how rotate_extrude is implemented in OpenSCAD, but I am
> guessing CGAL does not provide such a feature, and instead
> rotate_extrude is done by OpenSCAD directly to compute the coordinates
> of a polyhedron. Implemented this way, there are no boolean operations
> involved.
>
> This is certainly the case in AngelCAD where rotate_extrude is not a
> feature at all in Carve (Carve is the equivalent to CGAL), it is
> computed directly by the application, not the library.
>
> The implication is that the issue is not about manifoldness, but rather
> about self intersection and collapsed faces. Manifoldness is about
> topology (connectivity), self-intersection and collapsed faces is about
> geometry (coordinates in this case). You can have a self-intersecting
> polyhedron with collapsed faces which is 2 manifold, as in the below
> example
>
> When you say "I would expect a non-manifold result because that
> particular edge would be in the interior of the object. But CGAL does
> produce a valid polyhedron". I would say CGAL that is correct, and the
> expectation is incorrect.
>
> Consider the example
>
> rotate_extrude(){
> polygon([ [0,-2],[2,0], [0,2] ]);
> }
>
> This produces no error by OpenSCAD, and you could argue it is ok at this
> stage.
>
> Top level object is a 3D object:
> Facets: 42
>
> The visible external faces are only 14. If you export to OFF format and
> then analyze it with polyfix...
>
> OFF export finished: O:/STL/rotate1.off
>
> ...you will find that OpenSCAD appears to have merged overlapping
> vertices, thus creating a non-manifold model and containing collapsed
> faces. After repair, the collapsed faces are removed and thus the model
> is again 2-manifold.
>
> ===
> $ polyfix rotate1.off
>
> Parameters:
> input_file = rotate1.off
>
>
> polyhedron 0 ================= volume=14.5942, dtol=0.01, atol=1e-06,
> maxiter=10
> iteration 0: vertices=9 faces=42
> warning: 28 zero area faces.
> warning: nonmanifold edges: uc(4)=14 uc(14)=2 uc(28)=1
> removed 28 collapsed or zero area faces
> total changes=28
> no warnings
>
> iteration 1: vertices=9 faces=14
> total changes=0
> no warnings
>
> Summary:
> polyhedron 0: vertices=9 faces=14 : no warnings
>
> Writing: rotate1_1.off
> ===
>
> We can repeat the same exercise in AngelCAD (coordinates are a bit
> different, because AngelCAD rotates around global Y).
>
>
> // AngelCAD code.
> shape@ main_shape()
> {
> array<pos2d@> p = { {0,-2},{2,0},{0,2} };
> return rotate_extrude(polygon(p),deg:360);
> }
>
> void main()
> {
> shape@ obj = main_shape();
> obj.write_xcsg(GetInputFullPath(),secant_tolerance:0.2);
> }
>
>
> This creates the output
>
> xcsg processing: /media/nas_openbzr/STL/xcsg/test1.xcsg
> processing solid: rotate_extrude
> ...completed CSG tree: 0 boolean operations to process.
> ...Info: rotate_extrude angle>=2*PI implies a torus
> ...completed boolean operations in 0 [sec]
> ...result model contains 1 lump.
> ...lump 1: 21 vertices, 15 polygon faces.
> ...Polyhedron is water-tight (edge use-count check OK)
> >>> Warning: Polyhedron has 1 zero area faces.
> ...Polyhedron has 15 non-triangular faces
> ...Triangulating lump ...
> ...Triangulation completed with 28 triangle faces in 0 [sec]
> ...Exporting results
> Created STL file : /media/nas_openbzr/STL/xcsg/test1.stl
> xcsg finished using 0h 0m 0.01s
>
> i.e. 28 faces makes sense = 7x3, of which one third will be collapsed,
> due to the way rotate_extrude is implemented.
>
> =====
>
> $ polyfix xcsg/test1.off
>
> Parameters:
> input_file = xcsg/test1.off
>
>
> polyhedron 0 ================= volume=14.5942, dtol=0.01, atol=1e-06,
> maxiter=10
> iteration 0: vertices=21 faces=28
> warning: 14 zero area faces.
> warning: nonmanifold edges: uc(1)=14
> merged 12 vertices
> removed 14 collapsed or zero area faces
> total changes=26
> no warnings
>
> iteration 1: vertices=9 faces=14
> total changes=0
> no warnings
>
> Summary:
> polyhedron 0: vertices=9 faces=14 : no warnings
>
> Writing: xcsg/test1_1.off
>
> =====
>
> Here, polyfix assumes overlapping vertices is undesired and merges them,
> the end result is the same as via OpenSCAD, 14 faces and 9 vertices.
>
>
>
> Carsten Arnholm
>
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>