Manuale:Modellazione per la progettazione del prodotto

From FreeCAD Documentation
Revision as of 21:47, 7 September 2016 by Renatorivo (talk | contribs) (Created page with "* Il modello prodotto nel corso di questo esercizio: https://github.com/yorikvanhavre/FreeCAD-manual/blob/master/files/lego.FCStd")


Product design è in origine un termine commerciale, ma nel mondo 3D, significa spesso modellazione di qualcosa con l'idea di stamparlo in 3D o, più in generale, prodotto da una macchina, con una stampante 3D o con una macchina CNC.

Quando si stampano oggetti in 3D, è di fondamentale importanza che gli oggetti siano dei solidi. Dato che diventeranno reali, oggetti solidi, questo è ovvio. Naturalmente nulla impedisce che essi siano vuoti internamente. Ma è sempre necessario sapere esattamente quale punto è all'interno del materiale, e quale punto è al di fuori, perché la stampante 3D o la macchina CNC deve sapere esattamente cosa è riempito di materiale e cosa non lo è. In FreeCAD, l'ambiente PartDesign è lo strumento perfetto per costruire questi pezzi, perché si prende sempre cura che gli oggetti rimangono solidi e costruibili.

Per illustrare come funziona l'ambiente PartDesign, cerchiamo di modellare questo pezzo ben noto di Lego:

La cosa bella con i pezzi Lego è che le dimensioni sono facili da reperire su Internet, almeno per i pezzi standard. Questi sono abbastanza facili da modellare e da stampare in 3D, e con un po' di pazienza (la stampa 3D richiede spesso molte regolazioni di messa a punto) si possono fare pezzi che sono totalmente compatibili e che si incastrano perfettamente nei blocchi Lego originali. Nell'esempio seguente, faremo un pezzo che è 1,5 volte più grande di quello originale.

Ora useremo esclusivamente strumenti di Sketcher e PartDesign. Dato che tutti gli strumenti dell'ambiente Sketcher sono inclusi anche nell'ambiente PartDesign, possiamo stare in PartDesign e non avremo bisogno di passare avanti e indietro tra i due.

Gli oggetti di Part Design sono completamente basati su Schizzi. Uno Schizzo è un oggetto 2D, fatto di segmenti lineari (linee, archi di cerchio o ellissi) e di vincoli. I vincoli possono essere applicati sia sui segmenti lineari sia sui loro punti finali o centrali, e costringono la geometria ad adottare determinate regole. Ad esempio, è possibile inserire un vincolo verticale su un segmento di linea per costringerlo a rimanere in verticale, o applicare un vincolo di posizione (blocco) su un punto finale per impedirgli di muoversi. Quando uno schizzo ha una giusta quantità di vincoli che impedisce a qualsiasi punto del disegno di spostarsi, si parla di uno schizzo completamente vincolato. Quando ci sono dei vincoli ridondanti, che possono essere rimossi senza consentire alla geometria da spostarsi, si parla di geometria sovravincolata. Questo deve essere evitato, e, se succede, FreeCAD lo comunica.

Gli Schizzi hanno una modalità di modifica, in cui la loro geometria e i loro vincoli possono essere cambiati. Quando si ha finito con le modifiche, e si esce dalla modalità di modifica, gli schizzi si comportano come qualsiasi altro oggetto FreeCAD, e possono essere utilizzati come elementi di base per tutti gli strumenti di PartDesign, ma anche in altri banchi di lavoro, come ad esempio Parte o Arch. Draft ha anche uno strumento che converte gli oggetti di Draft in schizzi, e viceversa.

  • Cominciamo modellando una forma cubica che sarà la base del nostro mattoncino Lego. Successivamente intaglieremo l'interno, e vi aggiungeremo le 8 bugne. Quindi cominciamo questo facendo uno schizzo rettangolare che ci sarà poi estruso:
  • Passare nell'ambiente PartDesign
  • Cliccare sul pulsante Nuovo Schizzo. Appare una finestra di dialogo che chiede dove si vuole posizionare il disegno, scegliere il pianoXY, che è il piano "terra". Viene creato il disegno e viene immediatamente commutato in modalità di modifica, e la vista viene ruotata in modo che il disegno sia ortogonale all'osservatore.
  • Ora si può disegnare un rettangolo, selezionando lo strumento Rettangolo e cliccando 2 punti d'angolo opposti. È possibile inserire i due punti dove si vuole, dato che la loro posizione corretta verrà impostata nel passaggio successivo.
  • Notare che al rettangolo sono stati automaticamente aggiunti alcuni vincoli: i segmenti verticali hanno ricevuto un vincolo verticale, quelle orizzontali un vincolo orizzontale, e ogni angolo un vincolo di punto-a-punto che incolla insieme i segmenti. Si può sperimentare lo spostamento del rettangolo trascinando le sue linee con il mouse, tutta la geometria si manterrà fedele ai vincoli.

  • Ora, aggiungiamo altri tre vincoli:
    • Selezionare uno dei segmenti verticali e aggiungere un vincolo distanza verticale. Dategli una dimensione di 23.7mm.
    • Selezionare uno dei segmenti orizzontali e aggiungere un vincolo distanza orizzontale. Dategli una dimensione di 47.7mm.
    • Infine, selezionare uno dei punti d'angolo, quindi il punto di origine (che è il punto di incrocio degli assi rosso e verde), quindi aggiungere un vincolo punto su punto. Il rettangolo salta al punto di origine, e lo schizzo diventa verde, il che significa che ora è completamente vincolato. Si può provare a spostare le sue linee o punti, ma nulla può più muoversi.

