Arch SplitMesh/sv: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{docnav
{{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}}
|[[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
}}


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 10: Line 17:
This tool splits a selected [[Mesh Module|Mesh]] object into its separate components
This tool splits a selected [[Mesh Module|Mesh]] object into its separate components


==How to use==
==Usage==


# Select a mesh object.
# Select a mesh object.
Line 16: Line 23:


==Scripting==
==Scripting==
{{Emphasis|See also:}} [[Arch API]] and [[FreeCAD Scripting Basics]].
{{Emphasis|See also:}} [[Arch API|Arch API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].

The SplitMesh tool can be used in [[macros|macros]] and from the [[Python|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:
{{Code|code=
{{Code|code=
new_list = splitMesh(obj, mark=True)
new_list = splitMesh(obj, mark=True)
Line 28: Line 36:


Example:
Example:

{{Code|code=
{{Code|code=
import FreeCAD, Draft, Arch, Mesh, MeshPart
import FreeCAD, Draft, Arch, Mesh, MeshPart
Line 44: Line 53:
new_list = Arch.splitMesh(mesh_obj)
new_list = Arch.splitMesh(mesh_obj)
}}
}}
{{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}}


{{docnav
{{Arch Tools navi}}
|[[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
}}

{{Arch Tools navi/sv}}


{{Userdocnavi}}
{{Userdocnavi/sv}}

Revision as of 10:26, 4 February 2020

Arch SplitMesh

Menyplacering
Arch → Utilities → Split Mesh
Arbetsbänkar
Arch
Standard genväg
Ingen
Introducerad i version
-
Se även
Arch SelectNonSolidMeshes

Beskrivning

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)