Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
kbwbe
Posts: 853
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Mon Jul 16, 2018 1:16 pm

project4 wrote:
Mon Jul 16, 2018 12:41 pm
I think I'm missing something very trivial...
I've created a simple rectangular part, copy&paste it to have a second one.
Moved the second part aside and want to connect them.
Selected 2 planes that face each other, press the planeCoincident button and get the "Constraints inconsistent. Cannot solve System." error.

Attaching the simple file. What am I missing?
I @project4,

i had a look at your file. You are not using the intended workflow. A2plus is designed mainly for importing files, not to draw within directly.

You should do:
- draw a box within an external file.
- save it
- import it once or more to a new assembly file
- constraint the boxes

ready.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.26b, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
anisim (deutsch): https://www.youtube.com/watch?v=vDcaFq6IEJM
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Another approach to assembly solver (A2plus)

Postby project4 » Mon Jul 16, 2018 1:25 pm

Hmmm... You should probably do something to deal with that.

As far as I know FreeCAD file keeps all its elements in the same file, no need for separation.
For large projects I agree that it makes sense to have every part in its file and have sub-assemblies as well, but having that restriction sounds strange and not intuitive with the rest of the FreeCAD look and feel.

Maybe you should create your own tree group like Assembly3 is doing and store there all assembly related.
ASM3 also have assembly related actions when you right-click on the assembly entry in the tree...
kbwbe
Posts: 853
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Mon Jul 16, 2018 1:30 pm

project4 wrote:
Mon Jul 16, 2018 12:52 pm
Since I can't assemble anything yet, started playing around with the Assembly-Platform-6DOF file you attached a while ago.
I see the resolver doesn't really resolve automatically for every change, but only when I press the rubics-cube button, regardless if I change the auto-resolve mode. Should it be so?
When the solver is actually executed?
The solver is automatically executed e.g. if you press enter after editing an offset of a circularEdge constraint
project4 wrote:
Mon Jul 16, 2018 12:52 pm
I was trying to see if I can move a part and see that all the others are aligned accordingly, but the structure comes back to the same shape when I recalculate manually.
You cannot move a part manually away without coming back to position as model is 100% constrained. There is no DOF anymore. You can only move it by changing the offsets of the circularEdge constraints.
project4 wrote:
Mon Jul 16, 2018 12:52 pm
EDIT:
While typing, tried to change the offset in one of the pistons constraint and saw the part recalculated when I press enter.

Ok. Now I get that the assembly might be all constrained and that's the reason I can't really move something to see other parts follow it.
But when I'll solve the problem on my side (probably don't understand something), will it be possible to recalculate on every move of a part to see something move?

I understand that the calculations might be too slow, but still, I would expect to see something...
Moving parts by mouse ATM is not connected to solver. As you often have to move a part away during constraining to pick the desired topology. So there would have to be two different mouseMoves of the parts. One according to the constraints and one different for only placing part temp. away independent to constraints.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.26b, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
anisim (deutsch): https://www.youtube.com/watch?v=vDcaFq6IEJM
kbwbe
Posts: 853
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Mon Jul 16, 2018 1:43 pm

project4 wrote:
Mon Jul 16, 2018 1:25 pm
Hmmm... You should probably do something to deal with that.

As far as I know FreeCAD file keeps all its elements in the same file, no need for separation.
For large projects I agree that it makes sense to have every part in its file and have sub-assemblies as well, but having that restriction sounds strange and not intuitive with the rest of the FreeCAD look and feel.

Maybe you should create your own tree group like Assembly3 is doing and store there all assembly related.
ASM3 also have assembly related actions when you right-click on the assembly entry in the tree...
It is not intended to create a new feature-monster, as my resources (time) are limited. A2plus shall be a replacement for Hamish's Assembly 2 workbench. The workflow is similar and many people like it. So i will keep it alive. If A3 with its workflow is appreciated by you, no problem with that. Use it.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.26b, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
anisim (deutsch): https://www.youtube.com/watch?v=vDcaFq6IEJM
Jee-Bee
Posts: 1940
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Another approach to assembly solver (A2plus)

Postby Jee-Bee » Mon Jul 16, 2018 2:05 pm

project4 wrote:
Mon Jul 16, 2018 1:25 pm
Hmmm... You should probably do something to deal with that.

As far as I know FreeCAD file keeps all its elements in the same file, no need for separation.
For large projects I agree that it makes sense to have every part in its file and have sub-assemblies as well, but having that restriction sounds strange and not intuitive with the rest of the FreeCAD look and feel.

