## Assembly3 preview

Discussion about the development of the Assembly workbench.
catman
Posts: 277
Joined: Fri Jan 11, 2019 10:42 pm

### Re: Assembly3 preview

realthunder wrote:
Mon Oct 05, 2020 10:43 pm
catman wrote:
Sun Oct 04, 2020 6:09 pm
Then the part is mated with exactly 6 DOF by reducing the redundancy once. In the tree all 6 Elements are listed under the "Attachment6" constraint.
That Attachment6 itself is not going to be cheap to solve, probably require an actual algebra solver. Granted that solving for a single pair of parts is relatively easy, but that's against the idea of using Attachment, which just requires simple matrix operations.
Thanks for the feedback. I learned something new in your second part of the answer .

I was not the intention to involve the algebra solver. The goal is indeed, to generate a fixed matrix. The difference to a standard Attachment Constraint is that the elements are not parts of the body. Your description of the additional element sketches addresses that (and has great other use cases) but requires a process that is imho too complex in practive (adds up for say 20 standard parts to be assembled for a single sub-assembly). The idea is to basically create such an additional sketch element implicitly with the assembly. It can be used for many parts that do not work with the standard Attachment Constraint directly.
For those parts its trivial to define a 'sektch' (actually a normal vector) by 3 faces on the part: the first face could describe the contact plane and normal direction, the other two are added for the origin. If you store the 2x3 defining elements in the Attachment6 constraint its the same like storing an additional custom element for each part in a Attachment constraint. So the Attachment Constraint itself does not really change, but the Elements change. Maybe a name could be "Virtual Element", because the 2x3 Elements given are only used to define 2 other elements that are used for the constraint. Its another layer of indirection if you like. That also means that the topo naming impact is the same, it just affects more faces per part.

I would expect that it is a very cheap operation and that it might even be possible to update it each time (the part changed), because finding the normal vector from the 3 defined faces a simple matrix operation. Please forget my remark about linear axes definition (last post) for now.

The advantages compared to storing an additional element with the part are
* faster and more intuitive to use
* works for multiple instances: each could use different virtual face
* more flexibe by using an attachment variant not forseen by the part creator (the example parts would need 6x5x4=120 pre-defined sketch elements to cover all variations)

PS: Maybe I am wrong , but I understand your additional element sketches as *the* counterpart to @zolkos LCS in Assembly4: they are oriented things that I can add to any part (even multiple ones per part) and reference them in an Attachment Constraint. The main difference is, that Assembly4 displays an colored tripod at each origin, yours is optional to the sketch and all green. Of course thats only a rough high-level view.
realthunder
Posts: 1809
Joined: Tue Jan 03, 2017 10:55 am

### Re: Assembly3 preview

catman wrote:
Tue Oct 06, 2020 8:43 am
I was not the intention to involve the algebra solver. The goal is indeed, to generate a fixed matrix. The difference to a standard Attachment Constraint is that the elements are not parts of the body. Your description of the additional element sketches addresses that (and has great other use cases) but requires a process that is imho too complex in practive (adds up for say 20 standard parts to be assembled for a single sub-assembly). The idea is to basically create such an additional sketch element implicitly with the assembly. It can be used for many parts that do not work with the standard Attachment Constraint directly.
I kinda get what you wanted now. I think it can be considered as an extension to the existing 'Element' rather than a new 'Constraint', for more general purpose. Say, I add a new type of Element3, that can find its position using three planes, and its normal as one of the plane's normal. And then, all existing constraint can simply use this element as usual without any change.

And of course, the same idea can be applied to two plane element, where it will use the intersection line for constraining purpose. I think I am going to call this new type of element as CompoundElement.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
catman
Posts: 277
Joined: Fri Jan 11, 2019 10:42 pm

### Re: Assembly3 preview

realthunder wrote:
Wed Oct 07, 2020 12:51 am
I think it can be considered as an extension to the existing 'Element' rather than a new 'Constraint', for more general purpose. Say, I add a new type of Element3, that can find its position using three planes, and its normal as one of the plane's normal. And then, all existing constraint can simply use this element as usual without any change.
And of course, the same idea can be applied to two plane element, where it will use the intersection line for constraining purpose. I think I am going to call this new type of element as CompoundElement.
Yes, indeed. I hoped it might be useful for other things. Element3 would be a good name, as it implies that it is an "Element made of 3 parts". If it looks like an element but is a node one could name the node, say "LeftFrontCornerSnap" and fold the names of the underlying 2-3 elements on and off as desired.

Actually , although a bit confusing first, I think that the indirection by the elements is one of the major USPs (unique selling points) of Assembly3. Once used to it, it makes changes on the assembly very manageable and saves loads of additional work. That applies not only to changing parts but also when re-using existing elements for other constraints: its a lot faster to select elements in the tree, provided they are properly named and sorted by part. Naming and sorting could still be fine-tuned a little bit, but imho its already production ready (btw, sorting tree items up and down only works with a single selection - or is there a way to move a block of items at once?).
kwahoo
Posts: 338
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

### Re: Assembly3 preview

Hi all!

There was a post describing Solidworks and Pro/E assembly algorithms somewhere in the discussion. I cannot find it, but I wanna share a observation about Pro/E (Creo) and how they reduced solver load. In the video below I did something impossible in Creo with "normal" constraints:
phpBB [video]

