Dear forum,
I made a model of a contra alto clarinet mouthpiece that generates
several parts which I finally combine with difference and union
functions. Something like this
difference()
{
import("body.stl");
union()
{
import("bore.stl");
import("chamber.stl");
}
}
The results gives the following CGAL error even when I do it like above
with import. What can be the cause?
In Meshlab the union and difference functions give no problems (see
picture).
The stl's can be downloaded at:
https://www.basensax.nl/images/body.stl
https://www.basensax.nl/images/bore.stl
https://www.basensax.nl/images/chamber.stl
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
According to Netfabb the body and chamber have degenerate triangles and
self intersections.
On Tue, 2 May 2023 at 12:09, Johan Jonker info@johanjonker.net wrote:
Dear forum,
I made a model of a contra alto clarinet mouthpiece that generates several
parts which I finally combine with difference and union functions.
Something like this
difference()
{
import("body.stl");
union()
{
import("bore.stl");
import("chamber.stl");
}
}
The results gives the following CGAL error even when I do it like above
with import. What can be the cause?
In Meshlab the union and difference functions give no problems (see
picture).
The stl's can be downloaded at:
https://www.basensax.nl/images/body.stl
https://www.basensax.nl/images/bore.stl
https://www.basensax.nl/images/chamber.stl
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
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On 02.05.23 13:08, Johan Jonker wrote:
The results gives the following CGAL error even when I do it like
above with import. What can be the cause?
It seems Manifold can deal with the issues in the given files where
CGAL fails. So you could try with a dev snapshot version of OpenSCAD
and enable the "manifold" feature in Preferences->Features.
ciao,
Torsten.
On 02.05.2023 16:03, nop head wrote:
According to Netfabb the body and chamber have degenerate triangles
and self intersections.
Using STL as basis for union and difference is always risky business,
because STL topology is not well defined (STL is not a mesh, it is a
triangle soup). To do booleans, the mesh topology must first be assumed
by the relevant software via coordinate tolerances, and different
software will apply different tolerances. Therefore, the success or
failure typically depends on the software being used.
I tried running the .scad file through AngelCAD, and it worked without
problems in this case. This is because in this scenario, STL imports are
automatically healed before attempting boolean operations, and such
healing can fix degenerated triangles and some other issues. Sometimes
you get lucky, sometimes not.
I would suggest using your favourite mesh repair utility and save the
result in a format that contains topology and OpenSCAD can read (e.g.
OFF) and then replace the imports to refer to the OFF files instead.
Carsten Arnholm
@Torsten
I tried the snapshot version with the manifold feature selected.
It works very fast (it feels like 5 to 10 faster) and without any failure.
I wonder if there are any disadvantages.
Op 2-5-2023 om 16:39 schreef Torsten Paul:
On 02.05.23 13:08, Johan Jonker wrote:
The results gives the following CGAL error even when I do it like
above with import. What can be the cause?
It seems Manifold can deal with the issues in the given files where
CGAL fails. So you could try with a dev snapshot version of OpenSCAD
and enable the "manifold" feature in Preferences->Features.
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Dear all
thanks for spending time to solve my problem.
It seems that the suggestion of Torsten works very well. So extra thanks
@Torsten.
The 2021 version of Openscad takes 4 minutes to render the inside of the
mouthpiece and 9 minutes for the outside.
To give an idea. As well the inside as the outside are built from about
1000 slices of 200 points.
The outside rendering became slower because of the logo and typenumber
that are subtracted from the "skin'.
I have to safe the separate inside and outside stl and use the
difference function from meshlab to make the final stl.
The 2023 version op Openscad takes only 34 seconds to render both inside
and outside an apply the difference function.
So it is 25! times faster. WOW!!!