Arch SplitMesh: Difference between revisions

From FreeCAD Documentation
(Undo revision 1124007 by David69 (talk)This is not correct.)
Tag: Undo
(Arch -> BIM)
Line 4: Line 4:
<!--T:11-->
<!--T:11-->
{{Docnav
{{Docnav
|[[BIM_Preflight|Preflight]]
|[[Arch_CloneComponent|Clonecomponent]]
|[[Arch_MeshToShape|MeshToShape]]
|[[Arch_MeshToShape|MeshToShape]]
|[[Arch_Workbench|Arch]]
|[[BIM_Workbench|BIM]]
|IconL=Arch_CloneComponent.svg
|IconL=BIM_Preflight.svg
|IconR=Arch_MeshToShape.svg
|IconR=Arch_MeshToShape.svg
|IconC=Workbench_Arch.svg
|IconC=Workbench_BIM.svg
}}
}}

{{VeryImportantMessage|THIS COMMAND IS PART OF THE INTEGRATED [[BIM_Workbench|BIM WORKBENCH]] IN V1.0<br>
This page has been updated for that version.}}


<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand
|Name=Arch SplitMesh
|Name=Arch SplitMesh
|MenuLocation=Arch → Utilities → Split Mesh
|MenuLocation=Utils → Split Mesh
|Workbenches=[[Arch_Workbench|Arch]]
|Workbenches=[[BIM_Workbench|BIM]]
|SeeAlso=[[Arch_SelectNonSolidMeshes|Arch SelectNonSolidMeshes]], [[Arch_MeshToShape|Arch MeshToShape]]
|SeeAlso=[[Arch_SelectNonSolidMeshes|Arch SelectNonSolidMeshes]], [[Arch_MeshToShape|Arch MeshToShape]]
}}
}}
Line 29: Line 32:
<!--T:5-->
<!--T:5-->
# Select a mesh object.
# Select a mesh object.
# Press the {{Button|[[Image:Arch_SplitMesh.svg|16px]] [[Arch_SplitMesh|Split Mesh]]}} entry in {{MenuCommand|Arch → Utilities → Split Mesh}}.
# Select the {{MenuCommand|Utils → [[Image:Arch_SplitMesh.svg|16px]] Split Mesh}} option from the menu.


==Scripting== <!--T:16-->
==Scripting== <!--T:16-->
Line 75: Line 78:
<!--T:13-->
<!--T:13-->
{{Docnav
{{Docnav
|[[BIM_Preflight|Preflight]]
|[[Arch_CloneComponent|Clonecomponent]]
|[[Arch_MeshToShape|MeshToShape]]
|[[Arch_MeshToShape|MeshToShape]]
|[[Arch_Workbench|Arch]]
|[[BIM_Workbench|BIM]]
|IconL=Arch_CloneComponent.svg
|IconL=BIM_Preflight.svg
|IconR=Arch_MeshToShape.svg
|IconR=Arch_MeshToShape.svg
|IconC=Workbench_Arch.svg
|IconC=Workbench_BIM.svg
}}
}}


</translate>
</translate>
{{Arch_Tools_navi{{#translation:}}}}
{{BIM_Tools_navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Revision as of 19:22, 9 June 2024

THIS COMMAND IS PART OF THE INTEGRATED BIM WORKBENCH IN V1.0
This page has been updated for that version.

Arch SplitMesh

Menu location
Utils → Split Mesh
Workbenches
BIM
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. 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 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)