[OpenSCAD] Ovals

Carsten Arnholm arnholm at arnholm.org
Wed Sep 5 14:55:21 EDT 2018


> Le mer. 5 sept. 2018 à 03:03, FourthDr <who_doctor at hotmail.com> a écrit :
>> I'm trying to get these two attached stl files split by tomorrow. I've been
>> tinkering with them for months. So far without success. Any one interested
>> in seeing if they can find and correct the two files for me? And maybe give
>> some tips and or suggest some software tools I have not already tried?
>> Cryptic CGAL errors don't really help me find and fix what OpenSCAD is
>> complaining about.
>>
>> back-cover-no-stand-2.stl
>> <http://forum.openscad.org/file/t1425/back-cover-no-stand-2.stl>
>> _LCD_face_plate_LCD_hole_open_(repaired).stl
>> <http://forum.openscad.org/file/t1425/_LCD_face_plate_LCD_hole_open_%28repaired%29.stl>
>> puzzlecutlib3.scad <http://forum.openscad.org/file/t1425/puzzlecutlib3.scad>
>>
>> Thanks for all the help.

For the fun of it, I checked your files in my own tool. The first one 
(back-cover-no-stand-2.stl) reports no problems.

The second "repaired" _LCD_face_plate... reports numerous problems and a 
fix is attempted (seems better although not 100% clean)

Here is a link to the fixed file (link will expire in 2 days). I don't 
know if it works any better than what you had, but you can try.
https://www.expirebox.com/download/050b8ca1679fcea5bfa17ea49aa6fc21.html

What is reported is for example
- many collapsed/zero area faces
- many duplicated faces
- many non-manifold faces

It should be said that STL contains zero topology, so any claim of 
non-manifoldness is a subjective interpretation of the data. For 
exchanging between applications if would have been better to use a 
format with explicit topology e.g. Wavefront OBJ. But STL is indeed very 
common with all its issues.

Below is the log from my tool showing iterative attempts to fix your 
file. The approach taken when interpreting the STL is quite different 
from OpenSCADs "grid" approach so the result is likely not going to be 
the same, but perhaps OpenSCAD likes the result better.

In iteration 0, the STL "polygon soup" is read. The high number of 
initial non-manifold edges is normal for STL since it is a polygon soup 
with no connectivity at all. From iteration 1, connectivity is 
interpreted by merging vertices (with distance < dtol), and thus the 
number of non-manifold edges is much reduced.

The vertex merging process leaves some zero area faces (with area < 
atol) that are subsequently removed. Also, duplicate faces are removed. 
After 6 iterations the only remaining issues are a few non-manifold 
edges remain which cannot easily be resolved.

However, the resulting file is likely more usable in other programs, 
maybe also in OpenSCAD. I could not test it in OpenSCAD since I am on 
Kubuntu 18.04 and apparently there is no usable binary for 18.04.

------
Parameters:
   input_file = _LCD_face_plate_LCD_hole_open_(repaired).stl


polyhedron 0 ================= volume=35242.9, dtol=0.01, atol=1e-06, 
maxiter=10
iteration 0: vertices=43758 faces=14586
              warning: 1 zero area faces.
              warning: nonmanifold edges: uc(1)=43758
              merged 38113 vertices
              removed 2612 collapsed or zero area faces
              split 32 faces
              removed 366 duplicate faces
              removed 161 nonmanifold faces
              removed 29 zero area faces
              total changes=41313
              warning: nonmanifold edges: uc(1)=61 uc(3)=71 uc(4)=57 
uc(5)=1 

 
 

iteration 1: vertices=5645 faces=11515 
 

              warning: nonmanifold edges: uc(1)=61 uc(3)=71 uc(4)=57 
uc(5)=1 

              removed 6 unused vertices 
 

              merged 434 vertices 
 

              removed 790 collapsed or zero area faces 
 

              split 8 faces 
 

              removed 145 duplicate faces 
 

              removed 71 nonmanifold faces 
 

              removed 8 zero area faces 
 

              total changes=1462 
 

              warning: nonmanifold edges: uc(1)=26 uc(3)=27 uc(4)=37 
uc(6)=1 uc(7)=1 

 
 

iteration 2: vertices=5205 faces=10514 
 

              warning: nonmanifold edges: uc(1)=26 uc(3)=27 uc(4)=37 
uc(6)=1 uc(7)=1
              removed 5 unused vertices
              merged 114 vertices
              removed 227 collapsed or zero area faces
              split 2 faces
              removed 42 duplicate faces
              removed 30 nonmanifold faces
              removed 4 zero area faces
              total changes=424
              warning: nonmanifold edges: uc(1)=9 uc(3)=6 uc(4)=19

iteration 3: vertices=5086 faces=10213
              warning: nonmanifold edges: uc(1)=9 uc(3)=6 uc(4)=19
              removed 4 unused vertices
              merged 19 vertices
              removed 40 collapsed or zero area faces
              split 6 faces
              removed 5 duplicate faces
              removed 2 nonmanifold faces
              removed 6 zero area faces
              total changes=82
              warning: nonmanifold edges: uc(1)=4 uc(3)=12 uc(4)=15

iteration 4: vertices=5063 faces=10172
              warning: nonmanifold edges: uc(1)=4 uc(3)=12 uc(4)=15
              removed 1 unused vertex
              split 2 faces
              removed 1 duplicate face
              removed 2 nonmanifold faces
              removed 4 zero area faces
              total changes=10
              warning: nonmanifold edges: uc(1)=1 uc(3)=7 uc(4)=15

iteration 5: vertices=5062 faces=10168
              warning: nonmanifold edges: uc(1)=1 uc(3)=7 uc(4)=15
              removed 1 unused vertex
              total changes=1
              warning: nonmanifold edges: uc(1)=1 uc(3)=7 uc(4)=15

iteration 6: vertices=5061 faces=10168
              warning: nonmanifold edges: uc(1)=1 uc(3)=7 uc(4)=15
              total changes=0
              warning: nonmanifold edges: uc(1)=1 uc(3)=7 uc(4)=15

Summary:
              polyhedron 0: vertices=5061 faces=10168 : warning: 
nonmanifold edges: uc(1)=1 uc(3)=7 uc(4)=15

Writing: _LCD_face_plate_LCD_hole_open_(repaired)_polyfix.stl

... abm_polyfix finished, time used: 0d 00h 00m 01s

-----


When you have as many issues as in this example, you cannot expect 
import + booleans will work very well, if at all. Even my attempted fix 
may still be problematic, but you can try.

It could be that the "repaired" version you provided has more problems 
than the original. With such issues it isn't a surprise that using it in 
OpenSCAD was a problem.

Carsten Arnholm



More information about the Discuss mailing list