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!
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (assembly2relaunch)

Post by kbwbe »

Hello everyone,

find new version here: https://github.com/kbwbe/A2plus

What's changed:
- Issue #5 fixed. A new button has been added. You can toggle the mode of automatic solving constraints to ON or OFF
This is a function a user asked for as he is working with some bigger assemblies.
An icon will follow with next versions. I tried to fix the problem quickly.

Find new button in A2plus toolbar,

- see here:
.
toggle-autosolve.png
toggle-autosolve.png (75.1 KiB) Viewed 1615 times
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
JamesF
Posts: 3
Joined: Wed Jul 04, 2018 10:20 am

Re: Another approach to assembly solver (assembly2relaunch)

Post by JamesF »

Hello Kbwbe,

Thank you for taking on the challenge of creating an assembly workbench.
I'm not an experienced user, but find the Assembly2 workbench very useful, so a better version is much appreciated.

You asked for some feedback, so I'll give it a shot:
- I am running Freecad 0.17 build 13522 on a windows 10 PC.
- I install A2plus by unzipping into the "Roaming\Macro\Mod" directory, though there is a "Roaming\Mod" directory I have tried too.
- On a fresh start of Freecad, I create a new project, select A2plus WB, and attempt to add an object (attached). This causes Freecad to hang with "importing project files" and eventually I need to shut it down. Had this behavior on the previous version of A2plus too.
pcbBlank.FCStd
(233.46 KiB) Downloaded 69 times
- If instead I draw a simple object, then switch to the A2plus WB, I can add a part OK. Actually, tried it a second time and it locked up too.
- It could be that it takes a very long time to load, not an issue with Assembly2.
- Plane coincident constraint seems to work OK, but there is no button for setting the direction. I can alter this in the property window but a button was useful.

Hope this is somehow useful,
James.
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (assembly2relaunch)

Post by kbwbe »

Hi @JamesF,

thank you for feedback.
I will have a look at your file...

- In generally Assembly 2 and A2Plus are not interoperable, so should better do not work with it on files created with Assembly 2
- Your problem with adding files: I think i know the error and will work on it towards release 0.1 of A2plus. (within few weeks)
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
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Another approach to assembly solver (assembly2relaunch)

Post by Jee-Bee »

kbwbe wrote: Wed Jul 04, 2018 2:54 pm - In generally Assembly 2 and A2Plus are not interoperable
don't used a2p yet but would be cool if possible (somewhere in the future... ;) )
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (assembly2relaunch)

Post by kbwbe »

Hi everyone,

find new version of A2Plus here: https://github.com/kbwbe/A2plus

What's new:
- removed buggy stuff from file importer. Importer now does not get stuck anymore with testpart of user @JamesF
- allowed to import files with more than one visible part. (But all bodies have to be in a part container !)

I could now import the pcbBlankd.FCStd of @JamesF and assemble it to an array.
.
See here:
.
Improved-Importer.png
Improved-Importer.png (127.76 KiB) Viewed 1511 times
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
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (assembly2relaunch)

Post by manuelkrause »

First of all I want to thank YOU ALL for making possible a new easy assembly module!
It's highly appreciated. I have tried and modified assembly2 in 2018/03 on my own but it led to frustration due to the solver not being powerful enough for larger assemblies.

I've read the related threads and remain enthusiastic. I'm no programmer at all but want to help if possible.

ATM I'm trying to try the actual one of this thread but get stuck before using it. These errors may be due to me using openSUSE tumbleweed or not having updated python and FC 0.17 for some weeks. Or it may be due to the aforementioned Qt5/Python3 migrations.

My error log:
FreeCAD-Error.20180705.log
(2.66 KiB) Downloaded 52 times
My fixes so far:
a2p.20180705.txt
(9.77 KiB) Downloaded 89 times
consider it as diff patch

Is there someone who can help me over the last error?

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

Re: Another approach to assembly solver (assembly2relaunch)

Post by kbwbe »

thank you Manuel for your very detailed feedback.
I will fix the bugs soon.

KBWBE
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
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (assembly2relaunch)

Post by kbwbe »

@manuelkrause,

all bugs which you have found are fixed. (I hope i did not forget something )
Please find new version here: https://github.com/kbwbe/A2plus

Thank you again for your detailed feedback.
Please test again.
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
JamesF
Posts: 3
Joined: Wed Jul 04, 2018 10:20 am

Re: Another approach to assembly solver (assembly2relaunch)

Post by JamesF »

Hello Kbwbe,

I have just installed your update - works brilliantly :D :D :D
That is a really good response to my problem.

I have now used your workbench to assemble a number of components and have not had any issues with the solver.
Works every time, with all my parts. I am only using coincident plane and axial constraints at the moment.

I will test further over the next few days and will reply then.

Another request(s) - if you are in the mood:
- Plane constraint has a setting "direction" with values "none/aligned/opposed".
What does "none" mean?
Can you add a button to swap "aligned" and "opposed" on the last constraint added?
I did find this useful in Assembly2 and altering a setting in the property window is awkward.
- Axial constraint has a "lock rotation" setting.
Again, this is useful (prevents screws turning etc), but awkward through the property window.

Otherwise, this is a very useful working addition to Freecad - especially for us amateurs.

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

Re: Another approach to assembly solver (assembly2relaunch)

Post by kbwbe »

Helllo @JamesF,

good to see that my workbench is working as expected for you.

Your Questions:
- direction "none" means: The solver looks for the shortest way(rotation angle) to match the constraint.
I am mostly working with that option. I rotate the parts nearly correct by hand and i create the first constraint after that. This way is fine
working with direction "none". You can rotate a part manually by double click in the object tree.

- lock rotation: a little bit difficult to implement as way how solver is working (Perhaps i have an idea in future, but not yet...)

- flip "aligned/opposed" via button: Should be possible, but has to wait. To much to do on other problems of this WB.
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