Corpo di PartDesign

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

Corpo

Posizione nel menu
Part Design → Crea un corpo
Ambiente
PartDesign
Avvio veloce
Nessuno
Introdotto nella versione
0.17
Vedere anche
Parte standard, Editazione delle funzioni

Descrizione

Un Corpo di PartDesign è l'elemento base per creare forme solide con PartDesign. Può contenere schizzi, oggetti di riferimento e funzioni di PartDesign che aiutano a produrre un singolo solido contiguo.

Il Corpo fornisce un oggetto Origin che include gli assi X,Y,Z, e i piani standard. Questi elementi possono essere usati come riferimenti per collegare gli schizzi e gli oggetti primitivi.

Poiché si suppone che il Corpo sia un singolo solido contiguo, esso può essere spostato interamente come un'unità, senza spostare le singole funzioni. All'interno di una Parte standard è possibile posizionare più corpi per creare assiemi.

A sinistra: la vista ad albero che mostra le funzioni che producono in sequenza la forma finale dell'oggetto. A destra: l'oggetto finale visibile nella vista 3D.

Utilizzo

Se non è stato selezionato alcun solido precedente:

  1. Premere il pulsante Corpo. Viene creato un corpo vuoto che diventa automaticamente attivo.
  2. Ora si può premere Nuovo schizzo per creare uno schizzo nel corpo. In seguito lo schizzo può essere utilizzato per creare una Estrusione.
  3. In alternativa, si può aggiungere una funzione di PartDesign primitiva, ad esempio un Cubo additivo.

Se viene selezionato un oggetto solido:

  1. Premere il pulsante Corpo. Viene creato un nuovo Corpo contenente una singola Base Feature. Questo elemento Base Feature è un semplice riferimento a un altro oggetto precedentemente creato o importato nel documento. Per maggiori informazioni vedere Funzione di base. Non è possibile selezionare un Corpo esistente o una funzione di PartDesign quando si preme Corpo.

Note

  • Se, quando si preme il pulsante Nuovo schizzo della barra degli strumenti di PartDesign non esiste ancora un corpo, ne viene creato automaticamente uno nuovo. Se esiste già un corpo, esso deve essere reso attivo prima di usare Nuovo schizzo.
  • Fare doppio clic su Corpo nella vista ad albero o aprire il menu di scelta rapida (clic con il tasto destro) e selezionare Attiva corpo per attivare o disattivare il corpo. Se un altro corpo è attivo, esso viene disattivato. Per maggiori informazioni vedere Stato attivo.

Proprietà

Un Corpo di PartDesign (classe PartDesign::Body) è derivato da una Part Feature (classe Part::Feature), pertanto condivide tutte le proprietà di quest'ultimo.

Oltre alle proprietà descritte in Part Feature, il corpo di PartDesign ha le seguenti proprietà nell'editor delle proprietà.

Dati

Base

  • DatiTip: è la funzione di PartDesign definita come "funzione finale", che è in genere l'ultima funzione creata nel corpo. La funzione finale indica la forma finale del corpo, che viene mostrata nella Vista 3D quando VistaDisplay Mode Body è impostata su Tip. Per maggiori informazioni vedere Tip.
  • DatiBase Feature: è una forma esterna usata come prima funzione di PartDesign nel Corpo. Di solito viene impostata quando si trascina un oggetto solido in un corpo vuoto. Se non viene importato nessun solido in questo modo, questa proprietà rimane vuota. Per maggiori informazioni vedere Funzione di base.
  • DatiGroup: un elenco di funzioni di PartDesign nel Corpo
  • DatiPlacement: la posizione dell'oggetto nella Vista 3D. Il posizionamento è definito da un punto Base (vettore) e una Rotation (asse e angolo). Vedere Posizionamento.

Hidden properties Data

  • DatiOrigin (Link): the App Origin object that is the positional reference for all elements listed in DatiGroup.
  • Dati_ Group Touched (Bool): whether the group is touched or not.

Also the hidden properties described in Part Feature.

Vista

