discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

CGAL error if F5 before F6

NH
nop head
Wed, Jan 2, 2019 6:17 PM

I am running into this error on F6 unless I flush the cache after the
preview.

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: e_below != SHalfedge_handle() File:
/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h
Line: 426

Anybody know what causes it? I have vague recollection of it being
something to do with caching an inexact value during the preview.

I am running into this error on F6 unless I flush the cache after the preview. ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e_below != SHalfedge_handle() File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 426 Anybody know what causes it? I have vague recollection of it being something to do with caching an inexact value during the preview.
M
MichaelAtOz
Wed, Jan 2, 2019 8:59 PM

Like  this
http://forum.openscad.org/Hmm-CGAL-error-only-after-F5-F6-sequence-td18954i20.html
maybe?


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/

Like this <http://forum.openscad.org/Hmm-CGAL-error-only-after-F5-F6-sequence-td18954i20.html> maybe? ----- 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/
M
MichaelAtOz
Wed, Jan 2, 2019 9:01 PM

i think the "we calculate and cache the transformed object by applying the
transformation ourselves (i.e. without CGAL). " may be at the root of
various corner cases.


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/

i think the "we calculate and cache the transformed object by applying the transformation ourselves (i.e. without CGAL). " may be at the root of various corner cases. ----- 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/
MK
Marius Kintel
Wed, Jan 2, 2019 9:19 PM

Argh, yes, I think this is a bug triggered by an optimization trying to avoid using CGAL where not necessary.

-Marius

On Jan 2, 2019, at 13:17, nop head nop.head@gmail.com wrote:

I am running into this error on F6 unless I flush the cache after the preview.

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e_below != SHalfedge_handle() File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 426

Anybody know what causes it? I have vague recollection of it being something to do with caching an inexact value during the preview.


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

Argh, yes, I think this is a bug triggered by an optimization trying to avoid using CGAL where not necessary. -Marius > On Jan 2, 2019, at 13:17, nop head <nop.head@gmail.com> wrote: > > I am running into this error on F6 unless I flush the cache after the preview. > > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e_below != SHalfedge_handle() File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 426 > > Anybody know what causes it? I have vague recollection of it being something to do with caching an inexact value during the preview. > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
NH
nop head
Wed, Jan 2, 2019 11:35 PM

I though that putting render() around it to force CGAL during F5 would fix
the problem but it doesn't.

The problematic code is a stack of linear extrudes unioned together.

On Wed, 2 Jan 2019 at 21:20, Marius Kintel kintel@kintel.net wrote:

Argh, yes, I think this is a bug triggered by an optimization trying to
avoid using CGAL where not necessary.

-Marius

On Jan 2, 2019, at 13:17, nop head nop.head@gmail.com wrote:

I am running into this error on F6 unless I flush the cache after the

preview.

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion

violation! Expr: e_below != SHalfedge_handle() File:
/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h
Line: 426

Anybody know what causes it? I have vague recollection of it being

something to do with caching an inexact value during the preview.

I though that putting render() around it to force CGAL during F5 would fix the problem but it doesn't. The problematic code is a stack of linear extrudes unioned together. On Wed, 2 Jan 2019 at 21:20, Marius Kintel <kintel@kintel.net> wrote: > Argh, yes, I think this is a bug triggered by an optimization trying to > avoid using CGAL where not necessary. > > -Marius > > > On Jan 2, 2019, at 13:17, nop head <nop.head@gmail.com> wrote: > > > > I am running into this error on F6 unless I flush the cache after the > preview. > > > > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion > violation! Expr: e_below != SHalfedge_handle() File: > /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h > Line: 426 > > > > Anybody know what causes it? I have vague recollection of it being > something to do with caching an inexact value during the preview. > > > > > > _______________________________________________ > > 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 >
NH
nop head
Thu, Jan 3, 2019 8:53 AM

The problem seems to be caused by very close edges in a stack of polygons
with different numbers of vertices.Each polygon has its radius defined by r
/ cos(180 / fn) so that the flat sides line up. But of course they don't
line up exactly when 180 / n is an angle that makes cos return an
irrational. Making each one smaller by 1/128 so they never line up exactly
AND adding a render() around the stack fixes it.

This is for generating hanging holes that print in mid air without support
material.

