step to stl converter

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Skywarp
Posts: 1
Joined: Thu Mar 23, 2017 8:12 am

Re: step to stl converter

Post by Skywarp »

Hello, but how to convert a .stl to .step using a script
jg847
Posts: 23
Joined: Tue Jan 23, 2018 5:27 pm

Re: step to stl converter

Post by jg847 »

I am also interested in doing this. I tried to do it using the GUI, but FreeCAD freezes during this process and I am unable to do so. Doing it via script would be much better.

I have found some of the utilities necessary in the process, such as

Code: Select all

mesh=Mesh.Mesh()
mesh.read("Pump.stl")
shape=Part.Shape()
shape.makeShapeFromMesh(mesh.Topology,0.05) # the second arg is the tolerance for sewing
shape.exportStep("Pump.step")
but I receive the message
The mesh data structure has some defects
in the terminal, and the process never finishes. I guess this is because the mesh is not waterproof and so I need to analyse it and make repairs (such as in the GUI tutorial
https://www.freecadweb.org/wiki/Import_from_STL_or_OBJ) but I cannot seem to find the script calls for these functions.

Any help is appreciated.

James
Post Reply