Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
jbe
Posts: 368
Joined: Sun Nov 10, 2013 4:18 pm
Location: France, Châteauroux

Re: Another approach to assembly solver (A2plus)

Post by jbe »

kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Post by kbwbe »

vocx wrote: Sat Feb 22, 2020 4:01 am ... I was wondering if there was a single A2plus tutorial that you can consider a reference tutorial for learning to use this workbench.
There isn't one within this form.

In case of help requests, i usually provide these two links:

1) Documentation, which is always up to date: https://freecadweb.org/wiki/A2plus_Workbench
2) A video with the basic A2plus workflow, the gripper assembly tutorial: https://www.youtube.com/watch?v=QMxcQ5tssWk

I think i will prepare a basic tutorial including all necessary parts at Github next time.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Another approach to assembly solver (A2plus)

Post by Kunda1 »

phpBB [video]

This is cool but the only thing that is cringe-worthy is the amount of superfluous mouse clicks and dragging are employed by the user. Notice how the Constraint dialog keeps getting moved by the user.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Another approach to assembly solver (A2plus)

Post by triplus »

Hi @kbwbe
A2plus.png
A2plus.png (28.34 KiB) Viewed 2162 times
If i remember correctly this was already discussed to some extent, but i currently don't remember the details. Will therefore just ask. Any chance of making circular edge constraint to work in such scenarios? It is obvious on why it currently doesn't work, no shape.
realthunder wrote:
Any opinion on this?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Another approach to assembly solver (A2plus)

Post by realthunder »

triplus wrote: Sat Apr 25, 2020 9:44 am If i remember correctly this was already discussed to some extent, but i currently don't remember the details. Will therefore just ask. Any chance of making circular edge constraint to work in such scenarios? It is obvious on why it currently doesn't work, no shape.
The key is to be able to find the selected object hierarchy. The following code will print out the current selected object hierarchy and obtain the shape at the correct placement.

Code: Select all

import Part
for sel in Gui.Selection.getSelectionEx('', 0):
	for sub in sel.SubElementNames:
		print('%s.%s' % (sel.Object.Name, sub))
		Part.getShape(sel.Object, sub, needSubElement=True)
Try Assembly3 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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Another approach to assembly solver (A2plus)

Post by triplus »

Thanks for providing the feedback and the code snippet example.
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Post by kbwbe »

triplus wrote: Sat Apr 25, 2020 9:44 am Any chance of making circular edge constraint to work in such scenarios?
Hi @triplus,
basicaly, that's possible. But parts of A2plus have to be redesigned. So the loadSystem() function of the solver must be made capable to handle the more complex object structure. Also all code which relates to selections has to be replaced by something like the code snippet of @realthunder, shown above.

Doing so, this will end up in a new WB which probably will not be compatible with the "old" A2plus.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Post by dan-miel »

kbwbe, I changed more in the "a2p_solversystem" I took and added some more ideas for checking constraints and stuck everything in the a2p_solversystem file. After finding the first constraint it checks every constraint on that part to see which is causing the conflict. I probably missed something but I think the basic concept is there. I also changed the message box so a person can check constraints without closing the form. We can also copy paste the names to another file.
Just drop the a2p_solversystem.py in and start you Rubics cube.
PS. save a backup first.
Dan.
I hope this works.
Attachments
Solver picture.JPG
Solver picture.JPG (23.59 KiB) Viewed 2071 times
a2p_solversystem.py
(35.62 KiB) Downloaded 54 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Another approach to assembly solver (A2plus)

Post by triplus »

kbwbe wrote: Sun Apr 26, 2020 9:28 am Hi @triplus,
basicaly, that's possible. But parts of A2plus have to be redesigned. So the loadSystem() function of the solver must be made capable to handle the more complex object structure. Also all code which relates to selections has to be replaced by something like the code snippet of @realthunder, shown above.

Doing so, this will end up in a new WB which probably will not be compatible with the "old" A2plus.
Thanks for the explanation and i guess i see the dilemma. A lot of work involved and hard to maintain the backwards compatibility. As i currently use A2plus the most, for my assembly needs, workflow without using Links it is then.
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Post by kbwbe »

dan-miel wrote: Sun Apr 26, 2020 11:54 am I changed more in the "a2p_solversystem" I took and added some more ideas for checking constraints and stuck everything in the a2p_solversystem file. After finding the first constraint it checks every constraint on that part to see which is causing the conflict. I probably missed something but I think the basic concept is there.
Hi Dan,
thanks for all your work. I took up your ideas and implemented a new command to A2plus, in order to find the conflicting constraints.

Updating to new version A2plus V0.4.47, you will find this new button:
newButton.png
newButton.png (3.37 KiB) Viewed 3043 times
This command solves the constraints one after another and is showing the first conflicting constraint which can be deleted instantly, if wanted.
I hope it works.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
Post Reply