Meshes are normally created with the Mesh Workbench, or imported from STL, OBJ, and similar mesh file formats.
Please note that the Fem FemMesh (
Fem::FemMesh class). This information does not apply to FEM meshes.
Simplified diagram of the relationships between the core objects in the program. The
Mesh::MeshObject class is embedded in the
Mesh::Feature object and from there it is propagated to all objects that are derived from it.
The Mesh MeshObject is an object that is assigned to some App DocumentObjects.
In particular, the basic object that handles these types of attributes is the Mesh Feature (
Mesh::Feature class). All objects derived from this class will have access to a Mesh MeshObject.
The most notable objects that will have a Mesh MeshObject are the following:
- Any primitive mesh created with the Mesh Workbench.
- Any object created by importing an STL, OBJ, and similar mesh format files.
All objects derived from
Mesh::Feature will have a Mesh MeshObject, which is normally accessible from its
import FreeCAD as App doc = App.newDocument() obj = App.ActiveDocument.addObject("Mesh::Cube", "Cube") App.ActiveDocument.recompute() print(obj.Mesh)
A MeshObject has many attributes (variables) and methods that contain information about it, and which allow doing operations with it. These variables and methods can be tested in the Python console.
print(obj.Mesh.Area) print(obj.Mesh.BoundBox) print(obj.Mesh.CountPoints) print(obj.Mesh.Volume) obj.Mesh.copy() obj.Mesh.countComponents() obj.Mesh.getEigenSystem() obj.Mesh.write("my_file.stl")