Notare che l'ultimo vincolo punto-su-punto non era assolutamente necessario. Non si è mai costretti a lavorare con schizzi completamente vincolati. Tuttavia, se vogliamo stampare questo blocco in 3D, è necessario mantenere il pezzo vicino al punto di origine (che è il centro dello spazio in cui la testina di stampa può muoversi). Con l'aggiunta di quel vincolo siamo certi che il pezzo rimarra sempre "ancorato" al punto di origine.

  • Lo schizzo di base è pronto, possiamo lasciare la modalità di modifica premendo il pulsante Chiudi sulla parte superiore del pannello Azioni, o semplicemente premendo il tasto Esc. Se necessario in seguito, siamo in grado di rientrare in modalità di modifica in qualsiasi momento facendo doppio clic sullo schizzo nella vista ad albero.
  • Facciamo estrudere lo schizzo utilizzando lo strumento Pad, e dandogli una distanza di 14,4 mm. Le altre opzioni possono essere lasciate ai loro valori di default:

Il Pad si comporta in modo molto simile allo strumento Estrusione che abbiamo usato nel capitolo precedente. Ci sono, però, un paio di differenze, e la principale è che un pad non può essere spostato, esso è sempre collegato al suo schizzo. Se si vuole cambiare la posizione del pad, è necessario spostare il disegno di base. Nel contesto attuale, in cui vogliamo essere sicuri che nulla si muova dalla sua posizione, si tratta di una sicurezza aggiuntiva.

  • Ora intagliamo l'interno del blocco, utilizzando lo strumento Tasca, che è la versione PartDesign di Parte Taglia. Per effettuare una tasca, creiamo uno schizzo sulla faccia inferiore del blocco, che sarà utilizzato per rimuovere una parte del blocco.
  • Con la faccia inferiore selezionata, premere il pulsante Nuovo schizzo.
  • Disegnare un rettangolo sulla faccia.

  • Ora vincoliamo il rettangolo in relazione alla faccia inferiore. Per fare questo, bisogna "importare" alcuni bordi della faccia con lo strumento Geometria esterna. Utilizzare questo strumento sulle due linee verticali della faccia inferiore:

