Arch: Dividi Mesh

From FreeCAD Documentation
This page is a translated version of the page Arch SplitMesh and the translation is 100% complete.

Arch SplitMesh

Menu location
Arch → Utilità → Dividi Mesh
Workbenches
Arch
Default shortcut
None
Introduced in version
-
See also
Seleziona mesh non solidi, Da mesh a solido

Descrizione

Questo strumento suddivide un oggetto Mesh selezionato nei suoi singoli componenti

Utilizzo

  1. Selezionare un oggetto mesh.
  2. Premere il pulsante Dividi Mesh in Arch → Utilità → Dividi Mesh.

Script

Vedere anche: API di Arch e Nozioni di base sugli script di FreeCAD.

Lo strumento Dividi Mesh può essere utilizzato nelle macro e dalla console Python utilizzando la seguente funzione:

new_list = splitMesh(obj, mark=True)
  • Divide l'oggetto mesh dato (obj) in componenti separati.
  • Se mark è True non-manifold i componenti diventano rossi.
  • new_list è un elenco di tutti i singoli componenti che creano la mesh.

Esempio:

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)