[image: image.png]

I think something must snap the vertices and break the topology during F5
and that gets cached and breaks F6. I don't understand why render doesn't
fix it though. It seems geometry generated by render() is different under
F5 than it is with F6 but I thought render() was supposed to do the same as
F6 for that sub tree. Perhaps that is something that could be fixed, so at
least just render() is a work around. I think the underlying problems is
using three number systems and not doing topologically aware conversions
from one to another.

On Wed, 2 Jan 2019 at 23:35, nop head nop.head@gmail.com wrote:

I though that putting render() around it to force CGAL during F5 would fix
the problem but it doesn't.

The problematic code is a stack of linear extrudes unioned together.

On Wed, 2 Jan 2019 at 21:20, Marius Kintel kintel@kintel.net wrote:

Argh, yes, I think this is a bug triggered by an optimization trying to
avoid using CGAL where not necessary.

-Marius

On Jan 2, 2019, at 13:17, nop head nop.head@gmail.com wrote:

I am running into this error on F6 unless I flush the cache after the

preview.

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion

violation! Expr: e_below != SHalfedge_handle() File:
/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h
Line: 426

Anybody know what causes it? I have vague recollection of it being

something to do with caching an inexact value during the preview.

The problem seems to be caused by very close edges in a stack of polygons with different numbers of vertices.Each polygon has its radius defined by r / cos(180 / fn) so that the flat sides line up. But of course they don't line up exactly when 180 / n is an angle that makes cos return an irrational. Making each one smaller by 1/128 so they never line up exactly AND adding a render() around the stack fixes it. This is for generating hanging holes that print in mid air without support material. [image: image.png] I think something must snap the vertices and break the topology during F5 and that gets cached and breaks F6. I don't understand why render doesn't fix it though. It seems geometry generated by render() is different under F5 than it is with F6 but I thought render() was supposed to do the same as F6 for that sub tree. Perhaps that is something that could be fixed, so at least just render() is a work around. I think the underlying problems is using three number systems and not doing topologically aware conversions from one to another. On Wed, 2 Jan 2019 at 23:35, nop head <nop.head@gmail.com> wrote: > I though that putting render() around it to force CGAL during F5 would fix > the problem but it doesn't. > > The problematic code is a stack of linear extrudes unioned together. > > On Wed, 2 Jan 2019 at 21:20, Marius Kintel <kintel@kintel.net> wrote: > >> Argh, yes, I think this is a bug triggered by an optimization trying to >> avoid using CGAL where not necessary. >> >> -Marius >> >> > On Jan 2, 2019, at 13:17, nop head <nop.head@gmail.com> wrote: >> > >> > I am running into this error on F6 unless I flush the cache after the >> preview. >> > >> > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion >> violation! Expr: e_below != SHalfedge_handle() File: >> /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h >> Line: 426 >> > >> > Anybody know what causes it? I have vague recollection of it being >> something to do with caching an inexact value during the preview. >> > >> > >> > _______________________________________________ >> > 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 >> >
NH
nop head
Thu, Jan 3, 2019 11:20 AM

Actually when I eliminated all the nearly coincident edges it don't need a
render().

On Thu, 3 Jan 2019 at 08:53, nop head nop.head@gmail.com wrote:

The problem seems to be caused by very close edges in a stack of polygons
with different numbers of vertices.Each polygon has its radius defined by r
/ cos(180 / fn) so that the flat sides line up. But of course they don't
line up exactly when 180 / n is an angle that makes cos return an
irrational. Making each one smaller by 1/128 so they never line up exactly
AND adding a render() around the stack fixes it.

This is for generating hanging holes that print in mid air without support
material.

[image: image.png]

I think something must snap the vertices and break the topology during F5
and that gets cached and breaks F6. I don't understand why render doesn't
fix it though. It seems geometry generated by render() is different under
F5 than it is with F6 but I thought render() was supposed to do the same as
F6 for that sub tree. Perhaps that is something that could be fixed, so at
least just render() is a work around. I think the underlying problems is
using three number systems and not doing topologically aware conversions
from one to another.

On Wed, 2 Jan 2019 at 23:35, nop head nop.head@gmail.com wrote:

I though that putting render() around it to force CGAL during F5 would
fix the problem but it doesn't.

