Manage constraints through sub-assembly ?

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
fcaduser
Posts: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Manage constraints through sub-assembly ?

Post by fcaduser »

Hello developpers.

I would like to ask you something about the future assembly workbench development, whatever assembly WB would be eventually chosen.

Question : is the management of constraint solving through a tree hierarchy already envisaged ?

Here is a perfect example to clarify :

Imagine two shafts included in an assembly (say a machine frame assembly.) Besides them, consider a sub-assembly which is an universal joint (cardan type.) In the UJ sub-assembly, the spider would be for example locally fixed (set as the reference part of the UJ), and both yokes leaved each with a rotation (1 DOF.) Then the UJ is inserted into the aforementioned frame upper assembly. So, you can see the critical point, the constraint solver should apply alignment of each yoke with shaft *through* the UJ sub-assembly and therefore not consider it as monolithic.

IMHO it's a critical feature to keep a well-structured hierarchy for huge project (not be obliged to awkwardly split some assembly just because difficulties related to constraints appear.) So I would like to know, is this bringing some challenging problem to the code ?

Thank you.
Last edited by fcaduser on Sun Nov 24, 2019 12:02 pm, edited 1 time in total.
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Manage constraints through sub-assembly ?

Post by chrisb »

It may be a good idea if you provide the subparts of such an assembly, so it is easier to compare the different approaches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
fcaduser
Posts: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Manage constraints through sub-assembly ?

Post by fcaduser »

Is my explanation clear enough ?

Anyway, I can provide you a minimal yet typical test case, of course.
fcaduser
Posts: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Manage constraints through sub-assembly ?

Post by fcaduser »

Here is further information and an example.
1) I use A2+
2) You can see the tree structure in the left panel (UJ is a sub-assembly.)
3) Tar joined.

Image
Attachments
Test.tar
(110 KiB) Downloaded 54 times
Capture d’écran de 2019-11-24 12-32-43.png
Capture d’écran de 2019-11-24 12-32-43.png (168.42 KiB) Viewed 3581 times
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Manage constraints through sub-assembly ?

Post by Zolko »

fcaduser wrote: Sat Nov 23, 2019 7:22 pm Imagine two shafts included in an assembly (say a machine frame assembly.) Besides them, consider a sub-assembly which is an universal joint (cardan type.) In the UJ sub-assembly, the spider would be for example locally fixed (set as the reference part of the UJ), and both yokes leaved each with a rotation (1 DOF.) Then the UJ is inserted into the aforementioned frame upper assembly. So, you can see the critical point, the constraint solver should apply alignment of each yoke with shaft *through* the UJ sub-assembly and therefore not consider it as monolithic.
this is not the correct way of doing this, and I don't think that there are CAD systems out there that can handle this use-case. I had a similar problem in CATIA and I had to jump through hoops to get it working.

The correct way to do is not to consider the cardan as an assembly, but as separate parts, that are assembled into the assembly and attached to their respective LCS. The LCS are positioned and calculated with a master sketch. I attached the assembly (made with Assembly4). It was actually trickier than I thought, but I think this is an exact solution.

Cardan_Asm4.png
Cardan_Asm4.png (368.57 KiB) Viewed 3553 times

you can animate the rotation with:

Code: Select all

vars = App.ActiveDocument.getObject('Variables')
step = 2
for angle in range( 0, 720+step, step ):
	vars.Angle_rot = angle
	App.ActiveDocument.recompute()
	FreeCADGui.updateGui()
Attachments
asm_Cardan.FCStd
(99.88 KiB) Downloaded 67 times
try the Assembly4 workbench for FreCAD — tutorials here and here
fcaduser
Posts: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Manage constraints through sub-assembly ?

Post by fcaduser »

Thank you for replying.

I'm quite surprised, so high-end CADs don't handle this very mundane situation more cleverly ? In my opinion, the ultimate goal of a CAD should be to tend to mimic as close as possible the material world. And an UN joint should definitively set as an independent assembly (and so not fully constrained), and the tree (d/f) a reflection of it. So I dislike the suggested approach.

This is why I directly post this problem here. Is there some fundamental hurdle to overcome ?
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Manage constraints through sub-assembly ?

Post by Zolko »

fcaduser wrote: Sun Nov 24, 2019 2:45 pm handle this very mundane situation more cleverly ? [...] So I dislike the suggested approach.
I'm waiting impatiently to see your cleverer solution.

In my opinion, the ultimate goal of a CAD should be to tend to mimic as close as possible the material world.
Then you are wrong: the purpose of a CAD system is to BUILD the real world.
try the Assembly4 workbench for FreCAD — tutorials here and here
fcaduser
Posts: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Manage constraints through sub-assembly ?

Post by fcaduser »

Don't get me wrong. It's a limitation of CATIA, clearly. I wasn't saying there is a *better* solution than your proposal. I too regularly use some unsatisfactory solution to circumvent obstacles raised while using CAD. But I stick to my view, I think this is a patch.

Well... first model, then build.
fcaduser
Posts: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Manage constraints through sub-assembly ?

Post by fcaduser »

I did a very quick search and actually commercial CADs are able to manage this problem. I would have been be surprised of the contrary. Really, this is not an anecdotal problem. For huge project it's of tremendous importance to keep a very well structured tree. An assembly must be constituted with the parts that make it a coherent functional entity, no matter if some part must be leaved with some degree of liberty within.

Two examples with CATIA and SW. They call this "flexible sub-assembly" (vs rigid):
https://www.youtube.com/watch?v=v8KFHWGtq3I
https://www.youtube.com/watch?v=3JZ6xQ4O5Ig
fcaduser
Posts: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Manage constraints through sub-assembly ?

Post by fcaduser »

After further investigation...
All commercial CADs have addressed this problem (CATIA, SW, SE, Inventor, Creo.) They call that rigid vs flexible/adjustable assembly, etc. But it boils down to what I was talking about : leave a sub-assembly with some DOF free inside then fully constrain it in the upper assembly.

I'm still very interested to hear developers about this subject, even if it's a laconic : "We are well aware of this problem, but this would require a lot of work or we are hitting some difficulties, so we will see later..."

Great new year for all and FC.
Post Reply