assembly without solver

Discussion about the development of the Assembly workbench.
triplus
Posts: 8786
Joined: Mon Dec 12, 2011 4:45 pm

Re: assembly without solver

Postby triplus » Mon Dec 31, 2018 12:00 am

Zolko wrote:
Sun Dec 30, 2018 11:36 pm
I such a case, you can define, very early in the process, LCS where parts and assemblies are functionally linked, assemble everything, and develop in parallel all sub-assemblies distributed between several engineers, and the master assembly will, automagically, always include all sub-assemblies at the correct placement.
Hence using a feature as Part feature for such purpose, as Part feature provides LCS?
realthunder
Posts: 1229
Joined: Tue Jan 03, 2017 10:55 am

Re: assembly without solver

Postby realthunder » Mon Dec 31, 2018 12:06 am

Zolko wrote:
Sun Dec 30, 2018 1:54 pm
yes, "IF". But in the real world, in 90% of cases (probably closer to 99%) you don't need a complex solver, a part is positioned at a particular position. The assembly knows where the part is supposed to go (that's the target LCS), and the part knows where it is supposed to be attached (that's the attachment LCS).
I disagree. On the contrary, in real world situation, people expect a CAD system can do most of the calculation for them. Let's say we want to fix two plates with two holes. In theory, there are many ways to do this without needing an assembly. You can measure the angle of the holes in one of the plate. You can use sketch to map the holes of the first plate, and create the second plate with that sketch. The thing is, if you expect user to do this and do that, you don't really need an assembly system in the first place. Someone has created an entire engine using FC. But in real world, people expect to be able to do this,

Image

Each constraining element is in fact a definition of LCS, as it has a position and orientation. If you actually try to code your idea of a LCS only assembly, you'll soon find yourself in trouble with dependency mess. If you walk through the chain of LCS pairs, you'll find loops in very simple assemblies.
Zolko wrote:
Sun Dec 30, 2018 1:54 pm
In fact, FreeCAD's AttachEngine is used for this purpose.
That's an information I didn't know, thank-you. Could you please give more info on that ? Supposed, for example, that I have an assembly, a part, each having 2 LCS, and I want to attach — using your App::Link framework — the part by one of its LCS to the assembly, twice, once on each LCS. Would it be possible to do it today ?
That's how PartDesign body builds on, attaching sketch to existing body feature, and then create new feature. It works well because the body is supposed to produce fixed geometries, and you are actually building those geometries along the way, whereas in assembly, the parts are already built, possiblely from different people. AttachEgnine are in src/Mod/Part/App/Attacher.h/cpp.
Try Assembly3 (latest version 0.10.2) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
triplus
Posts: 8786
Joined: Mon Dec 12, 2011 4:45 pm

Re: assembly without solver

Postby triplus » Mon Dec 31, 2018 12:35 am

I guess, the main problem we are now having is the impression itself. Like some claiming that we do or don't need a good assembly structure, robust assembly solver, LCS feature one can use to pre-set "an empty assembly structure". It's like we would be arguing what makes a good car. Some would say it needs a good engine and in the heat of the debate to start saying it doesn't need wheels at all. But if you got a set of wheels you can i guess still push it yourself, and it will work?

Therefore assemble yourself together please, all this parts in the end do matter. We need them all and in addition an average end user needs to understand it.
wsteffe
Posts: 143
Joined: Thu Aug 21, 2014 8:17 pm

Re: assembly without solver

Postby wsteffe » Mon Dec 31, 2018 8:38 am

I also agree on the importance of having a robust assembly solver.

Actually I think that the solvers used in A2+ and A3/Solvespace, while being effective in many applications, probably are not well suited to handle very large assemblies. This is because they are totally based on the numerical solution of a non-linear system and it is well known that this kind of problem doesn't scale well with the number of unknowns.

The solver times could be improved trough a reduction of the number of unknowns which can be done, in example, trough the identification
of rigid clusters. Let us suppose to have a set of N 3D points which are constrained by M point to point distances.
If we are able to identify a subset of 4 points such that all the relative distances are all fixed (there are 6 of such distances), this
subset is in effect a rigid body in the 3D space and is uniquely defined by 6 DOF (degrees of freedom).
So we can remove the 6 constraints and replace the 12 DOF associated with the 4 points in the 3D space with the 6 DOF
associated with the rigid body.

The initial problem characterized by N*3 DOF and M constraints is then replaced by a smaller problem characterized by N*3-6 DOF and
M-6 constraints. This reduction can be repeated until we are able to find other rigid clusters.

As explained in this document http://graphics.tudelft.nl/~rick/pdfs/solving.pdf, there are also other ways to reduce the number of DOF apart of rigid clusters. The author of this paper has also produced a python code (named geosolver) which is aimed to demonstrate his numerical method for the solution of a geometric constraint problem. In the past I have tried it but without success because of incompatibility issues between that code and my python environment.
User avatar
fosselius
Posts: 346
Joined: Sat Apr 23, 2016 10:03 am

Re: assembly without solver

Postby fosselius » Mon Dec 31, 2018 9:23 am

Nice paper, project page: http://geosolver.sourceforge.net
https://sourceforge.net/projects/geosolver/
Source last updated 2014.
User avatar
saso
Posts: 1336
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: assembly without solver

Postby saso » Mon Dec 31, 2018 9:56 am

With the LCS workflow this is very much what the user sets manually and as such there is even one computational step less since we don't have to search for it. And again, our arguments are not about that 3d constraints and solver are not needed, its that they alone don't make what traditional assemblies are, that part / assembly containers (components) are the foundations for it... But it's a nice paper yes, thanks :)

And to give you a feeling of large assemblies, because I really don't want to see another example of constraining together two solid cubes...

https://www.youtube.com/watch?v=65o75r0JyaI
https://www.youtube.com/watch?v=w8HSXr9kLJA
https://www.youtube.com/watch?v=21eflrnBeJ0

https://www.youtube.com/watch?v=B99GjHGN8Bc
https://www.youtube.com/watch?v=9mzbmQn1TaM
https://www.youtube.com/watch?v=Qo2zxHgNV60
https://www.youtube.com/watch?v=cBYWKVKgpJE
wsteffe
Posts: 143
Joined: Thu Aug 21, 2014 8:17 pm

Re: assembly without solver

Postby wsteffe » Mon Dec 31, 2018 11:02 am

saso wrote:
Mon Dec 31, 2018 9:56 am
With the LCS workflow this is very much what the user sets manually
Hy Saso, I may understand what you mean. In fact I have to admit that, when building a large assembly, I always tend to make a tree like structure in the dependency graph, avoiding as much as possible the circular dependencies mentioned by realthunder.
At the end the circular dependencies are not completely absent but they tend to have a local nature: the loops are small and involve a small number of things which are located in a small part of the whole assembly.
The realthunder example (two plates connected by two bolts) agrees with this schema. There is a dependency loop but it involves only the variables associated with to nearby plates (which we may imagine be a part of a large assembly). I think it should not be difficult for to automatically recognize that the two plates constitute a rigid sub-assembly.

I think that we could envisage a situation were many rigid connection are handled with the LCS method (which can be considered as an explicit declaration of rigidity and therefore reduce the effective number of DOF). Other connection could be more conveniently handled with usual constraints and many of these could still be removed by a clever solver after having identified other rigid connections.

At the end, if there is still some degree of freedom left, the solver should have to deal with a much smaller non-linear system.
User avatar
saso
Posts: 1336
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: assembly without solver

Postby saso » Mon Dec 31, 2018 11:13 am

Sounds great, I can only agree and shake hands on that :)
User avatar
Zolko
Posts: 445
Joined: Mon Dec 17, 2018 10:02 am

