Manuale:Gli oggetti Parametrici

From FreeCAD Documentation
Revision as of 21:28, 30 July 2016 by Renatorivo (talk | contribs) (Created page with "'''Approfondimenti'''")

FreeCAD è stato progettato per la modellazione parametrica. Ciò significa che la geometria che si crea, invece di essere liberamente modellabile, è prodotta da regole e parametri. Ad esempio, un cilindro può essere prodotto da raggio e altezza. Con questi due parametri, il programma ha informazioni sufficienti per realizzare il cilindro.

Gli oggetti parametrici, in FreeCAD, sono in realtà delle piccole parti di un programma che viene eseguito ogni volta che uno dei parametri viene modificato. Gli oggetti possono avere un sacco di parametri di diversi tipi: numeri (interi come 1, 2, 3 o valori in virgola mobile come 3,1416), dimensioni reali (1 mm, 2,4 m, 4.5 ft), coordinate (x, y, z), stringhe di testo ("ciao!") o anche un altro oggetto.

Questo ultimo tipo permette di costruire rapidamente complesse catene di operazioni, basando ogni nuovo oggetto su uno precedente, e aggiungendo ad esso delle nuove funzioni.

Nell'esempio sottostante, un oggetto cubico solido (Pad) si basa su una forma 2D rettangolare (Schizzo) e ha una distanza di estrusione. Con queste due proprietà, produce una forma solida estrudendo la forma di base alla distanza determinata. È quindi possibile utilizzare questo oggetto come base per ulteriori operazioni, come ad esempio il disegno di una nuova forma 2D su una delle sue facce (Sketch001) e poi fare una sottrazione (tasca), fino ad arrivare all'oggetto finale.

Tutte le operazioni di intermedie (forme 2D, pad, tasche, ecc) sono ancora lì, e si può ancora cambiare qualsiasi dei loro parametri in qualsiasi momento. Se è necessario, viene ricostruita l'intera catena (ricalcolata) .

Due cose importanti che è necessario sapere:

  1. Recomputation is not always automatic. Heavy operations, that might modify a big portion of your document, and therefore take some time, are not performed automatically. Instead, the object (and all the objects that depend on it) will be marked for recomputation (a small blue icon appears on them in the tree view). You must then press the recompute button to have all the marked objects recomputed.
  2. The dependency tree must always flow in the same direction. Loops are forbidden. You can have object A which depends on object B which depend on object C. But you cannot have object A which depends on object B which depends on object A. That would be a circular dependency. However, you can have many objects that depend on the same object, for example objects B and C both depend on A. Menu Tools -> Dependency graph shows you a dependency diagram like on the image above. It can be useful to detect problems.

Not all objects are parametric in FreeCAD. Often, the geometry that you import from other files won't contain any parameter, and will be simple, non-parametric objects. However, these can often be used as a base, or starting point for newly created parametric objects, depending, of course, on what the parametric object requires and the quality of the imported geometry.

All objects, however, parametric or not, will have a couple of basic parameters, such as a Name, which is unique in the document and cannot be edited, a Label, which is a user-defined name that can be edited, and a placement, which holds its position in the 3D space.

Finally, it is worth noting that custom parametric objects are easy to program in python.

Approfondimenti