Arch SplitMesh: Difference between revisions

From FreeCAD Documentation
No edit summary
(Marked this version for translation)
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<translate>
<translate>
<!--T:11-->
{{docnav|[[Arch_CloneComponent|Clone component]]|[[Arch_MeshToShape|Mesh To Shape]]|[[Arch_Module|Arch]]|IconL=Arch_Component_Clone.svg |IconC=Workbench_Arch.svg |IconR=Arch_MeshToShape.svg}}

<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand|Name=Arch SplitMesh|Workbenches=[[Arch Module|Arch]]|MenuLocation=Arch -> Utilities -> Split Mesh|SeeAlso=[[Arch SelectNonSolidMeshes]]}}
|Name=Arch SplitMesh
|MenuLocation=Arch → Utilities → Split Mesh
|Workbenches=[[Arch Module|Arch]]
|SeeAlso=[[Arch SelectNonSolidMeshes]], [[Arch MeshToShape]]
}}


==Description== <!--T:2-->
==Description== <!--T:2-->
Line 11: Line 20:


<!--T:5-->
<!--T:5-->
# Select a mesh object
# Select a mesh object.
# Press the {{KEY|[[Image:Arch SplitMesh.png|16px]] '''Split Mesh'''}} entry in Arch -> Utilities menu
# Press the {{Button|[[Image:Arch SplitMesh.png|16px]] [[Arch SplitMesh|Split Mesh]]}} entry in {{MenuCommand|Arch Utilities Split Mesh}}.


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


<!--T:7-->
<!--T:7-->
The Split Mesh tool can by used in [[macros]] and from the python console by using the following function:
The SplitMesh tool can be used in [[macros]] and from the [[Python]] console by using the following function:
</translate>
</translate>
{{Code|code=
<syntaxhighlight>
new_list = splitMesh(obj, mark=True)
splitMesh (object,[mark])
}}
</syntaxhighlight>
<translate>
<translate>

<!--T:8-->
<!--T:8-->
splits the given mesh object into separated components.
* Splits the given mesh object ({{incode|obj}}) into separated components.
* If {{incode|mark}} is {{incode|True}} [http://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:9-->
<!--T:12-->
Example:
If mark is False, nothing else is done. If True (default), non-[http://en.wikipedia.org/wiki/Manifold manifold] components will be painted in red.
</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|Clone component]]|[[Arch_MeshToShape|Mesh To Shape]]|[[Arch_Module|Arch]]|IconL=Arch_Component_Clone.svg |IconC=Workbench_Arch.svg |IconR=Arch_MeshToShape.svg}}

<!--T:14-->
{{Arch Tools navi}}

<!--T:15-->
{{Userdocnavi}}
</translate>
</translate>
{{clear}}
<languages/>

Revision as of 22:39, 9 February 2019

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

How to use

  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)