after a lot of brainstorming in the assembly without solver thread, and also some on the Assembly3 preview and New Assembly 4? threads, a new assembly workbench for FreeCAD has emerged, called sequentially in the list Assembly #4.
This thread starter will be updated if new versions of the workbench appear. The main development repository is https://github.com/Zolko-123/FreeCAD_Assembly4
The basic principle is the one from assembly without solver: FreeCAD's App::Part container serve as basic building blocs, that are inserted into each other using the App::Link interface of realthunder's LinkStage3 branch of FreeCAD.
The advantage of App::Link feature is that it's possible to link — exchange, insert — FreeCAD objects between files, seamlessly: a model in a file will appear in the tree of another model in another file, but the data is not copied across. This allows to create many instances of the same object without any overhead, allowing the creation of large assemblies. In other words, this is identical what other CAD systems do when speaking of assembly.
The particularity of Assembly 4 is that the placement of the inserted (linked) part is done by matching (superimposing) corresponding coordinate systems in the parent assembly and in the linked part: therefore, there must be at least 1 coordinate system in the assembly and 1 in the part. There can be many coordinate systems in each, and the user can choose which of these coordinate systems — in the assembly and in the part — shall be used. Contrary to some other assemblies, no mathematical solver, no geometrical constraints — planes, axes, parallelism, concentricity — are used.
Another particularity of Assembly 4 is that there is no difference between a part and an assembly: it's possible to mix datum objects, 2D sketches, 3D geometries and inserted parts at will. This feature can prove to be extremely powerful once a user gets used to it.
You can download the Assembly 4 workbench as a ZIP archive here: it must be extracted and placed in the ~/FreeCAD/Mod directory, where all other workbenches reside.
Please bear in mind that Assembly 4 is not compatible with stock FreeCAD v0.18. Pre-built binaries of realthunder's branch can be downloaded from his GitHub repository. (they are called FreeCAD-asm3-xxx but are compatible with Asm4)
You can use provided example assemblies to experiment with this workbench's features.
In order to insert a part in Assembly 4 (and App::Link in general), it needs to be open in FreeCAD. It also needs to be saved to disk, because the App::Link framework needs the file's path. Unfortunately, it seems that when creating a new part and saving it, the App::Link doesn't "see" the file's path. So the surest way to use this workbench is to have files created, saved, closed, and re-opened: this way, the App::Link always sees the files you need. The workflow is then the following:
- create a new (empty) file
- click on the "create Model" button: this creates an App::Part container with all the needed elements
After the root App::Part container — called 'Model' in Assembly 4 — has been created , there are 2 ways to have 3D geometries in a part:
- create a Body in the root 'Model' and use the PartDesign workbench as usually in this Body
- copy an existing Body from an existing FreeCAD document into the 'Model'. This allows easy re-use of your existing FreeCAD designs
In order to insert an Assembly 4 'Model' into another Assembly 4 'Model, use the command 'Insert External Part' : this will allow you to chose one part in any of the open documents, and will ask you the name under which the instance of the part shall appear in the assembly tree. It is important to note that this name must be unique in the tree. By default, the insert part dialog will propose the same name for the instance as the name of the document where the part is located, but you can choose any name of your liking. If you choose a name that already exists, FreeCAD will modify it to something unique (and which may be un-nice to you)
Once inserted, the instance is placed using the command 'Place an Instance' (or 'Move an Instance'). This will show a dialog in 2 columns: the left column shows all coordinate systems in the linked part that can be used to attach to part, and the right column shows all other parts in the assembly and their coordinate systems that can be used to attach the instance-to. Use the 'Show' button to pre-visualize where the part's going to be placed. 3 rotation buttons allow the instance to be rotated by steps of 90° around the 3 axes X, Y and Z
Only coordinate systems directly at the root of the 'Model' container can be used for attachment, and not, for example, coordinate systems from a Body in the part tree.
This workbench allows the assembly of assemblies: since there is no difference between parts and assemblies, the 'Insert External Part' allows to chose a part that has other parts linked to it. The only difference will be for the coordinate systems in the inserted assemblies: in order to be used with Assembly 4, a coordinate system must be directly in the root 'Model' container, meaning that a coordinate system inside a linked part cannot be used to attach the assembly to a higher-level assembly.
Therefore, in order to re-use a coordinate system of a part in an assembly, a coordinate system must be created at the root of the 'Model', and the placement of this coordinate system must be 'copied' over from the coordinate system that the user wants to use. This is done by inserting a coordinate system and using the 'Place LCS' command, which allows to select a linked part in the assembly and one of it's coordinate systems: the 2 coordinate systems — the one at the root of 'Model' and the one in the linked part — will always be superimposed, even if the linked part is modified, allowing the placement of the assembly in a higher level assembly using a linked part as reference. It sounds more complicated than it actually is.
EDIT (2019.03.11): the git repository should now work as it's supposed-to
EDIT (2019.03.12): cosmetic change: moved actual Python code to Mod_Asm4: this is the directory to be moved/copied/linked inside ~/FreeCAD/Mod. Added some more examples to experiment