The problematic code is a stack of linear extrudes unioned together.

On Wed, 2 Jan 2019 at 21:20, Marius Kintel kintel@kintel.net wrote:

Argh, yes, I think this is a bug triggered by an optimization trying to
avoid using CGAL where not necessary.

-Marius

On Jan 2, 2019, at 13:17, nop head nop.head@gmail.com wrote:

I am running into this error on F6 unless I flush the cache after the

preview.

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion

violation! Expr: e_below != SHalfedge_handle() File:
/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h
Line: 426

Anybody know what causes it? I have vague recollection of it being

something to do with caching an inexact value during the preview.

Actually when I eliminated all the nearly coincident edges it don't need a render(). On Thu, 3 Jan 2019 at 08:53, nop head <nop.head@gmail.com> wrote: > The problem seems to be caused by very close edges in a stack of polygons > with different numbers of vertices.Each polygon has its radius defined by r > / cos(180 / fn) so that the flat sides line up. But of course they don't > line up exactly when 180 / n is an angle that makes cos return an > irrational. Making each one smaller by 1/128 so they never line up exactly > AND adding a render() around the stack fixes it. > > This is for generating hanging holes that print in mid air without support > material. > > [image: image.png] > > I think something must snap the vertices and break the topology during F5 > and that gets cached and breaks F6. I don't understand why render doesn't > fix it though. It seems geometry generated by render() is different under > F5 than it is with F6 but I thought render() was supposed to do the same as > F6 for that sub tree. Perhaps that is something that could be fixed, so at > least just render() is a work around. I think the underlying problems is > using three number systems and not doing topologically aware conversions > from one to another. > > On Wed, 2 Jan 2019 at 23:35, nop head <nop.head@gmail.com> wrote: > >> I though that putting render() around it to force CGAL during F5 would >> fix the problem but it doesn't. >> >> The problematic code is a stack of linear extrudes unioned together. >> >> On Wed, 2 Jan 2019 at 21:20, Marius Kintel <kintel@kintel.net> wrote: >> >>> Argh, yes, I think this is a bug triggered by an optimization trying to >>> avoid using CGAL where not necessary. >>> >>> -Marius >>> >>> > On Jan 2, 2019, at 13:17, nop head <nop.head@gmail.com> wrote: >>> > >>> > I am running into this error on F6 unless I flush the cache after the >>> preview. >>> > >>> > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion >>> violation! Expr: e_below != SHalfedge_handle() File: >>> /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h >>> Line: 426 >>> > >>> > Anybody know what causes it? I have vague recollection of it being >>> something to do with caching an inexact value during the preview. >>> > >>> > >>> > _______________________________________________ >>> > 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 >>> >>
NH
nop head
Thu, Jan 3, 2019 12:18 PM

Doing F6 before F5 isn't a workaround either because although it keeps CGAL
happy the exported STLs are broken according to NetFabb, presumably due to
truncating to floats. Basically all vertices, whether specified or
generated need to be either exactly coincident or sufficiently difference
that they remain different in all number representations, rational, double,
float and fixed point and when snapped to the dreaded grid.

In fact, is the grid snapping the major problem with OpenSCAD? How can it
be correct to simply snap vertices to a grid? If they start distinct they
need to stay distinct. What problem is the grid trying to solve?

On Thu, 3 Jan 2019 at 11:20, nop head nop.head@gmail.com wrote:

Actually when I eliminated all the nearly coincident edges it don't need a
render().

On Thu, 3 Jan 2019 at 08:53, nop head nop.head@gmail.com wrote:

The problem seems to be caused by very close edges in a stack of polygons
with different numbers of vertices.Each polygon has its radius defined by r
/ cos(180 / fn) so that the flat sides line up. But of course they don't
line up exactly when 180 / n is an angle that makes cos return an
irrational. Making each one smaller by 1/128 so they never line up exactly
AND adding a render() around the stack fixes it.

This is for generating hanging holes that print in mid air without
support material.

[image: image.png]

I think something must snap the vertices and break the topology during F5
and that gets cached and breaks F6. I don't understand why render doesn't
fix it though. It seems geometry generated by render() is different under
F5 than it is with F6 but I thought render() was supposed to do the same as
F6 for that sub tree. Perhaps that is something that could be fixed, so at
least just render() is a work around. I think the underlying problems is
using three number systems and not doing topologically aware conversions
from one to another.