Re: assembly without solver

Postby Zolko » Mon Dec 31, 2018 11:18 am

realthunder wrote:
Mon Dec 31, 2018 12:06 am
whereas in assembly, the parts are already built, possiblely from different people
This is where you make your mistake. No, at the beginning of a project, parts are not yet made, you only have a vague idea how all the — future — parts are going to fit together. This means that a project always begins with the master assembly, containing some datum objects, functional sketches, and allowed volumes. From there you derive sub-assemblies, fixed to the master assembly by datum objects, often LCS, and those sub-assemblies are distributed then to different people / groups.

Which means you don't even have any geometry to make constraints, those come at the very end when all details are worked through.

But anyway, it's irrelevant, because all high-end CAD systems provide the functionality we're talking about (mating of pairs of LCS): Catia V5, SolidWorks, Siemens NX, T-Flex.... You'll have a hard time arguing why they all do it wrong and why FreeCAD shouldn't have that feature.
AttachEgnine are in src/Mod/Part/App/Attacher.h/cpp.
Nice, thank-you, I'll try to understand what that does.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — simple tutorial here
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: assembly without solver

Postby NormandC » Tue Jan 01, 2019 4:44 pm

Zolko wrote:
Mon Dec 31, 2018 11:18 am
No, at the beginning of a project, parts are not yet made, you only have a vague idea how all the — future — parts are going to fit together. This means that a project always begins with the master assembly, containing some datum objects, functional sketches, and allowed volumes.
Uh... No. Maybe that's the "proper" way of doing it for complex projects, but it most definitely not always begins that way. At work, we often create small assemblies for which we have already figured out the parts, therefore we don't need to start with a master assembly.

Zolko wrote:
Mon Dec 31, 2018 11:18 am
all high-end CAD systems provide the functionality we're talking about (mating of pairs of LCS): Catia V5, SolidWorks, Siemens NX, T-Flex....
Solidworks is not a high-end CAD system, it's mid-range.