Code: Select all
import Mesh,Part mesh=Mesh.createTorus() shape=Part.Shape() shape.makeShapeFromMesh(mesh.Topology,0.05) # the second arg is the tolerance for sewing solid=Part.makeSolid(shape) Part.show(solid)
The technique is actually quite simple. The internal representation of a mesh in FreeCAD is indexed-based, i.e. we have an array of 3d points and another array of faces. Each face has three indexes to the point array to describe a triangle.Sorry I am unfamiliar with this technique can someone point me in the right direction
ATM the conversion cannot be done via GUI. Thus, you can use a modified version of the above script. In your case it can look like this:I would love to be able to convert a stl file to step
shape.makeShapeFromMesh(mesh.Topology,0.05) # the second arg is the tolerance for sewing
At least for the GUI command a waiting cursor appears now to indicate that a long operation is running.Conversion can take quite some time during which FreeCAD will appear unresponsive.
Yes, that's true. But this feature was actually only supposed to be used for rather small objects. If we want to use it for more complex objects then we have to implement a more intelligent algorithm where we collect several triangles to one face.I tried this on a very large and complex STL object, and it crashed FreeCAD. However, it does work quite well on files of a reasonable size.