Maybe you should create your own tree group like Assembly3 is doing and store there all assembly related.
ASM3 also have assembly related actions when you right-click on the assembly entry in the tree...
That every part have it's own file is quite common with in mechanical engineering (machienbouw (NL)/ Maschinenbau (DE) it's a pity that englisch don't have a word for it.) And it is great to have such possibilities within FC. May at some point both will be possible but i think A2 wasn't able to do it eighter. Maybe A# but i'm not sure.
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Another approach to assembly solver (A2plus)

Postby project4 » Mon Jul 16, 2018 2:07 pm

kbwbe wrote:
Mon Jul 16, 2018 1:43 pm
It is not intended to create a new feature-monster, as my resources (time) are limited. A2plus shall be a replacement for Hamish's Assembly 2 workbench. The workflow is similar and many people like it. So i will keep it alive. If A3 with its workflow is appreciated by you, no problem with that. Use it.
Hey, that was a feedback, not an offence, hope you don't take it that way.
There are good things in A3, but realthunder took it to the extreme from the developer point of view: as many options as possible and its not yet mature to work with it.
As I read in the thread, you're a mechanical assembly engineer and want to keep A2P as simple as possible, so I hope the WB will be more user-friendly than A3.
I'm a developer myself, but I stick to the KISS principles as well.

Are you ok if I'll check the code and push a PR to your stream that will place all A2P elements in its own group in the tree (and maybe in the file as well), so it will be compatible with other workbenches?

From the workflow point of view, it should be the same as in A2.
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Another approach to assembly solver (A2plus)

Postby project4 » Mon Jul 16, 2018 2:32 pm

Some food for thoughts:
If I click on the wrong constraint button, the code will warn me that I have a wrong selections.
For example, selecting 2 planes and trying to create point to line constraint (and other types as well).

Meaning the code knows what type of the selection is done (point, line, plane, circle etc.) and try to match those to the requirements of the constraint.
So... Why should the user choose the constraint type if it can be automatically derived from the selected items?
If 2 points are selected, so it's obvious that it should be point to point constraint.
If 2 lines are selected, so its probably line-on-line constraint.

Ofcause there are cases with multiple options, like plane-to-plane, should those be connected or only parallel?
I think an auto-constraint option could be very user friendly in that case and save some time during the work.
The default option could be the one that binds the 2 selected objects to each other (binds is the right word? I mean like glues them, leaving no movement options), all other options should be specifically selected by the user.

Just to clarify, I'm not proposing to create a monster-futured-WB, I'm just thinking what will be best way to have an easy to use assembly since that's the module I need the most in order to use the FreeCAD for my needs.
User avatar
jpg87
Posts: 278
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Another approach to assembly solver (A2plus)

Postby jpg87 » Mon Jul 16, 2018 4:47 pm

kbwbe wrote:
Fri Jul 13, 2018 2:55 pm
jpg87 wrote:
Fri Jul 13, 2018 1:21 pm
kbwbe wrote:
Tue Jul 10, 2018 8:21 pm
@jpg87
thank you for testing...
Answers to your questions:
- test remaining movements after constraining: ATM nothing special implemented, just move/rotate part manual away and solve again. You will see what is missing.
This is not what I wanted to say: when several solids are in chain, it is interesting to move the last to see if others follow in accordance with the predefined constraints, in fact test the validity of the mechanism.
@jpg87
Now i understand your question. You want to move last part in chain, intermediate parts should follow.
Perhaps you can work with some workarounds.

1)
- Import a dummy part. Perhaps a box or cylinder, what ever you need.
- Fix the endpart of chain. Move the dummy part by some helper constraints to the endpart.
- Fix the dummy part, unfix the endpart.
- Modify the helper constraints (e.g. offset, angle) and your chain should begin to move.
- If you do not like to see the dummy, make it invisible. Constraints will still be working.

So you can move your endpart relative to the dummy part in a definite way and you can check the behaviour of your chained objects..

2)
Perhaps it also possible, only to fix your endpart and then move it by placement. You have to solve then manually.

P.S. Look at my movable platform example some posts before. if i would replace the circularedge constraints in cylinders by axis constraints, fix the platform, then i can move the platform by placement and have a look what the cylinders are doing.
Thanks for your advice. I will test.
My website : http://help-freecad-jpg87.fr updated 2018/10/17
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Another approach to assembly solver (A2plus)

Postby project4 » Mon Jul 16, 2018 5:16 pm

Can someone send me large and complex Assembly2 files, but those that are using simple constraints that already exist in A2P?
I'll try to import those to A2P format, so we could have large assemblies to create pressure on the solver...
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Another approach to assembly solver (A2plus)

Postby project4 » Mon Jul 16, 2018 5:42 pm

Is there an efficient method to reload the WB python scripts besides closing and reopening the whole FreeCAD?
Looks like switching to another WB and back to A2B didn't help :(