Part: Affetta in parti

From FreeCAD Documentation
Revision as of 08:56, 10 May 2019 by Renatorivo (talk | contribs)

Affetta una parte

Posizione nel menu
Part → Dividi → Affetta una parte
Ambiente
Part
Avvio veloce
Nessuno
Introdotto nella versione
0.18.15506
Vedere anche
Affetta, Esplodi il composto

Descrizione

Strumento per dividere le forme per intersezione con altre forme. Ad esempio, per un cubo e un piano, vengono creati due solidi.

Nella figura sopra, i pezzi sono stati separati manualmente dopo l'operazione, per rendere visibili le singole parti.

Affetta una parte è uguale a Affetta seguito da Esplodi il composto. Mentre "Slice to compound" è completamente parametrico e non crea problemi mentre il numero di pezzi cambia, "Affetta una parte" non aggiorna il numero di oggetti quando il numero di pezzi cambia. Entrambi creano la funzione parametrica Slice, che mette i pezzi tagliati in un composto, ma "Affetta una parte" esplode il composto risultante in oggetti separati.

Le forme di uscita occupano lo stesso spazio dell'originale. Ma sono divise dove si intersecano con altre forme. I pezzi divisi sono pezzi individuali.


Per ulteriori informazioni, visitare la pagina Affetta.

Struttura ad albero di Affetta una parte

Il comando Affetta una parte crea più di un solo oggetto affettato. Nell'esempio seguente un cubo viene affettato da una faccia.

The slice is created and for each piece of it there is a Part CompoundFilter created, thus the same slice occurs multiple times below each CompundFilter. All these CompoundFilters are united in a Compound.


Example: making puzzle

See Part Slice Example Steps 1 to 6


Scripting

The tool can by used in macros and from the python console by using the following function:

BOPTools.SplitFeatures.makeSlice(name)

Set mode to split for slice apart

  • Creates an empty Slice feature. The 'Base' and 'Tools' properties must be assigned explicitly, afterwards.
  • Returns the newly created object.

Slice can also be applied to plain shapes, without the need to have a document object, via:

BOPTools.SplitAPI.slice(base_shape, tool_shapes, mode, tolerance = 0.0)

This can be useful for making custom Python scripted features.


Example:

import BOPTools.SplitFeatures
j = BOPTools.SplitFeatures.makeSlice(name= 'Slice')
j.Base = FreeCADGui.Selection.getSelection()[0]
j.Tools = FreeCADGui.Selection.getSelection()[1:]

The tool itself is implemented in Python, see /Mod/Part/BOPTools/SplitFeatures.py under where FreeCAD is installed.

Version

Slice Apart was introduced in FreeCAD v0.18.15506. FreeCAD needs to be compiled with OCC 6.9.0 or later; otherwise, the tool is unavailable.