Mesh FromPartShape
Menu location |
---|
Meshes → Create Mesh from Shape |
Workbenches |
Mesh |
Default shortcut |
None |
Introduced in version |
- |
See also |
Introduction
This command creates a mesh from a shape object.
Usage
There are two methods:
- Either select the shape object, then choose Meshes →
Create Mesh from shape... from the top menu.
- Just selecting Meshes →
Create Mesh from shape... will give you an additional menu to choose your shape to mesh.
In both cases you get a menu that asks for the mesher program to use and its settings.
The settings you make there will be stored and used as default for the next time you create a mesh from a shape. introduced in version 0.19.
Mesher program
You can choose one of these 3 mesher programs:
Standard Mesher
You can change these settings:
- Surface deviation: Maximal linear deflection of a mesh section from the surface of the object
- Angular deviation: Maximal angular deflection from one mesh section to the next section
- Relative surface deviation: If checked, the maximal linear deviation of a mesh segment will be the specified Surface deviation multiplied by the length of the current mesh segment (edge)
- Apply face colors to mesh: If checked, the mesh will get the face colors of the object
- Define segments by face colors: If checked, mesh segments will be grouped according to the color of the object faces. These groups will be exported for mesh output formats supporting this feature (e.g. the format OBJ).
Mefisto Mesher
The only setting is:
- Maximum edge length: If this number is smaller the mesh becomes finer. The smallest value is 0.
Netgen Mesher
You can choose between mesh Fineness being:
- Very coarse
- Coarse
- Moderate
- Fine
- Very fine
- User defined
- For this you can set these values:
- Mesh size grading: If this parameter is smaller, the mesh becomes finer. A value in the range of 0.1-1.
- Element per edge: If this parameter is larger, the mesh becomes finer. A value in the range of 0.2-10.
- Element per curvature radius: If this parameter is larger, the mesh becomes finer. A value in the range of 0.2-10.
For every Fineness you can also choose:
- Optimize surface: Whether an optimization of surface shape will be done.
- Second order elements: Whether second order elements will be generated.
- Quad dominated: Whether meshes will be arranged preferably using quadrilateral faces.
Scripting
This tool can be used in macros and from the Python console by using the following function:
MeshPart.meshFromShape(Shape=Shape, MaxLength=520)
Example:
import FreeCAD, Draft, Arch, Mesh, MeshPart Line = Draft.makeWire([FreeCAD.Vector(0, 0, 0),FreeCAD.Vector(2000, 2000, 0)]) Wall = Arch.makeWall(Line, width=150, height=3000) FreeCAD.ActiveDocument.recompute() Shape = Wall.Shape.copy(False) Shape.Placement = Wall.getGlobalPlacement() mesh_obj = FreeCAD.ActiveDocument.addObject("Mesh::Feature", "Mesh") mesh_obj.Mesh = MeshPart.meshFromShape(Shape=Shape, MaxLength=520) mesh_obj.ViewObject.DisplayMode = "Flat Lines"
Notes
- Tutorial: Export_to_STL_or_OBJ
Mesh
- Tools: Import Mesh, Export Mesh, Create Mesh from shape, Curvature Plot, Harmonize Normals, Flip Normals, Fill Holes, Close hole, Add triangle, Remove components, Remove components by hand, Create mesh segments, Smooth, Scale
- Analyze: Evaluate & Repair mesh, Face Info, Curvature Info, Check solid mesh, Boundings info
- Regular solid: Regular solid, Mesh Cube, Mesh Cylinder, Mesh Cone, Mesh Sphere, Mesh Ellipsoid, Mesh Torus
- Boolean: Union, Intersection, Difference
- Cutting: Mesh PolyCut, Trim mesh, Trim mesh with a plane
- Other: Merge, Select Mesh, Split Mesh, Make segment
- Additional: Import Export Preference, OpenSCAD Workbench, Mesh Scripting
User documentation

- Installation: Linux/Unix, Windows, Mac; Getting started
- Basics: About FreeCAD, Workbenches, Preferences, Document structure, Interface Customization, Properties, Mouse Model; Tutorials
- Workbenches: Std Base; Arch, Draft, FEM, Image, Inspection, Mesh, OpenSCAD, Part, PartDesign, Path, Plot, Points, Raytracing, Reverse Engineering, Robot, Ship, Sketcher, Spreadsheet, Start, Surface workbench, TechDraw, Test Framework, Web
- Scripting: Introduction to Python, FreeCAD scripting tutorial, FreeCAD Scripting Basics, How to install macros, Gui Command, Units Modules: Builtin modules, Workbench creation, Installing more workbenches Meshes: Mesh Scripting, Mesh Module Parts: The Part Module, Topological data scripting, PythonOCC, Mesh to Part Coin scenegraph: The Coin/Inventor scenegraph, Pivy Qt interface: PySide, Using the FreeCAD GUI, Dialog creation Parametric objects: Scripted objects Other: Code snippets, Line drawing function, Embedding FreeCAD, FreeCAD vector math library, Power users hub, Python, Macros, FreeCAD Scripting Basics, Topological data scripting