Assembly 4 workbench

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

gjbgeo wrote: Sat Oct 19, 2019 4:37 am
Zolko wrote: Fri Oct 18, 2019 7:30 am I had never tried before, but it seems to work (at least basically):
Could you elaborate on if there were any additional steps you made?
that tutorial is for the assembly only. To do the TechDraw, switch to TechDraw, create a new page from a template (I've chosen A4), in the tree select the root 'Model' of the assembly, and then choose to add projections. Apparently, these projections are added with the orientation of the model at the moment you do this, so orient the model in the way you wish — top, down, front, whatever — and then create your projections.

But this is TechDraw, I'm afraid I won't be able to help you more on this, you should ask the people from the TechDraw forum.
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Assembly 4 workbench

Post by OficineRobotica »

OficineRobotica wrote: Sat Oct 19, 2019 5:00 am Sorry for jumping in but for me this seems to be a really common use case and also i might get wrong some of the concepts , so if i talk nonsense please ignore me.

This is known by everybody but i need to state it for my self acknowledgment lol. A body is a unique continuous volume. A part is , also, a colection of bodies. Therefore , we can use parts as a sort of subassembly.
If I create all the Parts at the global origin or if I use the Placement at the Part level and then use Assembly4 it works perfectly, as advertised.
Is this then the intended approach?
This behavior is present in A2+ also. but if one , in this order, creates a part1> ads a body> ads constraints relative to another combo partAndBody> then moves part 1 ....the alignment gets lost. Somehow moving a part should permit bodies inside to honor the constraints set in precedence.
when creating a Body in a Part, the Body shouldn't be move inside the part. And what about the part containing the body: if that-one is moved, how does all of this behave ?
I might be doing it all wrong but i always move bodies inside of parts , again using it as a sort of sub assembly then with the transform tool trying to check for collisions. But think parts with more than one body. This is a example altough it is a A2+ one.

Parts.png

Sorry....for the double post. I corrected wording especially in the step by step part and the forum reposted the message at the end of the thread
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

ppemawm wrote: Fri Oct 18, 2019 11:16 pm This is a holdover from how I am currently working to build a (pseudo)assembly. I use the Part container for a subassembly. It is placed in its location in the overall assembly. Body placement is used to locate a component within the Part subassembly.
...
I will continue to experiment a bit to see if your workbench can be used somehow with my (unorthodox, apparently) in-context design approach.
OficineRobotica wrote: Sat Oct 19, 2019 5:00 am we can use parts as a sort of subassembly.
...
I might be doing it all wrong but i always move bodies inside of parts , again using it as a sort of sub assembly
I don't think any of this is wrong, I think that there are several tools to do assemblies, and Assembly4 is one of them. But I think that mixing tools can lead to strange results.

The principle of Assembly4 is to use App::Parts and link them with App::Link. Whatever is in the App::Part is inserted as-is into the assembly, and this is true for Datum objects, and this is a particular feature of Assembly4. This workflow is very similar to other CAD systems, and I think it works very well, from small to large assemblies, including kinematics using a master sketch. Intuitively, for me, 1 part was 1 body/solid, or may-be an array of bodies (because that works quite well). But if you do your assembly method with different bodies inside a part and then use that part with Assembly4, I don't know what that will do. And I can't really test because it's not something I would do.

So please, by all means, experiment and tell here what you found. May-be there is something I overlooked and we could have a very useful combination.
try the Assembly4 workbench for FreCAD — tutorials here and here
Grawp
Posts: 45
Joined: Sat Mar 03, 2018 9:34 am

Re: Assembly 4 workbench

Post by Grawp »

Hello, I'm trying to figure out how to use asm4 to place one body (wrapped in Part) to another one and do a boolean operation between them. My question is: Is that even possible?
I've looked through the wiki but haven't noticed any case where assembly is used for creation of further models (I mean anything other than just pure assemblies).
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

Grawp wrote: Sun Oct 20, 2019 9:48 am My question is: Is that even possible?
I don't know for sure but I doubt it.
try the Assembly4 workbench for FreCAD — tutorials here and here
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Assembly 4 workbench

Post by vocx »

Grawp wrote: Sun Oct 20, 2019 9:48 am ...
I've looked through the wiki but haven't noticed any case where assembly is used for creation of further models (I mean anything other than just pure assemblies).
I think this is the wrong approach. An Assembly workbench should just assemble objects that were previously created. It shouldn't be used to do further modifications on the imported parts. If you want to do this, you should import the to bodies that you have into the same document, and then perform boolean transformations with them, and then import the resulting part into the bigger assembly.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: Assembly 4 workbench

Post by ppemawm »

Zolko wrote: Sat Oct 19, 2019 2:12 pm So please, by all means, experiment and tell here what you found. May-be there is something I overlooked and we could have a very useful combination.
I extracted this carburator subassembly from a miniature engine model created previously. (See https://forum.freecadweb.org/viewtopic.php?f=24&t=39967)

I then used Assembly4 to create a linked assembly with all parts in the same file. In order to do this, each body of the subassembly had to be wrapped with its own Part container as can be seen in the Model Tree in the first image. (When I model in-context I use a Part container and its placement to locate the subassembly in the engine and the body placements to locate each body in its proper location in the subassembly.) Next, the body placement, which was a result of creating in-context in my previous model, was zeroed out and transferred to the Part placement. With that in place, it was possible to create the necessary LCS links for each Part. All Parts were grouped in a folder to better organize the tree.

Picture1.jpg
Picture1.jpg (56.7 KiB) Viewed 3137 times
The Parts were assembled in an Assembly4 Model in the same file to gain the advantage of the link constraints as shown in the next image.

Picture2.jpg
Picture2.jpg (57.3 KiB) Viewed 3137 times
The carburator has two moving parts: the barrel with its lever and the needle valve. Positions of both can be controlled by the Attachment Offset of the assembly contraints as explained in your tutorial. However, it is apparently important to consider the order or sequence that the LCS's are created or linked. In this example, the barrel LCS was created before the lever LCS and the lever was linked to the barrel. Note that the lever is designed to be in-line with the through hole in the barrel. When the barrel is rotated using the Constraint Attachment Offset, the lever follows as you would expect as shown in the next image. If, however, the lever is rotated, the barrel does not follow.

Is this the intended behavior?

Picture3.jpg
Picture3.jpg (90.09 KiB) Viewed 3137 times
Annother demonstration of the power of Assembly4 is shown in the next image. The length of the carburator body pad is lengthened 10 mm. (The length of the barrel pad is linked by an Expression to the carburator body so that it also lengthens the same amount.) Note how all of the linked parts relocate to their proper location in the Assembly4 Model. Powerful indeed!

Picture4.jpg
Picture4.jpg (73.81 KiB) Viewed 3137 times
In conclusion, it seems that the Assembly4 workbench interfaces quite nicely with the process I am using for in-context modelling with all bodies in the same file. The only change I have to make is to add each body to a Part container as I model. Thank you for such a simple way to gain the assembly constraints I was missing in my previous models!

I can place this Assembly4 model (2.66Mb) on Dropbox only to be used for education purposes if anyone wants further detail. Comments and questions are welcome.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18542 (Git)
Build type: Release
Branch: master
Hash: 432d4f25528300d0febf53b85df578fcdde1eda7
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
"It is a poor workman who blames his tools..." ;)
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

ppemawm wrote: Sun Oct 20, 2019 8:05 pm I then used Assembly4 to create a linked assembly with all parts in the same file. In order to do this, each body of the subassembly had to be wrapped with its own Part container as can be seen in the Model Tree in the first image.
yes, this is a choice I've made quite early, and the reason are that App::Part and App::Link combine very well, and that the App::Part container can be used to assemble PartDesign Bodies, but also solids from the Part workbench, and also solids imported from STEP files. So while it does create some overhead for designs using solely PartDesign, it allows a unified interface for assembly using any workbench to create solids. I use a lot of parts coming from STEP files.

Now that you have proven that it is possible to use this interface (App::Part <=> App::Link) to also do assemblies in a single document and in-context design — even though this workflow was not fore-seen — I think that it strengthens the original choice.

However, it is apparently important to consider the order or sequence that the LCS's are created or linked. In this example, the barrel LCS was created before the lever LCS and the lever was linked to the barrel.
...
Is this the intended behaviour?
If you have attached the lever to the barrel, then yes, it's logical.

Annother demonstration of the power of Assembly4 is shown in the next image. The length of the carburator body pad is lengthened 10 mm. (The length of the barrel pad is linked by an Expression to the carburator body so that it also lengthens the same amount.) Note how all of the linked parts relocate to their proper location in the Assembly4 Model. Powerful indeed!
thank-you for your appreciation

In conclusion, it seems that the Assembly4 workbench interfaces quite nicely with the process I am using for in-context modelling with all bodies in the same file. The only change I have to make is to add each body to a Part container as I model. Thank you for such a simple way to gain the assembly constraints I was missing in my previous models!
I was thinking about your workflow: I have been playing around with your files, and it seems somewhat burdensome to create in the same document an App::Part, and then App::Link this App::Part into the App::Part 'Model' assembly included in this file. I think it should be possible to directly include the App::Part as a child of the App::Part 'Model' that is the root assembly, and still use the LCS and master-sketch and ExpressionEngine and constraints, but directly on the App::Part and not on it's App::Link.

In other words: do you think the following workflow would make sense :
  • new Document
  • new Model
  • new Part
  • create LCS in Part
  • create master Sketch in Model
  • attach LCS to master Sketch
  • move Part → Model (in the document tree)
  • place Part in the Model by attaching its LCS to the LCS in the Model (thus allowing kinematics based on the master Sketch)
This would be exactly like today, except that the Part is directly attached to the correct Placement and not its Link. Mostly all of the current Assembly4 commands would be identical, only the ExpressionEngine need to be adapted to deal with an App::Part and not an App::Link. Of course, this would only make sense for parts that are unique in the assembly, if you have multiple instances of the same Part then you'd have to use several Links to create as many instances.
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Assembly 4 workbench

Post by easyw-fc »

Zolko wrote: Mon Oct 21, 2019 7:45 am that the App::Part container can be used to assemble PartDesign Bodies, but also solids from the Part workbench, and also solids imported from STEP files. So while it does create some overhead for designs using solely PartDesign, it allows a unified interface for assembly using any workbench to create solids. I use a lot of parts coming from STEP files.
Moreover it would be a new incoming feature useful for direct STEP importing and assembling with A4:
https://forum.freecadweb.org/viewtopic. ... 10#p327445
From the thread here is a STEP file with named coordinate systems PCS,MCS,CSW -> #4082=AXIS2_PLACEMENT_3D('MCS',#5744,#4567,#4568)
mdel2.stp
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: Assembly 4 workbench

Post by ppemawm »

Zolko wrote: Mon Oct 21, 2019 7:45 am In other words: do you think the following workflow would make sense :

new Document
new Model
new Part
create LCS in Part
create master Sketch in Model
attach LCS to master Sketch
move Part → Model (in the document tree)
place Part in the Model by attaching its LCS to the LCS in the Model (thus allowing kinematics based on the master Sketch)
I am not sure I understand yet completely what you are suggesting, but I am all for simplifying the Tree and eliminating or hiding redundancies. The workflow is logical to me.

I am currently using master sketches and carboncopy to capture design intent and control subassembly placement but have not tried to use the LCS and Asembly4 in conjunction with these sketches. So, that will be my next study. Perhaps I can come up with another example using your master sketch approach in the next several days. This is probably a much more robust approach than attaching LCS's to edges, faces, or vertices.

When you design a new machine in-context in a single file you are basically creating a completed assembly in 3D space. The next step should be to simply add the placement constraints between the various Part interfaces so that the assembly is kept up to date with any changes. This approach mimics how we did it back in the day on the drafting board in 2D. The top assembly drawing of the concept was created first and used as the controlled 'master'. Individual components were then designed based on this master and any issues or changes were updated on the top assembly drawing. I think this is called 'top down modelling' nowadays.
"It is a poor workman who blames his tools..." ;)
Post Reply