I have tiny problem with "stl" conversion.
FC create meshes but not create "Solid from shell".
Example file: left_mainv3.stl in https://www.thingiverse.com/thing:2043600/#files project.
shell=App.ActiveDocument.left_mainv3001.Shape
>>> if shell.ShapeType != 'Shell': raise RuntimeError('Part object is not a shell')
>>> _=Part.Solid(shell)
>>> if _.isNull(): raise RuntimeError('Failed to create solid')
>>> App.ActiveDocument.addObject('Part::Feature','Solid').Shape=_.removeSplitter()
>>> del _
Why?
Krzysztof
STL conversion
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: STL conversion
please always post you Help > About FreeCAD > Copy to clipboard info
and please put code in
Code: Select all
code brackets
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: STL conversion
I have tested some last versions, there is always the same result.
OS: Debian GNU/Linux testing (buster)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13205 (Git)
Build type: None
Branch: master
Hash: 4ef00d7be4658a1fdc905699ede2860e002d9996
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: Polish/Poland (pl_PL)
OS: Debian GNU/Linux testing (buster)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13205 (Git)
Build type: None
Branch: master
Hash: 4ef00d7be4658a1fdc905699ede2860e002d9996
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: Polish/Poland (pl_PL)
Re: STL conversion
I'm asking myself the same thing: why did you post in Open discussion, when this is clearly a help request?
Help requests should be posted in the "Help on using FreeCAD" forum. If your question is about python scripting, then use the python scripting forum.
The problem is that you assume that you have a valid manifold mesh. But the fact is, you cannot be sure of it. An outstanding proportion of stl files on Thingiverse are simply badly made.
The first problem is that your mesh is actually composed of multiple meshes. Each raised letter is a separate mesh. Check your shape with Part CheckGeometry. You can separate them with Arch --> Utilities --> Split mesh.
But then you'll see that the first mesh for the body, when converted to a shape, forms an invalid shell. If you check the mesh with "Meshes --> Analyse --> Evaluate & Repair Mesh...", it will tell you there are 15 degenerated faces.
But you are lucky: here, the repair function works. Usually, it destroys the mesh further, by deleting the broken faces and leaving a mesh with missing faces.
Attached is a FCStd file with the main body converted to shape, refined then converted to solid. You'll have to repeat the process with the letters.
- Attachments
-
- left_mainv3.fcstd
- (328.73 KiB) Downloaded 28 times