Base

  • VistaDisplay Mode Body (Enumeration): sets the display mode specifically for the Body with one of two types.
    • Through (default) exposes all objects inside the Body, that is, sketches, PartDesign Features, datum objects, etc. This mode allows visualizing partial operations done inside the Body, and thus it is the recommended mode when adding and editing features. Select the specific feature, and the set VistaVisibility to true or press the Space bar on the keyboard.
    • Tip exposes only the final shape of the Body, which is defined by the DatiTip property. Everything else, including sketches, partial features, datums, etc., is not displayed, even if they are visible in the tree view. This mode is recommended when the Body does not need to be modified further, so a fixed shape is shown. This mode is also recommended when you wish to select the sub-elements (vertices, edges, and faces) of the final shape to use with other workbenches' tools.

Concetto di Corpo

Singolo solido contiguo

A PartDesign Body is intended to model a single contiguous solid. The meaning of "contiguous" is an element made in one piece, with no moving parts, or disconnected solids. Examples of contiguous solids are those that are manufactured from a single piece of raw material by a process of casting, cutting, or milling. For example, a nut, a washer, and a bolt each consists of a single solid piece of steel with no moving parts, so each can be modelled by a PartDesign Body. Objects that are created by welding two pieces can also be modelled by a single Body as long as the weld joint is not intended to break apart.

Once these contiguous solids are put together in some type of arrangement, then they become an "assembly". In an assembly, the objects are not fused together, but they are simply "stacked" or placed next to each other, and remain individual parts.

A sinistra: tre solidi contigui individuali, ciascuno modellato in un Corpo di PartDesign. A destra: i singoli Corpi riuniti in un'assemblaggio.

Feature editing

A PartDesign Body is intended to work by creating an initial solid, either from a sketch or from a primitive shape, and then modifying it through "features" to add or remove material from the previous shape. For a full explanation go to feature editing.

A PartDesign Body will perform an automatic fusion (union) of the solid elements inside of it. This means that (1) partial solids should be touching when created, and (2) disconnected solids are not allowed.

Left: two individual solids that intersect each other. Right: a single PartDesign Body with two additive features; they are automatically fused together, so instead of intersecting, they form a single contiguous solid.

Left: two disconnected solids; this isn't a valid PartDesign Body. Right: two touching solids; this results in a valid PartDesign Body. The newer feature should always contact or intersect the previous feature so that it is fused to it, and becomes a single contiguous solid.

Note: other CAD programs like Catia allow discontiguous solids in the same "Body". As of v0.19, FreeCAD does not allow this. There has been discussions in the FreeCAD forum about lifting this restriction but no concrete decision has been made. If you'd like to know more or present different points of view, please discuss in the forum.

Detailed explanation of the properties

Stato attivo

Un documento aperto può contenere più corpi. Per aggiungere una nuova funzione a un corpo specifico, è necessario renderlo attivo. Un corpo attivo vinene visualizzato nella vista ad albero con il colore di sfondo specificato dal valore Active container nell'editor delle preferenze (per impostazione predefinita, blu). Un corpo attivo viene anche mostrato in grassetto.

To activate or de-activate a Body:

  • Double click on it on the tree view, or
  • Open the context menu (right click) and select Toggle active body.

L'attivazione di un corpo commuta automaticamente anche l'interfaccia nell'ambiente PartDesign, se questo non era già l'ambiente attivo. Può essere attivo solo un singolo corpo per volta.

Document with two PartDesign Bodies, of which the second one is active.

Origine

The Origin consists of the three standard axes (X, Y, Z) and three standard planes (XY, XZ and YZ). Sketches and other objects can be attached to these elements when creating them.

  1. Create the Body.
  2. If the Body is selected in the tree view, press New sketch; the task panel will open to allow selecting one of the planes.
  3. If the Body is not selected, select the Origin instead and make it visible in the 3D view by pressing the Space bar in the keyboard. Also expand the Origin object to see the axes and planes.
  4. Select one of the planes, either in the tree view or in the 3D view, then press New sketch. The sketch will be created on the chosen plane.