Red part is locked, green can rotate, blue can rotate and translate along hole. I want constrain blue part to green part. This is not possible in Creo, because Creo does allow to move only the last part, the green (and red of course) one is not allowed to move. I think Creo does not solve full assembly, only the new part position.

I could to do what i did in FreeCAD if would use "kinematic" constraints. But they are much less reliable and slower.

Maybe we should consider adding option to use similar behavior: after constraining a new part automatically lock it and disable it's constraints?
Attachments
constrtest.zip
EskiBrew
Posts: 60
Joined: Fri Apr 24, 2015 10:21 am

### Re: Assembly3 preview

OS: Linux Mint 20 (XFCE/xfce)
Word size of OS: 64-bit
Version: 0.19.22670 (Git) AppImage
Build type: Release
Branch: master
Hash: 12155f4aab09047c5697db0c1b3cf93b02edda03
Python version: 3.8.6
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)

I may be missing something obvious here but is there a way to show the degrees of freedom a particular part has in an assembly when it is highlighted?
catman
Posts: 277
Joined: Fri Jan 11, 2019 10:42 pm

### Re: Assembly3 preview

EskiBrew wrote:
Sat Oct 17, 2020 7:22 am
is there a way to show the degrees of freedom a particular part has in an assembly when it is highlighted?
I have not found such a display yet either. The only one I know is the printout in the report view when selecting "Solve Constraints" where it gives the number of "dof remaining" or the info "redundant constraints". This is not related to a part that can be identified. Maybe realthunders stand-alone version has functions for this.
catman
Posts: 277
Joined: Fri Jan 11, 2019 10:42 pm

### Re: Assembly3 preview

Is there a way to avoid that frozen assemblies loose their colors?

When I freeze the assembly all those parts become grey.
(using 0.19 22611 in Linux)
cos4
Posts: 10
Joined: Wed Feb 05, 2020 8:37 pm

### Re: Assembly3 preview

I'm currently experiencing some issues with inconsistent constraints. I managed to create a small example illustrating this behavior.
My goal is to:
- position the extrusion in the center of the coordinate system aligned with x,y,z and lock it in this position
- position the metal sheet on top of the extrusion, and center it in x and y relative to the extrusion.

For some reason it does not always happen. When I click solve in the attached example I get a run time error: " inconsistent constraints". When I reenable the first PlaneAlignment it is solveable (with warning about redundant constraints). The third constraint is only solveable if I disable the first two. To me it's unclear why the two constraints together are solveable while one alone is not. Furthermore when I disable all both constraints it shows me "dof remaining: 0" which is obviously wrong since the metal sheet is not defined at all.
I'm having such issues with inconsistent constraints very frequently. Sometimes I manage to get it to work after playing around with constraints for some time but I didn't find a method to prevent this issue. I'm not sure if this is an related to the algorithm or if I design my assembly in a incorrect way.

System Information:
OS: Arch Linux (GNOME/gnome)
Word size of OS: 64-bit
Version: 0.19.22756 (Git) AppImage
Build type: Release
Branch: master
Hash: ce87f586ee36ffe8ebcdcd3947ced4ab389ae795
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Attachments
Screenshot.png (22.95 KiB) Viewed 261 times
example_assembly.zip
kwahoo
Posts: 338
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

### Re: Assembly3 preview

cos4 wrote:
Sun Oct 18, 2020 8:29 pm
For some reason it does not always happen. When I click solve in the attached example I get a run time error: " inconsistent constraints". When I reenable the first PlaneAlignment it is solveable (with warning about redundant constraints). The third constraint is only solveable if I disable the first two. To me it's unclear why the two constraints together are solveable while one alone is not.
Assembly3 uses Solvespace's solver and (from my understanding) it really does not like redundant constraints. It's homepage states
Failure to Solve

In some cases, the solver will fail. (...)

A triangle with internal angles constrained to 30, 50, and 100 degrees is also an error. This is not inconsistent, because the angles do sum to 180 degrees; but it's redundant, because only two of those angles need to be specified
Using plane alignment you constrain 3DOF: 1 translation and 2 rotations. After using plane alignment second time there is a redundant rotation.

I do not have a viable solution for you, maybe others have.
I just try not to create redundant constraints, eg. in this case should be possible to use a single PointCoincident to constrain all translations, and then 3x MultiParallel to on pairs of axes/edges to constrain all rotations.
Last edited by kwahoo on Sun Oct 18, 2020 9:33 pm, edited 1 time in total.
EskiBrew
Posts: 60
Joined: Fri Apr 24, 2015 10:21 am

### Re: Assembly3 preview

catman wrote:
Sun Oct 18, 2020 3:13 pm
I have not found such a display yet either. The only one I know is the printout in the report view when selecting "Solve Constraints" where it gives the number of "dof remaining" or the info "redundant constraints". This is not related to a part that can be identified. Maybe realthunders stand-alone version has functions for this.
Ah yes, I spotted that but it does not seem to be clear what it means - I suspect it means the total DOF of all the parts which have constraints, which is of limited use.

Do you happen to know which constraint to use to lock the rotation of two items? - Imagine a shaft with a pulley on it, how do I lock the two parts together such that when the shaft rotates, the pulley also rotates?

### Who is online

Users browsing this forum: No registered users and 1 guest