A2plus Workbench/it

Introduzione
A2plus è un ambiente esterno per assemblare parti differenti in FreeCAD.

Questa documentazione descrive la versione A2plus 0.4.17 o più recente.

Installazione
L'ambiente A2plus è un componente aggiuntivo di FreeCAD. Può essere facilmente installato tramite il menu. A2plus è in sviluppo attivo e riceve frequentemente nuove funzioni. Pertanto si dovrebbe aggiornarlo regolarmente usando sempre il menu. Il codice A2plus è ospitato e sviluppato in su GitHub e può anche essere installato manualmente copiandolo nella directory MOD di FreeCAD.

Per iniziare
Passare sulla barra degli strumenti di A2plus in FreeCAD. Per creare un assieme, creare un nuovo file. All'inizio questo file deve essere salvato. Si consiglia (ma non è necessario) di salvarlo nella stessa cartella delle parti che si desidera assemblare.

Ora è possibile aggiungere parti all'assieme utilizzando il pulsante della barra degli strumenti. La prima parte aggiunta ottiene una posizione fissa per impostazione predefinita. (in seguito è possibile modificare questo tramite la proprietà della parte .) Le parti già presenti nell'assieme possono essere clonate con il pulsante della barra degli strumenti. Per modificare una parte dall'assieme, selezionarla nell'albero del modello e utilizzare il pulsante della barra degli strumenti. Questo apre la parte in una nuova scheda in FreeCAD o passa alla sua scheda se il file è già aperto. Per importare le modifiche nelle parti nell'assieme fai clic sul pulsante della barra degli strumenti.

Le parti importate mantengono le loro dipendenze esterne e possono essere modificate. Per parti ben definite, come le viti, è comunque utile che la loro forma non possa essere modificata. Questo può essere ottenuto con il pulsante della barra degli strumenti che converte la parte selezionata in una copia statica della parte originale.

Per salvare l'assemblaggio e in seguito chiuderlo, è possibile utilizzare il pulsante della barra degli strumenti.

Assemblaggio
L'assemblaggio delle parti viene effettuato aggiungendo dei vincoli tra le parti. Dopo l'applicazione di un vincolo, A2plus sposta le parti in base al vincolo, se possibile. Per i vincoli complessi tra le parti A2plus potrebbe non riuscire a risolvere i vincoli. Pertanto, dare un'occhiata anche alla sezione Risoluzione dei problemi per le strategie su come risolvere tali casi.

I vincoli tra le parti vengono aggiunti mantenendo premuto il tasto e selezionando un bordo o una faccia di due parti. Il vincolo viene aggiunto allegato nell'albero del modello alle parti interessate.

Vista dell'insieme
Più parti si aggiungono, più è importante mantenere la visione d'insieme. A2plus offre quindi questi strumenti per spostare e visualizzare le parti:


 * Per spostare una parte nell'assieme, selezionarla nell'albero del modello e utilizzare il pulsante [[Image:A2p MovePart.svg|24px]]. Quando la parte è posizionato dove si desidera, fare clic con il tasto sinistro del mouse. Se la parte spostata ha già dei vincoli, la parte viene posizionata di conseguenza premendo il pulsante [[Image:A2p solver.svg|24px]] perché questo innesca la risoluzione di tutti i vincoli dell'assieme.
 * Per mostrare un vincolo selezionarlo nell'albero del modello e utilizzare il pulsante [[Image:A2p ViewConnection.svg|24px]]. Ciò rende l'intero assemblaggio trasparente e evidenzia i due elementi che sono connessi nel vincolo. Per tornare alla visualizzazione normale, fare clic con il tasto sinistro sull'assieme.
 * Per mostrare solo alcune parti nell'assieme, selezionare queste parti nell'albero del modello e utilizzare il pulsante [[Image:A2p Isolate Element.svg|24px]]. In alternativa si può nascondere una certa parte selezionandola nell'albero del modello e premendo per commutare la sua visibilità.
 * Per attivare la vista trasparenza dell'intero assieme, si può utilizzare il pulsante [[Image:A2p ToggleTransparency.svg|24px]].