The same process can be used when creating auxiliary datum geometry like PartDesign Lines, PartDesign Planes, and PartDesign CoordinateSystems.

Note: the Origin is an App Origin object (App::Origin class), while the axes and planes are objects of type App::Line and App::Plane respectively. Each of these elements can be hidden and unhidden individually with the Space bar; this is useful to choose the correct reference when creating other objects.

Note 2: all elements inside the Body are referenced to the Body's Origin which means that the Body can be moved and rotated in reference to the global coordinate system without affecting the placement of the elements inside.

Left: PartDesign Body Origin in the tree view. Right: representation of the Origin elements in the 3D view.

Funzione di base

La Funzione di base, Base feature, è la prima Funzione PartDesign creata nel corpo quando il corpo si basa su un'altra forma solida. Questo solido può essere creato in qualsiasi ambiente di lavoro o importato da un file esterno, ad esempio un file STEP.

PartDesign Bodies, each of them with a single Base Feature, which are taken from previously created solids.

To create the Base Feature:

  1. select a solid shape external to any Body, and
  2. press Body; this will create a new Body with a single Base Feature.

Note: you can't select an existing Body, or any of its features, when pressing Body.

If you already have a Body, you can create the Base Feature in this way:

  • in the tree view, pick an object, and drag and drop it inside the Body, or
  • in the property editor, edit the value of DatiBase Feature by pressing the ellipsis ..., and choosing an object from the list. In this case you can choose an existing Body to be the Base Feature.

Note: dragging and dropping only works for Bodies which don't have a Base Feature already.

Note 2: if the Body already has several features, when you drag and drop the external solid, the Base Feature will be created at the beginning of the list of features, that is, it will be added to the beginning of the DatiGroup property.

The Base Feature is entirely optional; it is only present when including an object from outside the Body. If no external solid is included, you can still build your shape using sketches, pads, primitive objects, and other PartDesign Features. In this case the DatiBase Feature property remains empty.

Left: PartDesign Body with a Base Feature that is taken from an external solid object, and many subsequent PartDesign Features on top. Right: Body which doesn't have an explicit Base Feature.

Tip

La cima o punta (Tip) è la PartDesign Feature del corpo che viene esposta all'esterno (quello che si vede). Viene automaticamente impostata sull'ultima funzione nella parte inferiore dell'albero; vale a dire che, se un altro strumento da qualsiasi ambiente di lavoro (ad esempio, Copia semplice o Sottrai di Part) deve utilizzare la forma del corpo, utilizzerà la forma della Punta. Detto in altro modo, la Punta è la rappresentazione finale del Corpo come se la storia parametrica non esistesse.

Left: PartDesign Body with full parametric history including intermediate features. Right: the Tip is the final shape that can be exported from the Body, while omitting the model's history.

The Tip is automatically set to the last feature created in the Body. Nevertheless, it can also be set to any of the intermediate features by opening the tree view context menu (right-click) and choosing Set tip, or by changing the Body's DatiTip value in the property editor.

Changing the Tip in effect rolls back its history, making it possible to add features that should have been added earlier. It also exposes a different shape to external tools.

Nella vista ad albero, la funzione finale del corpo è riconoscibile dalla funzione di PartDesign che ha una icona sovrapposta costituita da una freccia bianca all'interno di un cerchio verde.

Two PartDesign Bodies, each of them with PartDesign Features. The Tip is the last feature in them, and is marked with an overlay symbol.

Interazione con gli altri ambienti di lavoro

Per impostazione predefinita, gli oggetti sottostanti ad un Corpo sono selezionabili, e ovviamente ciò è necessario per poter modificare e aggiungere delle funzioni in PartDesign. Ma si sconsiglia di selezionare le funzioni di un corpo per creare operazioni con altri ambienti (come Part o Draft) in quanto i risultati potrebbero essere inaspettati; in questi casi, nella finestra Report, appare l'errore Links go out of the allowed scope.

