Difference between revisions of "Part ShapeFromMesh"

From FreeCAD Documentation
Jump to navigation Jump to search
(Minor change to Docnav.)
Line 15: Line 15:
|Name=Part ShapeFromMesh‏‎
|Name=Part ShapeFromMesh‏‎
|MenuLocation=Part → Create shape from mesh...
|MenuLocation=Part → Create shape from mesh...
|SeeAlso=[[Part_MakeSolid|Part ConvertToSolid]], [[Part_RefineShape|Part RefineShape]], [[Part_PointsFromMesh|Part PointsFromMesh]]
|SeeAlso=[[Part_MakeSolid|Part ConvertToSolid]], [[Part_RefineShape|Part RefineShape]], [[Part_PointsFromMesh|Part PointsFromMesh]]

Latest revision as of 18:52, 27 November 2020

Other languages:
Deutsch • ‎English • ‎français • ‎italiano • ‎română • ‎русский
Arrow-left.svg Previous: Part BoxSelection.svg BoxSelection

Part ShapeFromMesh.svg Part ShapeFromMesh‏‎

Menu location
Part → Create shape from mesh...
Default shortcut
Introduced in version
See also
Part ConvertToSolid, Part RefineShape, Part PointsFromMesh


The Part ShapeFromMesh.svg Part ShapeFromMesh command creates a shape from a mesh object. Mesh objects have limited editing capabilities in FreeCAD, converting them to shapes will allow their use with many more boolean and modification tools.

The inverse operation is Mesh FromPartShape.svg Mesh FromPartShape from the Workbench Mesh.svg Mesh Workbench.


  1. Select the mesh object in the tree view.
  2. Go to the menu, Part → Part ShapeFromMesh.svg Create shape from mesh.
  3. A popup-menu will ask for the tolerance for sewing shape; the default value is 0.1.
  4. A shape from the mesh object is created as a separate new object.

Analyzing and repairing of the mesh, if needed, should be done manually before launching Part ShapeFromMesh.svg ShapeFromMesh. Appropriate tools for this task are available in the Workbench Mesh.svg Mesh Workbench.

After creation of a Shape, it may be useful to use Convert to solid (necessary for boolean operations) and Part RefineShape.svg Refine shape.



Creating a Shape from a Mesh can be done by using the makeShapeFromMesh method from a Part TopoShape; you need to specify the source mesh and tolerance, and assign the result to a new Part Feature object.

Notice that the mesh must be recalculated before it is converted to a Shape, otherwise there won't be topology information, and the conversion won't be successful.

import FreeCAD as App
import Part

doc = App.newDocument()
mesh = doc.addObject("Mesh::Cube", "Mesh")

solid = doc.addObject("Part::Feature", "Shape")
shape = Part.Shape()
shape.makeShapeFromMesh(mesh.Mesh.Topology, 0.1)

solid.Shape = shape
solid.Placement.Base = App.Vector(15, 0, 0)

Arrow-left.svg Previous: Part BoxSelection.svg BoxSelection