Arch SplitMesh: Difference between revisions

From FreeCAD Documentation
(Arch_Component_Clone.svg -> Arch_CloneComponent.svg)
(Module to Workbench renaming.)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:11-->
<!--T:11-->
{{Docnav
{{Docnav
|[[Arch_CloneComponent|Clone component]]
|[[Arch_CloneComponent|Clone component]]
|[[Arch_MeshToShape|Mesh To Shape]]
|[[Arch_MeshToShape|Mesh To Shape]]
|[[Arch_Module|Arch]]
|[[Arch_Workbench|Arch]]
|IconL=Arch_CloneComponent.svg
|IconL=Arch_CloneComponent.svg
|IconR=Arch_MeshToShape.svg
|IconR=Arch_MeshToShape.svg
Line 15: Line 16:
|Name=Arch SplitMesh
|Name=Arch SplitMesh
|MenuLocation=Arch → Utilities → Split Mesh
|MenuLocation=Arch → Utilities → Split Mesh
|Workbenches=[[Arch_Module|Arch]]
|Workbenches=[[Arch_Workbench|Arch]]
|SeeAlso=[[Arch_SelectNonSolidMeshes|Arch SelectNonSolidMeshes]], [[Arch_MeshToShape|Arch MeshToShape]]
|SeeAlso=[[Arch_SelectNonSolidMeshes|Arch SelectNonSolidMeshes]], [[Arch_MeshToShape|Arch MeshToShape]]
}}
}}
Line 73: Line 74:
|[[Arch_CloneComponent|Clone component]]
|[[Arch_CloneComponent|Clone component]]
|[[Arch_MeshToShape|Mesh To Shape]]
|[[Arch_MeshToShape|Mesh To Shape]]
|[[Arch_Module|Arch]]
|[[Arch_Workbench|Arch]]
|IconL=Arch_CloneComponent.svg
|IconL=Arch_CloneComponent.svg
|IconR=Arch_MeshToShape.svg
|IconR=Arch_MeshToShape.svg

Revision as of 09:43, 28 August 2021

Arch SplitMesh

Menu location
Arch → Utilities → Split Mesh
Workbenches
Arch
Default shortcut
None
Introduced in version
-
See also
Arch SelectNonSolidMeshes, Arch MeshToShape

Description

This tool splits a selected Mesh object into its separate components

Usage

  1. Select a mesh object.
  2. Press the Split Mesh entry in Arch → Utilities → Split Mesh.

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 is True 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)