Pertanto, per le interazioni con gli altri workbench, dovrebbe essere selezionato solo il Corpo stesso dall'albero del modello. Nei casi in cui è necessario selezionare una topologia specifica sul Corpo (vertice, bordo, faccia), allora la proprietà vista Display Mode Body del Corpo può essere modificata da Through (impostazione predefinita) a Tip. Questa proprietà è accessibile dal pannello Vista. In modalità Tip l'accesso agli oggetti sottostanti al Corpo (funzioni, riferimenti, schizzi) è disabilitato; nella vista 3D viene nascosto tutto tranne la funzione tip, indipendentemente da quale oggetto è impostato come visibile.

Una volta completate le operazioni in altri workbench, non dimenticare di ripristinare la proprietà Display Mode Body in Through per essere di nuovo in grado di modificare il corpo.

Left: when "Display Mode Body" is set to Through it is possible to select and perform operations with the individual PartDesign Features; in general, this is not recommended. Right: when "Display Mode Body" is set to Tip all selections and operations done on the Body will be done on the Tip, making sure only the final shape of the Body is exposed.

Gestione della visibilità

La visibilità del corpo prevale sulla visibilità di qualsiasi oggetto in esso contenuto. Se il corpo è nascosto, sono nascosti anche gli oggetti che esso contiene, anche se la loro visibilità è impostata su true. Può essere visibile una sola funzione per volta. Selezionare una funzione nascosta e premere la barra spaziatrice per renderla visibile e nascondere automaticamente la funzione precedentemente visibile.

Multiple Sketches may be visible at one time, but only one PartDesign Feature (solid result) can be visible at a time. Selecting a hidden feature and pressing the Space bar in the keyboard will make it visible, and automatically hide the previously visible feature.

PartDesign Body: multiple Sketches may be visible simultaneously, but only one solid PartDesign Feature may be visible at one time, whether it is the Tip or not.

Attachment

PartDesign Features, just like planar objects, can be attached to different planes, usually the standard planes defined by the Body's Origin, or to custom PartDesign Planes.

Sketches are normally attached to a plane when they are created. In similar way, primitive features can also be attached. Attaching these objects to a plane allows them to be moved within the Body by changing their DatiAttachment Offset property. For more information on the attachment modes see Part Attachment.

A PartDesign Feature that is not attached will be shown with a red overlay symbol next to their icon in the tree view.

PartDesign Body: PartDesign Features that are not attached to a plane or coordinate system will be shown with an overlay symbol next to their icon in the tree view.

Inheritance

A PartDesign Body is formally an instance of the class PartDesign::Body, whose parent is Part Feature (Part::Feature class) through the intermediate Part::BodyBase class, and is augmented with an Origin extension.

Simplified diagram of the relationships between the core objects in the program. The PartDesign::Body object is intended to build parametric 3D solids, and thus is derived from the basic Part::Feature object, and has an Origin to control the placement of the features used inside of it.

Script

Vedere anche: Script di base per FreeCAD, e script di oggetti.

Vedere Part Feature per le informazioni generali.

Un corpo PartDesign viene creato con il metodo addObject() del documento. Quando esiste un corpo, ad esso possono essere aggiunte e associate le funzioni primitive additive e sottrattive.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("PartDesign::Body", "Body")
obj.Label = "Custom label"

feat1 = App.ActiveDocument.addObject("PartDesign::AdditiveBox", "Box")
feat2 = App.ActiveDocument.addObject("PartDesign::AdditiveCylinder", "Cylinder")

obj.addObjects([feat1, feat2])
App.ActiveDocument.recompute()

In a document that has many Bodies, the active Body can be set using the setActiveObject method of the ActiveView. The first argument is the fixed string "pdbody", and the second argument is the Body object that should be made active.

import FreeCAD as App
import FreeCADGui as Gui

doc = App.newDocument()
obj1 = App.ActiveDocument.addObject("PartDesign::Body", "Body")
obj2 = App.ActiveDocument.addObject("PartDesign::Body", "Body")

Gui.ActiveDocument.ActiveView.setActiveObject("pdbody", obj1)
App.ActiveDocument.recompute()