Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
User avatar
wandererfan
Posts: 3873
Joined: Tue Nov 06, 2012 5:42 pm

Re: Another approach to assembly solver (A2plus)

Postby wandererfan » Sat Aug 11, 2018 12:55 pm

kbwbe wrote:
Fri Aug 10, 2018 11:31 pm
as Turro and me are working on files which do no affect importing files to A2Plus, this is a good point to do a PR against devel branch regarding "a2p_importpart.py". Let's try out your ideas ! ;)
https://github.com/kbwbe/A2plus/pull/40

Not perfect, but good enough to show concept. Global placement needs to be applied to get import file components in right geometric relationship with each other. Crawler algo is brute force - could be smarter.
kbwbe
Posts: 949
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sat Aug 11, 2018 2:06 pm

wandererfan wrote:
Sat Aug 11, 2018 12:55 pm
kbwbe wrote:
Fri Aug 10, 2018 11:31 pm
as Turro and me are working on files which do no affect importing files to A2Plus, this is a good point to do a PR against devel branch regarding "a2p_importpart.py". Let's try out your ideas ! ;)
https://github.com/kbwbe/A2plus/pull/40

Not perfect, but good enough to show concept. Global placement needs to be applied to get import file components in right geometric relationship with each other. Crawler algo is brute force - could be smarter.
Hi wandererfan,
thank you for the pull request. I would prefer to have the PR against devel branch. So i can test it before merging to master. Is that possible ?
I only have basic knowledge of using Github. Perhaps you have a tip how i can manage this alone.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.47, 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
Posts: 949
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sat Aug 11, 2018 2:14 pm

@Turro75, @manuelkrause

Hi Guys,

i modified the devel branch. It is not really functionally now, so @manuel you do not need to test.

@Turro,

please have a look at this branch. I tried to integrate your DOF management to latest state of devel branch.
Especially look at:
- loadSystem(), + retrieveDOFInfo()
- calculateChain()
- rig.getCandidates()

I think the algorithm will be clearer this way. ATM i have the same effect: needs to press "solve" multiple.
Also only stage1 is implemented in rig.getCandidates(), so it does not fall back to "magnetic" mode and does not solve things to last parts.

Please have a look and tell me, whether it is possible to go this way which i started to implement or not ...
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.47, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
Turro75
Posts: 175
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Postby Turro75 » Sat Aug 11, 2018 5:06 pm

Got it working much better,
I'm forcing a recalculation of refPoint after each solve step.
fixed also a small bug that preb=vents to use all accuracy step, I think this was the reason of bad placement noticed by Manuel.

still some problem at last stage.

Sorry Kbwbe, I started rewriting after realising your last update.
Attachments
a2p_solversystem.py
(26.52 KiB) Downloaded 11 times
a2p_rigid.py
(17.39 KiB) Downloaded 13 times
a2p_libDOF.py
(26.84 KiB) Downloaded 14 times
a2p_dependencies.py
(35.5 KiB) Downloaded 12 times
User avatar
wandererfan
Posts: 3873
Joined: Tue Nov 06, 2012 5:42 pm

Re: Another approach to assembly solver (A2plus)

Postby wandererfan » Sat Aug 11, 2018 8:51 pm

kbwbe wrote:
Sat Aug 11, 2018 2:06 pm
I would prefer to have the PR against devel branch. So i can test it before merging to master. Is that possible ?
I only have basic knowledge of using Github. Perhaps you have a tip how i can manage this alone.
My status as an expert is questionable, but I believe you can edit the PR to go against another branch like this:
GitHub1.png
GitHub1.png (87.18 KiB) Viewed 277 times
GitHub2.png
GitHub2.png (92.75 KiB) Viewed 277 times
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Postby manuelkrause » Sat Aug 11, 2018 9:03 pm

Screenshot_20180811_222143.png
Screenshot_20180811_222143.png (41.27 KiB) Viewed 272 times

The new A2plus-Man, with some refined shapes and proportions and some weight loss. Completely assembled with last night's turro-DOF-1 branch, fully constrained except for left hand.
Unfortunately I had forgotten to re-check after every constraint in partial-solving with alltogether. There are several angledPlanes in it that most likely would not have gone through alltogether. And so does the end-result. Partial solves it, alltogether doesn't like it. ;-)
(BTW, the assembly_hierarchy visualisation in this branch is broken.)

Manuel
Turro75
Posts: 175
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Postby Turro75 » Sat Aug 11, 2018 11:15 pm

ok now everything should work as expected, not optimized yet but it start to be useable.

Also reactivated the assembly_hierarchy, now the filename is name of the assembly.html and it is placed in the same directory of the assembly.

@kwbwe may be the partial solving make sense only on first accuracy level, afterwards the advantage of partial against whole isn't clear to me.
BTW if You like, do refactoring as You want. then we can try profiling.

:evil: I HAVE to find a way to debug python on freecad...arghh!!!! :evil:

Does anybody know how to install eric ide within stabel freecad python (2.7.14) environment?
Attachments
a2p_libDOF.py
(26.84 KiB) Downloaded 16 times
a2p_dependencies.py
(35.5 KiB) Downloaded 15 times
a2p_solversystem.py
(27.05 KiB) Downloaded 11 times
a2p_rigid.py
(17.49 KiB) Downloaded 19 times
kbwbe
Posts: 949
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Aug 12, 2018 9:49 am

wandererfan wrote:
Sat Aug 11, 2018 8:51 pm
... but I believe you can edit the PR to go against another branch like this:
Hi @wandererfan,
thank you for your 2'nd PR. Editing (rebasing) a PR is no problem anymore. Tx for the hints.
I opened new branch "rework-importer" and merged your PR there. I will test !
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.47, 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
Posts: 949
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Aug 12, 2018 10:27 am

Turro75 wrote:
Sat Aug 11, 2018 11:15 pm
ok now everything should work as expected, not optimized yet but it start to be useable.
Hi Turro,
your new version seems to be better. Now it solves the last two small test-assemblies. :D

Now i did tests with 3 bigger assemblies (attached):
"pump-2018-07-26.fcstd" ==>> solved :D
"16081-frame..." ==>> not solved (convergency problems) :(
"ZSB-KBWBE-...." ==>> not solved (convergency problems) :(

Turro75 wrote:
Sat Aug 11, 2018 11:15 pm
@kwbwe may be the partial solving make sense only on first accuracy level, afterwards the advantage of partial against whole isn't clear to me.
BTW if You like, do refactoring as You want. then we can try profiling.
Partial solving makes sense even on higher accuracy levels, as it is stabilising calculations.

What was the problem why we had to hit the "solve" button multiple ? The problem is away now. Please give the code-snippet how it was fixed.

/Edit1: Find new branch "turro-dof-2", based on actual master, completed with your changes...
Attachments
ZSB-KBWBE-disruppted.fcstd
(41.87 KiB) Downloaded 7 times
16081-frame-assembly-with-partial-system.fcstd
(426.85 KiB) Downloaded 7 times
pump-2018-07-26.fcstd
(761.12 KiB) Downloaded 6 times
KBWBE

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