On Wed, 2 Jan 2019 at 23:35, nop head nop.head@gmail.com wrote:

I though that putting render() around it to force CGAL during F5 would
fix the problem but it doesn't.

The problematic code is a stack of linear extrudes unioned together.

On Wed, 2 Jan 2019 at 21:20, Marius Kintel kintel@kintel.net wrote:

Argh, yes, I think this is a bug triggered by an optimization trying to
avoid using CGAL where not necessary.

-Marius

On Jan 2, 2019, at 13:17, nop head nop.head@gmail.com wrote:

I am running into this error on F6 unless I flush the cache after the

preview.

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion

violation! Expr: e_below != SHalfedge_handle() File:
/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h
Line: 426

Anybody know what causes it? I have vague recollection of it being

something to do with caching an inexact value during the preview.

Doing F6 before F5 isn't a workaround either because although it keeps CGAL happy the exported STLs are broken according to NetFabb, presumably due to truncating to floats. Basically all vertices, whether specified or generated need to be either exactly coincident or sufficiently difference that they remain different in all number representations, rational, double, float and fixed point and when snapped to the dreaded grid. In fact, is the grid snapping the major problem with OpenSCAD? How can it be correct to simply snap vertices to a grid? If they start distinct they need to stay distinct. What problem is the grid trying to solve? On Thu, 3 Jan 2019 at 11:20, nop head <nop.head@gmail.com> wrote: > Actually when I eliminated all the nearly coincident edges it don't need a > render(). > > On Thu, 3 Jan 2019 at 08:53, nop head <nop.head@gmail.com> wrote: > >> The problem seems to be caused by very close edges in a stack of polygons >> with different numbers of vertices.Each polygon has its radius defined by r >> / cos(180 / fn) so that the flat sides line up. But of course they don't >> line up exactly when 180 / n is an angle that makes cos return an >> irrational. Making each one smaller by 1/128 so they never line up exactly >> AND adding a render() around the stack fixes it. >> >> This is for generating hanging holes that print in mid air without >> support material. >> >> [image: image.png] >> >> I think something must snap the vertices and break the topology during F5 >> and that gets cached and breaks F6. I don't understand why render doesn't >> fix it though. It seems geometry generated by render() is different under >> F5 than it is with F6 but I thought render() was supposed to do the same as >> F6 for that sub tree. Perhaps that is something that could be fixed, so at >> least just render() is a work around. I think the underlying problems is >> using three number systems and not doing topologically aware conversions >> from one to another. >> >> On Wed, 2 Jan 2019 at 23:35, nop head <nop.head@gmail.com> wrote: >> >>> I though that putting render() around it to force CGAL during F5 would >>> fix the problem but it doesn't. >>> >>> The problematic code is a stack of linear extrudes unioned together. >>> >>> On Wed, 2 Jan 2019 at 21:20, Marius Kintel <kintel@kintel.net> wrote: >>> >>>> Argh, yes, I think this is a bug triggered by an optimization trying to >>>> avoid using CGAL where not necessary. >>>> >>>> -Marius >>>> >>>> > On Jan 2, 2019, at 13:17, nop head <nop.head@gmail.com> wrote: >>>> > >>>> > I am running into this error on F6 unless I flush the cache after the >>>> preview. >>>> > >>>> > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion >>>> violation! Expr: e_below != SHalfedge_handle() File: >>>> /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h >>>> Line: 426 >>>> > >>>> > Anybody know what causes it? I have vague recollection of it being >>>> something to do with caching an inexact value during the preview. >>>> > >>>> > >>>> > _______________________________________________ >>>> > 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 >>>> >>>
EN
Ed Nisley
Thu, Jan 3, 2019 6:07 PM

On 1/3/19 7:18 AM, nop head wrote:

What problem is the grid trying to solve?

Probably one I stumbled over a while ago:

https://softsolder.com/2015/01/02/openscad-quantized-vertices/

The discussion & pull:

https://github.com/openscad/openscad/issues/1107

https://github.com/openscad/openscad/pull/1115

Perhaps the state of the slicer art has made quantization irrelevant,
but … this may not be a solve-able problem in OpenSCAD.

--
Ed
https://softsolder.com

