Another approach to assembly solver (A2plus)
Another approach to assembly solver (A2plus)
Hi,
there is a lot of talking about solving an assembly here within the forum.
I developed a small prototype of yet another solver. It is in a very early state now and is only capable to handle plane/circularedge/axis-constraints.
But it can easily be extended. It consist only of one file, which is attached.
The base concept is inspired by physics. Forces(Distances from point to targetpoints) will cause moves and rotations around a spin-center. Also axis-alignments will cause "torque" and cause spinning around. The solver is working iteratively.
It is just a prototype and many things are still missing. But the idea seems to work.
Have a look a the following to tests which i did.
- Test1: assembling some link-beams with circular edges
- Test2: assembling a hose-pump (with plane/circularEdges/axis-constraints)
Anyone interested? Suggestions ? Important improvements ? Someone who wants to help ?
Thanks,
kbwbe
UPDATE: Look for newest complete testworkbech at newer posts within this tread. (For Win and Linux now)
there is a lot of talking about solving an assembly here within the forum.
I developed a small prototype of yet another solver. It is in a very early state now and is only capable to handle plane/circularedge/axis-constraints.
But it can easily be extended. It consist only of one file, which is attached.
The base concept is inspired by physics. Forces(Distances from point to targetpoints) will cause moves and rotations around a spin-center. Also axis-alignments will cause "torque" and cause spinning around. The solver is working iteratively.
It is just a prototype and many things are still missing. But the idea seems to work.
Have a look a the following to tests which i did.
- Test1: assembling some link-beams with circular edges
- Test2: assembling a hose-pump (with plane/circularEdges/axis-constraints)
Anyone interested? Suggestions ? Important improvements ? Someone who wants to help ?
Thanks,
kbwbe
UPDATE: Look for newest complete testworkbech at newer posts within this tread. (For Win and Linux now)
- Attachments
-
solversystem.py
- (20.83 KiB) Downloaded 865 times
Last edited by kbwbe on Tue Jul 10, 2018 5:29 pm, edited 2 times in total.
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
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
Re: Another approach to assembly solver
Hi @kbwbe.
I see your work is somehow inspired by Assembly 2 workbench? Do you plan to create a new workbench? What you attached is i guess only a prototype of a potential solver? I would say create a workbench or extend the Assembly 2 workbench and see how that goes. If it will be able to assemble FreeCAD geometry in some straightforward way i am sure end users will use it.
I see your work is somehow inspired by Assembly 2 workbench? Do you plan to create a new workbench? What you attached is i guess only a prototype of a potential solver? I would say create a workbench or extend the Assembly 2 workbench and see how that goes. If it will be able to assemble FreeCAD geometry in some straightforward way i am sure end users will use it.
Re: Another approach to assembly solver
Hi triplus,
thanks for your answer. Your are right. I am working with a refurbished assembly2-workbench. I like the base concepts of it very much and did some bigger projects with it. My adapted workbench is somehow ready for LINUX. I use it everyday. Unfortunately I have some problems with fc0.17 and therefore i am still staying with fc0.16
There are two mainproblems of assembly2:
- the solver often fails and does not find a solution. Therefore i started this work with new solver and integrated it into my workbench.
(it should work with assembly2 too)
- topological naming: If a part is been updated, very often the ordering of vertexes, edges and faces is changed.
Hamishs algorithm to recover the indexes is slow and fails very often.
I did a reduced form of toponaming (which is not perfect) only for use with the assembly workbench. But my scripts where blown up
by the fc0.17 body- and partcontainers.
Working within fc0.16, my simple toponaming improved importing parts to assembly very much. It is much more stable with it.
Have no problem to share the code if anyone is interested. Perhaps someone finds a solution to adapt the scripts to fc0.17.
How to share complete workbench ? Do not have a github-account or anything else... (and don't really want it)
kbwbe
thanks for your answer. Your are right. I am working with a refurbished assembly2-workbench. I like the base concepts of it very much and did some bigger projects with it. My adapted workbench is somehow ready for LINUX. I use it everyday. Unfortunately I have some problems with fc0.17 and therefore i am still staying with fc0.16
There are two mainproblems of assembly2:
- the solver often fails and does not find a solution. Therefore i started this work with new solver and integrated it into my workbench.
(it should work with assembly2 too)
- topological naming: If a part is been updated, very often the ordering of vertexes, edges and faces is changed.
Hamishs algorithm to recover the indexes is slow and fails very often.
I did a reduced form of toponaming (which is not perfect) only for use with the assembly workbench. But my scripts where blown up
by the fc0.17 body- and partcontainers.
Working within fc0.16, my simple toponaming improved importing parts to assembly very much. It is much more stable with it.
Have no problem to share the code if anyone is interested. Perhaps someone finds a solution to adapt the scripts to fc0.17.
How to share complete workbench ? Do not have a github-account or anything else... (and don't really want it)
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
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
Re: Another approach to assembly solver
Hi triplus,
good idea.
Find .zip attached.
UPDATE: Look for newest complete testworkbech at newer posts within this tread. (For Win and Linux now)
Installation-instructions:
- only for Linux (because of filehandling) and fc0.16 (will not work with fc0.17)
- before copying the extracted zip to your mod-folder, setup your CAD-folder (create a new one for testing!!!) according to this:
(you have to create a new entry "projectFolder" within the parameter-Editor.
- within CAD-folder each file ony has to exist one time or you get strange results.
- do NOT use this test-workbench with important work. It will mismatch existing assemblies. Use newly created files for testing.
- extract zip.archive, copy the a3-folder to your mod-folder.
- Start FreeCAD, work is very similar to assembly2. a3-Workbech should appear in available workbenches:
Be aware: new solver-prototype is active. You can have unexact solutions without warning. The solver has to be improved.
This is the first test in the free wild. I hope that it will work anyway.
Feel free to ask and do what you want with this code.
Klaus
good idea.
Find .zip attached.
UPDATE: Look for newest complete testworkbech at newer posts within this tread. (For Win and Linux now)
Installation-instructions:
- only for Linux (because of filehandling) and fc0.16 (will not work with fc0.17)
- before copying the extracted zip to your mod-folder, setup your CAD-folder (create a new one for testing!!!) according to this:
(you have to create a new entry "projectFolder" within the parameter-Editor.
- within CAD-folder each file ony has to exist one time or you get strange results.
- do NOT use this test-workbench with important work. It will mismatch existing assemblies. Use newly created files for testing.
- extract zip.archive, copy the a3-folder to your mod-folder.
- Start FreeCAD, work is very similar to assembly2. a3-Workbech should appear in available workbenches:
Be aware: new solver-prototype is active. You can have unexact solutions without warning. The solver has to be improved.
This is the first test in the free wild. I hope that it will work anyway.
Feel free to ask and do what you want with this code.
Klaus
- Attachments
-
- a3.zip
- (273.17 KiB) Downloaded 619 times
Last edited by kbwbe on Tue Jun 12, 2018 1:39 pm, edited 1 time in total.
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
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
Re: Another approach to assembly solver
I did a few quick tests (FreeCAD 0.17 and without messing with the folder instructions). I used some Draft Clone geometry in a single document. As for the short version your solver will solve:
P.S. Did noticed a combination of circular and plane relations can sometimes result in:
P.S. Did noticed a combination of circular and plane relations can sometimes result in:
Re: Another approach to assembly solver
thanks for testing
if possible please post the fcstd-file of the second image with not functional constraints..

if possible please post the fcstd-file of the second image with not functional constraints..
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
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
Re: Another approach to assembly solver
You're welcome.
Sure.if possible please post the fcstd-file of the second image with not functional constraints..
- Attachments
-
- a3.fcstd
- (10.56 KiB) Downloaded 534 times
Re: Another approach to assembly solver
thanks for the file. I can reproduce the problem and will have a look why this happens...
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
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
Re: Another approach to assembly solver
I am analyzing the problem. I have detected wrong spin-orientations of the parts during solving.
This work will need a little bit time. I have to an intensive check of the code.
Wondering that i did not recognize this in my tests before..
This work will need a little bit time. I have to an intensive check of the code.
Wondering that i did not recognize this in my tests before..
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
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