Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Another approach to assembly solver (A2plus)

Postby vocx » Sat Feb 22, 2020 4:01 am

kbwbe wrote:
Tue Feb 04, 2020 11:52 pm
ping
I have a small question. I was collecting some documentation on the assembly workbenches to place on the wiki, so I was wondering if there was a single A2plus tutorial that you can consider a reference tutorial for learning to use this workbench.

It seems some users have prepared tutorials for Assembly3, and Zolko has written tutorials for Assembly4, so I was wondering if there is a basic, everybody-must-know tutorial for A2plus.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
jbe
Posts: 279
Joined: Sun Nov 10, 2013 4:18 pm
Location: France, Châteauroux

Re: Another approach to assembly solver (A2plus)

Postby jbe » Sat Feb 22, 2020 8:12 am

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

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sat Feb 22, 2020 9:51 am

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.47e, 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
Posts: 8405
Joined: Thu Jan 05, 2017 9:03 pm

Re: Another approach to assembly solver (A2plus)

Postby Kunda1 » Sun Mar 15, 2020 8:15 pm

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.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Another approach to assembly solver (A2plus)

Postby triplus » Sat Apr 25, 2020 9:44 am

Hi @kbwbe
A2plus.png
A2plus.png (28.34 KiB) Viewed 740 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
Posts: 1750
Joined: Tue Jan 03, 2017 10:55 am

Re: Another approach to assembly solver (A2plus)

Postby realthunder » Sat Apr 25, 2020 11:42 am

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 (latest version 0.11) 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: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Another approach to assembly solver (A2plus)

Postby triplus » Sat Apr 25, 2020 12:07 pm

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

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Apr 26, 2020 9:28 am

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.47e, 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: 161
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Postby dan-miel » Sun Apr 26, 2020 11:54 am

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 649 times
a2p_solversystem.py
(35.62 KiB) Downloaded 22 times
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Another approach to assembly solver (A2plus)

Postby triplus » Sun Apr 26, 2020 12:25 pm

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.