Arch SplitMesh: Difference between revisions

From FreeCAD Documentation
m (languages)
(Undo revision 1124007 by David69 (talk)This is not correct.)
Tag: Undo
 
(35 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Arch SplitMesh|Workbenches=[[Arch Module|Arch]]|MenuLocation=Arch -> Conversion Tools -> Split Mesh|SeeAlso=[[Arch SelectNonSolidMeshes]]}}
<translate>


<!--T:11-->
==Description==
{{Docnav
|[[Arch_CloneComponent|Clonecomponent]]
|[[Arch_MeshToShape|MeshToShape]]
|[[Arch_Workbench|Arch]]
|IconL=Arch_CloneComponent.svg
|IconR=Arch_MeshToShape.svg
|IconC=Workbench_Arch.svg
}}


<!--T:1-->
This tool splits a selected [[Mesh Module|Mesh]] object into its separate components
{{GuiCommand
|Name=Arch SplitMesh
|MenuLocation=Arch → Utilities → Split Mesh
|Workbenches=[[Arch_Workbench|Arch]]
|SeeAlso=[[Arch_SelectNonSolidMeshes|Arch SelectNonSolidMeshes]], [[Arch_MeshToShape|Arch MeshToShape]]
}}


==Description== <!--T:2-->
==How to use==


<!--T:3-->
# Select a mesh object
This tool splits a selected [[Mesh_Workbench|Mesh]] object into its separate components
# Press the {{KEY|[[Image:Arch SplitMesh.png|16px]] '''Split Mesh'''}} entry in Arch -> Conversion Tools menu


==Usage== <!--T:4-->
==Scripting==


<!--T:5-->
The Add tool can by used in [[macros]] and from the python console by using the following function:
# Select a mesh object.
# Press the {{Button|[[Image:Arch_SplitMesh.svg|16px]] [[Arch_SplitMesh|Split Mesh]]}} entry in {{MenuCommand|Arch Utilities Split Mesh}}.


==Scripting== <!--T:16-->
'''splitMesh (object,[mark])''': splits the given mesh object into separated components.
If mark is False, nothing else is done. If True (default), non-manifold components will be painted in red.


<!--T:6-->
{{Emphasis|See also:}} [[Arch_API|Arch API]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:7-->
{{languages | {{it|Arch SplitMesh/it}} }}
The SplitMesh tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by using the following function:

</translate>
{{Code|code=
new_list = splitMesh(obj, mark=True)
}}
<translate>

<!--T:8-->
* Splits the given mesh object ({{incode|obj}}) into separated components.
* If {{incode|mark}} is {{incode|True}} [https://en.wikipedia.org/wiki/Manifold non-manifold] components will be painted red.
* {{incode|new_list}} is a list of all the individual components that make the mesh.

<!--T:12-->
Example:

</translate>
{{Code|code=
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)
}}
<translate>


<!--T:13-->
{{Docnav
|[[Arch_CloneComponent|Clonecomponent]]
|[[Arch_MeshToShape|MeshToShape]]
|[[Arch_Workbench|Arch]]
|IconL=Arch_CloneComponent.svg
|IconR=Arch_MeshToShape.svg
|IconC=Workbench_Arch.svg
}}

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

Latest revision as of 13:43, 3 April 2022

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)