Errors when operating on an STL file

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Errors when operating on an STL file

william
I am trying to halve an object imported from an STL file.  However, it looks funny when previewed.  And an error appears in console after rendering.

Rendering Polygon Mesh using CGAL...
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! File: /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/SNC_decorator.h Line: 377 Explanation: it is not possible to decide which one is a visible facet (if any)

May I know the reason why?   And how can this problem be solved.

Thanks.



stand.zip
Reply | Threaded
Open this post in threaded view
|

Re: Errors when operating on an STL file

william
I searched the forum again and seemed to find something similar.  Following the suggestion to install netfabb and fiddle around, a self-intersection is shown as below:




However, the Basic version doesn't allow me to do anything to repair it unless upgrading to the professional version.  I tried opening it in 3D-builder and it didn't reveal any problem and thus nothing to repair.  Is there any other way to deal with this self intersection problem?   And is it this problem that is causing trouble when applying boolean operation on this STL file in OpenSCAD?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Errors when operating on an STL file

macdarren
In reply to this post by william
try the free online netfabb repair service:

https://modelrepair.azurewebsites.net

Reply | Threaded
Open this post in threaded view
|

Re: Errors when operating on an STL file

droftarts
There are some repair tools in the free version of Netfabb, google "netfabb basic stl repair", and see one of the online tutorials, eg: http://www.3dcreationlab.co.uk/news/fix-stl-files-for-3d-printer.php

Ian
Reply | Threaded
Open this post in threaded view
|

Re: Errors when operating on an STL file

MichaelAtOz
Administrator
In reply to this post by william
william wrote
 And is it this problem that is causing trouble when applying boolean operation on this STL file in OpenSCAD?
Yes, boolean uses CGAL which needs intact geometry.
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.
Reply | Threaded
Open this post in threaded view
|

Re: Errors when operating on an STL file

william
Thank you all!

MichaelAtOz wrote
Yes, boolean uses CGAL which needs intact geometry.
And indeed.  After fixing it using the free microsoft online repair service, I can render it perfectly.


However, there are still some missing faces under Preview as before (but that's of little concern to me)


The online tutorial looks helpful; I will study it carefully.  After googling with "netfabb basic stl repair", I found the netfabb cloud service.  Is it the same as the one offered by microsoft?  ... as it says it "extends the functionality of the free netfabb Studio Basic by some enhanced repair capabilities otherwise only available in netfabb Studio Professional."

Thanks once again.  
Reply | Threaded
Open this post in threaded view
|

Re: Errors when operating on an STL file

nophead
The missing faces in preview are probable due to a missing convexity parameter in the import statement.
Reply | Threaded
Open this post in threaded view
|

Re: Errors when operating on an STL file

william
nophead wrote
The missing faces in preview are probable due to a missing convexity parameter in the import statement.
Thanks for the tip.  Me lazy guy finally got to read the manual.  And in the import() section, convexity was explained clearly.  I set it to 10 and the preview is now flawless.  

More questions.  What is the default value for convexity?  And why do I need to tell OpenCSG what it is?  (I know it may get a little technical)

And in that same section, my original question was also answered.  

++++++++++++++
If you want to render the imported STL file later, you have to make sure that the STL file is "clean". This means that the mesh has to be manifold and should not contain holes nor self-intersections. If the STL is not clean, you might get errors like:
...
or
...
(... looks like the CGAL error message I was getting)

In order to clean the STL file, you have the following options:
- use http://wiki.netfabb.com/Semi-Automatic_Repair_Options . This will repair the holes but not the self-intersections.
- use netfabb basic. This free software doesnt have the option to close holes nor can it fix the self-intersections
- use MeshLab, This free software can fix all the issues
++++++++++++++++

It mentions MeshLab but not the free online netfabb service.   Worth taking a look into MeshLab?

Thanks.