Vincoli
Quando si crea un vincolo, dopo aver premuto un pulsante della barra degli strumenti dei vincoli, viene visualizzata questa finestra di dialogo: . Per alcuni vincoli, consente di modificare la direzione del vincolo. Con il pulsante si può verificare in anteprima se questo nuovo vincolo può essere risolto con A2plus. In caso contrario, dare un'occhiata alla sezione Risoluzione dei problemi.

A2plus fornisce i seguenti vincoli:

Punto su punto
Selezionare un vertice (punto) su ciascuna parte. Il pulsante della barra degli strumenti aggiunge il vincolo. Rende i vertici coincidenti.

Punto sul linea
Selezionare un vertice (punto), o bordo circolare (seleziona il suo punto centrale), o una faccia sferica (seleziona anche il suo punto centrale) su una parte e un bordo sull'altra parte. Il pulsante della barra degli strumenti aggiunge il vincolo. Posiziona il vertice sul bordo.

Punto su piano
Selezionare un vertice (punto), o bordo circolare (seleziona il suo punto centrale), o una faccia sferica (seleziona anche il suo punto centrale) su una parte e un piano sull'altra parte. Il pulsante aggiunge il vincolo. La finestra di dialogo dei vincoli consente di specificare uno scostamento tra il punto e il piano. Questo offset può anche essere capovolto su entrambi i lati del piano. Se l'offset è zero, il vincolo posiziona il punto sul piano.

Sfera su sfera
Selezionare una faccia sferica o una vertice (punto) su entrambe le parti. Il pulsante aggiunge il vincolo. Rende il centro delle sfere, o il centro della sfera e il vertice, o i vertici coincidenti.

Bordo circolare sul bordo circolare
Select a circular edge on both parts. The toolbar button adds the constraint. The constraint dialog allows you to specify an offset between the edges. This offset can also be flipped. You can furthermore set the constraint direction and lock the rotation of the parts. If the offset is zero, the constraint will put the edges concentric in the same plane.

Axis Coincident
Select either a cylindrical face or a linear edge on both parts. The toolbar button adds the constraint. The constraint dialog allows you to specify the axis direction. The dialog allows you furthermore to lock the rotation of the parts. The constraint will make the axes or lines coincident.

Axis Parallel
Select either a cylindrical face or a linear edge on both parts. The toolbar button adds the constraint. The constraint dialog allows you to specify the axis direction. The constraint will make the axes or lines parallel.

Axis on Plane
Select either a cylindrical face or a linear edge on one part and a plane on the other part. The toolbar button adds the constraint. The constraint will make the axis or line parallel to the plane.

Plane Parallel
Select a plane on both parts. The toolbar button adds the constraint. The constraint dialog allows you to specify the constraint direction. The constraint will make the planes parallel.

Plane on Plane
Select a plane on both parts. The toolbar button adds the constraint. The constraint dialog allows you to specify a constraint direction and an offset between the planes. This offset can also be flipped. If the offset is zero, the constraint will make the planes coincident.

Plane Angular
Select a plane on both parts. The toolbar button adds the constraint. The constraint dialog allows you to specify an angle between the planes. The constraint will make the planes at first parallel and the set the specified angle.

Coincidence at Center of Mass
Select either a closed edge or a plane on both parts. The toolbar button adds the constraint. The constraint dialog allows you to specify an offset between the edges or planes. This offset can also be flipped. You can furthermore set the constraint direction and lock the rotation of the parts. If the offset is zero, the constraint will put the edges or planes into the same plane.

Subassemblies
An assembly can contain other assemblies. They are added like parts by pressing the toolbar button and selecting a  file containing an assembly. Such subassemblies can also be edited like parts using the toolbar button. Please assure sure for higher assembly stages that you update the assembly via the toolbar button when there were changes.

Constraint Handling
Possible constraints for a selection are displayed in the toolbar and the Constraint Tools dialog by enabling the corresponding buttons. The Constraint Tools dialog is opened via the toolbar button. It is intended to stay open to be able to add quickly several constraints to the assembly.

Existing constraints can be edited by selecting them in the model tree and then either double-clicking on it or using the toolbar button. This opens the Constraint Properties dialog.

Constraints can be deleted either by selecting them in the model tree and pressing or by selecting a part with constraints in the model tree and using the toolbar button.

All constraints can any time be resolved with the toolbar button. If the toolbar button is turned on a resolve is automatically done after every edit of a constraint.

