Part: Crea forma da mesh

From FreeCAD Documentation
Revision as of 19:22, 17 October 2020 by FuzzyBot (talk | contribs) (Updating to match new version of source page)

‏‎Crea forma da mesh

Posizione nel menu
Part → Crea forma da mesh...
Ambiente
Part
Avvio veloce
Nessuno
Introdotto nella versione
-
Vedere anche
Converti in solido, Affina forma, Crea punti da mesh

Introduction

Introduzione

Questo comando crea una forma da un oggetto mesh. In FreeCAD gli oggetti mesh hanno limitate capacità di editing, convertendoli in forme permette di utilizzarli con molti più strumenti (vedere anche le Note).

The inverse operation is Mesh FromPartShape from the Mesh Workbench.

Usage

Utilizzo

  1. Selezionare un oggetto mesh.
  2. Scegliere Part → Crea forma da mesh dal menu in alto.
  3. Un menu pop-up chiede di definire la tolleranza per la chiusura (valore di default: 0,1)
  4. Dall'oggetto mesh viene creato un nuovo oggetto forma indipendente.

Limitazioni

Non sono disponibili l'analisi e la convalida dell'oggetto mesh.

After creation of a Shape, it may be useful to use Convert to solid (necessary for boolean operations) and Refine shape.

Links

Script

Creating a Shape from a Mesh can be done by using the makeShapeFromMesh method from a Part TopoShape; you need to specify the source mesh and tolerance, and assign the result to a new Part Feature object.

Notice that the mesh must be recalculated before it is converted to a Shape, otherwise there won't be topology information, and the conversion won't be successful.

import FreeCAD as App
import Part

doc = App.newDocument()
mesh = doc.addObject("Mesh::Cube", "Mesh")
mesh.recompute()

solid = doc.addObject("Part::Feature", "Shape")
shape = Part.Shape()
shape.makeShapeFromMesh(mesh.Mesh.Topology, 0.1)

solid.Shape = shape
solid.Placement.Base = App.Vector(15, 0, 0)
solid.purgeTouched()
doc.recompute()