Notare che con questo strumento possono essere aggiunti solo i bordi dalla faccia di base. Quando si crea uno schizzo con una faccia selezionata, si crea una relazione tra quella faccia e il disegno, che è importante per le successive operazioni. È sempre possibile rimappare in un secondo tempo uno schizzo su un'altra faccia con lo strumento Mappa schizzo.

  • La geometria esterna non è "reale", viene nascosta quando si esce dalla modalità di modifica. Ma è possibile usarla per posizionare i vincoli. Posizionare i seguenti 4 vincoli:
    • Selezionare il punto in alto a sinistra del rettangolo e la linea importata di sinistra e aggiungere un vincolo Distanza orizzontale di 1.8mm
    • Selezionare nuovamente il punto in alto a sinistra del rettangolo e la linea importata di sinistra e aggiungere un vincolo Distanza verticale di 1.8mm
    • Selezionare il punto in basso a destra del rettangolo e la linea importata di destra e aggiungere un vincolo Distanza orizzontale di 1.8mm
    • Selezionare nuovamente il punto in basso a destra del rettangolo e la linea importata di destra e aggiungere un vincolo Distanza verticale di 1.8mm

  • Uscire dalla modalità di modifica. Ora si può eseguire l'operazione di tasca: con il disegno selezionato, premere il pulsante Pocket. Assegnargli una lunghezza di 12.6mm, che lascia alla faccia superiore del pad lo spessore di 1.8mm (ricordare che l'altezza totale del pad è di 14.4mm).

  • We will now attack the 8 dots on the top face. To do this, since they are a repetition of a same feature, we will use the handy Linear pattern tool of the Part Design Workbench, which allows to model once and repeat the shape.
  • Start by selecting the top face of our block
  • Create a New sketch.
  • Create two circles.
  • For each circle, select it and add a Radius Constraint of 3.6mm to each of them
  • Import the left edge of the base face with the External geometry tool.
  • Place two vertical constraints and two horizontal constraints of 6mm between the center point of each circle and the corner points of the imported edge, so each circle has its center at 6mm from the border of the face:

  • Notice how, once again, when you lock the position and dimension of everything in your sketch, it becomes fully constrained. This always keeps you on the safe side. You could change the first sketch now, everything we did afterwards would keep tight.
  • Leave edit mode, select this new sketch, and create a Pad of 2.7mm:

  • Notice that, as earlier with the pocket, since we used the top face of our base block as a base for this latest sketch, any PartDesign operation we do with this sketch will correctly be built on top of the base shape: The two dots are not independent objects, they have been extruded directly from our brick. This is the great advantage of working with the Part Design Workbench, as long as you take care of always building one step on top of the previous one, you are actually building one final solid object.
  • We can now duplicate our two dots four times, so we get eight. Select the latest Pad we just created.
  • Press the Linear pattern button.
  • Give it a length of 36mm (which is the total "span" we want our copies to fit in), in the "horizontal sketch axis" direction, and make it 4 occurences:

  • Once again, see that this is not just a duplication of an object, it is a *feature* of our shape that has been duplicated, the final object is still only one solid object.
  • Now let's work on the three "tubes" that fill the void we created on the bottom face. We have several possibilities: create a sketch with three circles, pad it then pocket it three times, or create a base sketch with one circle inside the other and pad it to form the complete tube already, or even other combinations. Like always in FreeCAD, there are many ways to achieve a same result. Sometimes one way will not work the way we want, and we must try other ways. Here, we will take the safest approach, and do things one step at a time.
  • Select the face that is at the bottom of the hollow space we carved earlier inside the block.
  • Create a new sketch, add a circle with a radius of 4.8825mm, import the left border of the face, and constrain it vertically and horizontally at 10.2mm from the upper corner of the face:

  • Leave edit mode, and pad this sketch with a distance of 12.6mm
  • Create a linear pattern from this last pad, give it a length of 24mm and 3 occurences. We now have three filled tubes filling the hollow space:

  • Now let's make the final holes. Select the circular face of the first of our three "pins"
  • Create a new sketch, import the circular border of our face, create a circle with a radius constraint of 3.6mm, and add a Point on Point Constraint between the center of the imported circle and our new circle. We now have a perfectly centered circle,and once again fully constrained:

  • Leave edit mode, and create a pocket from this sketch, with a length of 12.6mm
  • Create a linear pattern from this pocket, with a length of 24mm and 3 occurences. That's the last step, our piece of lego is now complete, we can give it a nice color of Victory!

You will notice that our modeling history (what appears in the tree view) has become quite long. This is precious because every single step of what we did can be changed later on. Adapting this model for another kind of brick, for example one with 2x2 dots, instead of 2x4, would be a piece of cake, we would just need to change a couple of dimensions and the number of occurences in linear patterns. We could as easily create bigger pieces that don't exist in the original Lego game.

But we could also need to get rid of the history, for example if we are going to model a castle with this brick, and we don't want to have this whole history repeated 500 times in our file.

There are two simple ways to get rid of the history, one is using the Create simple copy tool from the Part Workbench, which will create a copy of our piece that doesn't depend anymore on the history (you can delete the whole history afterwards), the other way is exporting the piece as a STEP file and reimporting it.

Assembling

But the best of both worlds also exists, which is the Assembly2 Workbench, an addon that can be installed from the FreeCAD-addons repository. This Workbench is named "2" because there is also an official built-in Assembly Workbench in development, which is not ready yet. The Assembly2 Workbench, however, already works very well to construct assemblies, and also features a couple of object-to-object constraints which you can use to constrain the position of one object in relation to another. In the example below, however, it will be quicker and easier to position the pieces using Draft Move and Draft Rotate than using the Assembly2 constraints.

  • Save the file we did until now
  • Install the Assembly2 Workbench and restart FreeCAD
  • Create a new empty document
  • Switch to the Assembly2 workbench
  • Press the Import a part from another FreeCAD document button
  • Select the file we saved above
  • The final piece will be imported in the current document. The Assembly2 workbench will determine automatically what is the final piece in our file that needs to be used, and the new object stays linked to the file. If we go back and modify the contents of the first file, we can press the Update parts imported into the assembly button to update the pieces here.
  • By using the Import a part from another FreeCAD document button several times, and moving and rotating the pieces (with the Draft tools or by manipulating their Placement property), we can quickly create a small assembly:

Download

Approfondimenti