The toolbar button affects the constraint that was added most recently. It flips the constraint direction.

Part Lists
To create part lists of assemblies, the different parts of the assembly must get part info that can be read by A2plus. This is done by editing the part using the toolbar button. In the opened part press the toolbar button and a spreadsheet with the name #PARTINFO# is created.

The structure of the spreadsheet is like this:



Fill out the grey fields with info you have and want to have in the final parts list.

In the assembly or subassembly use the toolbar button. It will ask you if you want to iterate recursively over all subassemblies. Click on Yes. This creates a new spreadsheet with the name #PARTSLIST#. It contains the info from the different #PARSTINFO# spreadsheets of the parts in a list like this:



The position (POS) is automatically set according to the appearance of the parts in the model tree. The top level part will get POS 1. The quantity (QTY) is automatically calculated from the assembly. If a parts is two times in the assembly it will get QTY 2.

If you have updated a part info you can refresh the parts list by pressing the toolbar button again.

For subassemblies you can also create an info spreadsheet using the toolbar button. When you create or update the parts list of the main assembly this info will be used if you click on No for the question if you want to iterate recursively over all subassemblies. Then the different parts are not in the parts list but only the subassemblies.

Assembly Structure
The toolbar button  creates a HTML file with the structure of your assembly. The file will by default be created in the folder of your assembly file. The structure looks like this one:

Degrees of Freedom
The button labels every part of the assembly with their degrees of freedom. Furthermore it outputs a list with all parts and their dependencies. The list is output into FreeCAD's widget Report view. If this widget is currently not visible, it can either be shown by right-clicking into an empty part of the FreeCAD toolbar area and then choosing it in the appearing context menu or with the menu. The degrees of freedom labels can be removed by clicking the button again.

Part Labels
The button labels every part of the assembly in the 3D view with its name. The part labels can be removed by clicking the button again

Shape of whole Assembly
Sometimes it is necessary to have the whole assembly combined as one shape. This shape can then for example be used for 3D printing in the Mesh workbench or for drawings in the TechDraw workbench. It is created using the toolbar button. The shape is by default not made visible. Use the same toolbar button to update the shape in case of changes in the assembly.

Preferences
The a2plus preferences can be accessed via FreeCAD's menu and there in the section A2plus. You can set the following options:

Default solving method

 * Use solving of partial systems The solver begins with a part that has the property set to true and a part constrained to it. All other parts are not calculated. If a solution could be found, the next constrained part is added for the calculation and so on.
 * Use "magnetic" solver, solving all parts at once The solver tries to move all parts at once in direction to a part that has the property set to true. Note that this will in most cases take more time for the calculation of a solution.
 * Force fixed position This sets for all parts in the assembly the property to true. Then no calculation is actually performed since all parts will always be fixed to the positions where they were created.

Default solver behavior

 * Solve automatically if a constraint property is changed The solver will automatically be started. The same as turning on the toolbar button [[Image:A2p ToggleAutoSolve.svg|24px]].

Behavior when updating imported parts

 * Recalculate imported parts before updating them All parts of the assembly, including subassemblies, will be opened in FreeCAD to be reconstructed using values from spreadsheets. This feature is designed to construct fully parametrically. Note: This feature is very experimental and not recommended for important projects. Known problems:
 * The assembly can be destroyed because of wrong references to topological names in parts
 * Master spreadsheets can get broken when they are edited while a referenced part file is already closed. This can crash FreeCAD.


 * Enable recursive update of imported parts Opens all subassemblies recursively to update them.


 * Use experimental topological naming While importing parts to the assembly an algorithm generates topological names for each subelement of the imported shape. The topological names are written into the . When an imported part needs to be updated, these topological names are used to update the subelements of the constraints. So assemblies get more robust against volatile subelement numbers of FreeCAD. Note: This increases file sizes and calculation time during importing of parts. If topological naming should be used it has to be activated before the assembly is created.


 * Inherit per face transparency from parts and subassemblies Use color and transparency settings from imported parts. Note: This feature is very experimental and not recommended for important projects.


 * Do not import invisible shapes This will hide invisible datum/construction shapes. Note: No constraints must be connected to datum/construction shapes in higher or other subassemblies. Otherwise you can break the assembly.


 * Use solid union for importing parts and subassemblies All imported parts will directly be put together as union.  This feature is useful for for FEM simulations or 3D-printing if only one solid is allowed. The alternative is to create later a shape of the whole assembly.