On 1/3/19 7:18 AM, nop head wrote: > What problem is the grid trying to solve? Probably one I stumbled over a while ago: https://softsolder.com/2015/01/02/openscad-quantized-vertices/ The discussion & pull: https://github.com/openscad/openscad/issues/1107 https://github.com/openscad/openscad/pull/1115 Perhaps the state of the slicer art has made quantization irrelevant, but … this may not be a solve-able problem in OpenSCAD. -- Ed https://softsolder.com
NH
nop head
Thu, Jan 3, 2019 7:59 PM

The main issue as I see it is every time you quantise the vertices some
formally distinct ones may merge and that breaks the topology. That happens
when STL files are written because they use floats and every other vertex
representation in OpenSCAD is higher resolution.

Quantizing the vertices on a grid courser than a float seems only to make
that problem more likely, make it happen earlier and doesn't fix anything.
What am I missing?

Basically it seems that users have to ensure their vertices are not closer
than the grid or they will get CGAL errors or generate STL files with self
intersections or degenerate triangles. This is very difficult because the
2D irrational vertices can never be made to match the 3D ones due to being
represented in fixed point, versus doubles or CGAL rationals. So a linear
extruded circle does match a cylinder exactly for odd numbers of vertices.
So any CGS between them is likely to generate errors.

I think it could be fixed by making sure that whenever vertices get
quantized they are checked to make sure ones that were separate are not
given the same value. So if they quantize to the same value the one that is
the least round number gets moved the minimum distance away. For example if
we have (1, 0, 0) and (1.0000000000000001, y, z) then the second vertex
becomes (1 + delta, y, z), where delta is the lsb of the floating point
mantissa, or the grid spacing if we still need one. As long as they
maintain the same numerical order and inequalities after quantization I
think the topology might be preserved without further consideration.

On Thu, 3 Jan 2019 at 18:07, Ed Nisley ed.nisley@pobox.com wrote:

On 1/3/19 7:18 AM, nop head wrote:

What problem is the grid trying to solve?

Probably one I stumbled over a while ago:

https://softsolder.com/2015/01/02/openscad-quantized-vertices/

The discussion & pull:

https://github.com/openscad/openscad/issues/1107

https://github.com/openscad/openscad/pull/1115

Perhaps the state of the slicer art has made quantization irrelevant,
but … this may not be a solve-able problem in OpenSCAD.

--
Ed
https://softsolder.com


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

The main issue as I see it is every time you quantise the vertices some formally distinct ones may merge and that breaks the topology. That happens when STL files are written because they use floats and every other vertex representation in OpenSCAD is higher resolution. Quantizing the vertices on a grid courser than a float seems only to make that problem more likely, make it happen earlier and doesn't fix anything. What am I missing? Basically it seems that users have to ensure their vertices are not closer than the grid or they will get CGAL errors or generate STL files with self intersections or degenerate triangles. This is very difficult because the 2D irrational vertices can never be made to match the 3D ones due to being represented in fixed point, versus doubles or CGAL rationals. So a linear extruded circle does match a cylinder exactly for odd numbers of vertices. So any CGS between them is likely to generate errors. I think it could be fixed by making sure that whenever vertices get quantized they are checked to make sure ones that were separate are not given the same value. So if they quantize to the same value the one that is the least round number gets moved the minimum distance away. For example if we have (1, 0, 0) and (1.0000000000000001, y, z) then the second vertex becomes (1 + delta, y, z), where delta is the lsb of the floating point mantissa, or the grid spacing if we still need one. As long as they maintain the same numerical order and inequalities after quantization I think the topology might be preserved without further consideration. On Thu, 3 Jan 2019 at 18:07, Ed Nisley <ed.nisley@pobox.com> wrote: > On 1/3/19 7:18 AM, nop head wrote: > > What problem is the grid trying to solve? > > Probably one I stumbled over a while ago: > > https://softsolder.com/2015/01/02/openscad-quantized-vertices/ > > The discussion & pull: > > https://github.com/openscad/openscad/issues/1107 > > https://github.com/openscad/openscad/pull/1115 > > Perhaps the state of the slicer art has made quantization irrelevant, > but … this may not be a solve-able problem in OpenSCAD. > > -- > Ed > https://softsolder.com > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >