discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] CGAL errors upon translating a .scad file

J
JBoehm
Sun, Jan 10, 2016 1:00 AM

The problem described in the above post I could in the meantime more or less
solve. In the original files modelpart-003.scad and others of a similar kind
I gave coordinates with 12 decimal digits after the decimal point. Now I
round to six digits after the decimal point and get no CGAL errors anymore.

Nevertheless not all of my problems are solved: If I calculate with

openscad -o modelpart-008.stl modelpart-008.scad
openscad -o modelpart-009.stl modelpart-009.scad

http://www.aviduratas.de/openscad-01/modelpart-008.scad
http://www.aviduratas.de/openscad-01/modelpart-008.scad
http://www.aviduratas.de/openscad-01/modelpart-009.scad
http://www.aviduratas.de/openscad-01/modelpart-009.scad

and then apply

http://www.aviduratas.de/openscad-01/tsty.scad
http://www.aviduratas.de/openscad-01/tsty.scad

to get

http://www.aviduratas.de/openscad-01/tsty.stl
http://www.aviduratas.de/openscad-01/tsty.stl

the STL-file tsty.stl is faulty, namely all facets belonging to
modelpart-009.stl are shown pink upon
doing import("tsty.stl"); and then F5 and F12

--
View this message in context: http://forum.openscad.org/CGAL-errors-upon-translating-a-scad-file-tp15526p15612.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

The problem described in the above post I could in the meantime more or less solve. In the original files modelpart-003.scad and others of a similar kind I gave coordinates with 12 decimal digits after the decimal point. Now I round to six digits after the decimal point and get no CGAL errors anymore. Nevertheless not all of my problems are solved: If I calculate with openscad -o modelpart-008.stl modelpart-008.scad openscad -o modelpart-009.stl modelpart-009.scad http://www.aviduratas.de/openscad-01/modelpart-008.scad <http://www.aviduratas.de/openscad-01/modelpart-008.scad> http://www.aviduratas.de/openscad-01/modelpart-009.scad <http://www.aviduratas.de/openscad-01/modelpart-009.scad> and then apply http://www.aviduratas.de/openscad-01/tsty.scad <http://www.aviduratas.de/openscad-01/tsty.scad> to get http://www.aviduratas.de/openscad-01/tsty.stl <http://www.aviduratas.de/openscad-01/tsty.stl> the STL-file tsty.stl is faulty, namely all facets belonging to modelpart-009.stl are shown pink upon doing import("tsty.stl"); and then F5 and F12 -- View this message in context: http://forum.openscad.org/CGAL-errors-upon-translating-a-scad-file-tp15526p15612.html Sent from the OpenSCAD mailing list archive at Nabble.com.
J
JBoehm
Sun, Jan 10, 2016 1:05 AM

This is a copy of my original threadstarter post, that did not make it to the
mailing list:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Hello everybody,

Upon translating the file

http://www.aviduratas.de/openscad/modelpart-003.scad

I get with the command

juergen@antares:~$openscad -o modelpart-003.stl modelpart-003.scad

the output

ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR:
assertion violation!
Expr: itl != it->second.end()
File: /usr/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1101
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR:
assertion violation!
Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1)
File: /usr/include/CGAL/Nef_S2/SM_overlayer.h
Line: 252
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR:
assertion violation!
Expr: itl != it->second.end()
File: /usr/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1101
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR:
assertion violation!
Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1)
File: /usr/include/CGAL/Nef_S2/SM_overlayer.h
Line: 252
WARNING: Exported object may not be a valid 2-manifold and may need repair

In the final .stl a certain number of triangle prisms are missing. If I
translate the same .scad with openjscad the output has different errors,
namely some triangles from triangular prisms are omitted.

I suspect that my input file is free of errors, because it is generated by a
very easy process from a triangulation of a sphere, which, upon visual
inspection, looks totally ok.

So maybe there is a problem with OpenSCAD here? In general, these files that
I am translating currently, which are part of a triangulation of a spheroid
shell seem to be a good test on correctness of programs like openscad. With
another one I found an issue in OpenJSCAD which produced errors not present
in the OpenSCAD translation. (it was the file
http://www.aviduratas.de/modelpart-025.scad)

It is probably quite difficult to pinpoint the problem, as the input file is
large, but maybe someone of you finds a way to connect the missing triangle
prisms with concrete positions in the files, a problem I could not solve,
because I currently don't know how to extract coordinates in netfabb - maybe
it could be done with another viewing software.

Greetings

Jürgen

--
View this message in context: http://forum.openscad.org/CGAL-errors-upon-translating-a-scad-file-tp15526p15613.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

This is a copy of my original threadstarter post, that did not make it to the mailing list: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Hello everybody, Upon translating the file http://www.aviduratas.de/openscad/modelpart-003.scad I get with the command juergen@antares:~$openscad -o modelpart-003.stl modelpart-003.scad the output ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR: assertion violation! Expr: itl != it->second.end() File: /usr/include/CGAL/Nef_3/SNC_external_structure.h Line: 1101 ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR: assertion violation! Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File: /usr/include/CGAL/Nef_S2/SM_overlayer.h Line: 252 ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR: assertion violation! Expr: itl != it->second.end() File: /usr/include/CGAL/Nef_3/SNC_external_structure.h Line: 1101 ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR: assertion violation! Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File: /usr/include/CGAL/Nef_S2/SM_overlayer.h Line: 252 WARNING: Exported object may not be a valid 2-manifold and may need repair In the final .stl a certain number of triangle prisms are missing. If I translate the same .scad with openjscad the output has different errors, namely some triangles from triangular prisms are omitted. I suspect that my input file is free of errors, because it is generated by a very easy process from a triangulation of a sphere, which, upon visual inspection, looks totally ok. So maybe there is a problem with OpenSCAD here? In general, these files that I am translating currently, which are part of a triangulation of a spheroid shell seem to be a good test on correctness of programs like openscad. With another one I found an issue in OpenJSCAD which produced errors not present in the OpenSCAD translation. (it was the file http://www.aviduratas.de/modelpart-025.scad) It is probably quite difficult to pinpoint the problem, as the input file is large, but maybe someone of you finds a way to connect the missing triangle prisms with concrete positions in the files, a problem I could not solve, because I currently don't know how to extract coordinates in netfabb - maybe it could be done with another viewing software. Greetings Jürgen -- View this message in context: http://forum.openscad.org/CGAL-errors-upon-translating-a-scad-file-tp15526p15613.html Sent from the OpenSCAD mailing list archive at Nabble.com.