GuiCommand: Name: Arch SplitMesh MenuLocation: Utils , Split Mesh Workbenches: BIM_Workbench SeeAlso: Arch_SelectNonSolidMeshes, Arch_MeshToShape
Arch SplitMesh
Description
The Arch SplitMesh tool splits a selected Mesh object into its separate components
Usage
- Select a mesh object.
- Select the Utils →
Split Mesh option from the menu.
Scripting
See also:
Arch API and FreeCAD Scripting Basics.
The SplitMesh tool can be used in macros and from the Python console by using the following function:
new_list = splitMesh(obj, mark=True)
-
Splits the given mesh object (
obj
) into separated components. -
If
mark
isTrue
non-manifold components will be painted red. -
new_list
is a list of all the individual components that make the mesh.
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"
new_list = Arch.splitMesh(mesh_obj)
⏵ documentation index > BIM > Arch SplitMesh
This page is retrieved from https://github.com/FreeCAD/FreeCAD-documentation/blob/main/wiki/Arch_SplitMesh.md