User interface settings

 * Show constraints in toolbar If this option is not used, the toolbar buttons for the different constraints are not visible to save space in the toolbar. New constraints can still be set using the Constraint Tools dialog (toolbar button [[Image:A2p DefineConstraints.svg|24px]]).

Storage of files

 * Use relative paths for imported parts Uses relative file paths to the part files.
 * Use absolute paths for imported parts Uses absolute file paths to the part files.
 * All files are in this project folder: All project files have to be in the specified folder. It doesn't matter if they are in subfolders of this folder. Note: No file is allowed to exist several times in the folder (e.g. in different subfolders). This option is helpful to work on different machines because then one only has to copy the project folder.

Troubleshooting
Sooner or later you will get the problem that A2plus cannot solve the constraints you set. To overcome this, there are different strategies:

Checking Constraint Direction
Sometimes constraints seem to be consistently defined but they can nevertheless not be solved. An example: Assume you have a constraint set for two planes. Now you want to set for the same planes the constraint and A2plus cannot solve this. Then the constraint directions of and  are different. Use the same direction for both constraints to fix this.

Deleting Constraints
Most cases of unsolvable constraints occur directly when adding a new constraint. The solution is then to delete the constraint you added the last. A2plus will also propose this.

Sometimes the deletion strategy is the only one, for example when you edited a part in FreeCAD so that faces or edges connected to constraints are missing. You should then delete one constraint after another that is connected to the changed part. Use the toolbar button after every deletion to see if you reached a solvable state.

When you got an assembly that can be solved, add step by step the constraints you need.

Moving Parts
In some cases the solver only needs better start values to solve the constraints. Take for example the case that you have an axle part and a wheel part. You add a constraint and get no info that the solver failed but the parts are not moved accordingly and in the Report view widget of FreeCAD you see "REACHED  POS-ACCURACY :0.0". A solution for this is to move the parts closer to that position you like to get by the constraint.

Note: Assure that at least one part of the constraint has the property set to false.

Setting the Tip Property
If you miss some features of your part after the import to an A2plus assembly, check the property. A2plus imports bodies of parts with all their features up to the tip feature. This is sensible because setting the tip to a certain feature means that all features behind the tip should not appear in the final part. So if you miss a part feature in A2plus, open the part via the toolbar button, then select a body and look at its property. If the tip is not at the feature where you want it, right-click on the feature where the tip should be and choose. Finally save the part and reload the assembly using the toolbar button.

Repairing Assembly Tree
If you cannot see a clear reason why some constraints cannot be resolved, you can try to use the toolbar button. This will resolve all constraints and re-group then again under the different parts.

Avoiding Accented Characters
On some operating systems you can get problems if the file names or the file paths of parts or the assembly contain accented characters. Therefore avoid such characters and also special characters in general.

Fixing Position
This strategy is no longer necessary for assemblies created with A2plus 0.3.11 or newer because A2plus issues now a warning for missing fixed positions.

When you set a constraint between two parts and no part has the property set to true or is connected by a constraint to a part with  set to true, the constraint cannot be solved. The same happens if both parts of the constraint have set to true.

Then A2plus outputs the info about the failed solution, but sometimes you only see that the parts are not moved accordingly and in the Report view widget of FreeCAD you see "REACHED POS-ACCURACY :0.0". This means the solver finished without errors but it could actually not solve the constraints.

Therefore check that at least one of your parts in the assembly has set to true. Then assure that you only set constraints to a part which is somehow connected to the fixed part. To visualize these dependencies, see section Assembly Structure.

Rotating Parts
This strategy is no longer necessary for assemblies created with A2plus 0.4.0 or newer because A2plus rotates the parts now automatically a bit in the background to get a sufficient start angle for the solver.

The solver often fails for the constraint if the two selected planes have currently an angle of 0° or 180°. (The parts are not moved accordingly and in the Report view widget of FreeCAD you see "REACHED POS-ACCURACY :0.0".) A solution for this is to rotate one part by a few degrees using FreeCAD's transform feature (right-click on the part in the model tree and select in the context menu ).

Note: Assure that at least one part of the constraint has the property set to false.