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 (A2plus)

Post by kbwbe »

Hi Manuel,

take circularEdgeConstraint, in total there is less overhead and it is faster..

P.S. Sorry, forgot to answer second question...
Update Parts does not work recursively ATM. I had been in code some time ago and could be reactivated. You find relicts in ap2_versionmanagment.py But as updateParts is critical for some other reasons (it will damage constraints within 80% of all cases) i decided not to do use it recursively yet.
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 (A2plus)

Post by manuelkrause »

Hi @kbwbe,

thank you, I'd try more with circularEdgeConstraint.
Adjusting sub-assemblies seems to impose a higher level of calculations for the solver. For now, I've often used "preliminary" (how I'd call them) constraints to pre-locate a subassembly, remove them and then kick in the proper constraint. Does often work, but not always.

Just keep up your good work! I'm also interested in the improvements that come with @Turro75's inspirations and your related thoughts.

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 (A2plus)

Post by kbwbe »

Hi Manuel,
manuelkrause wrote: Wed Jul 11, 2018 7:34 pm
adjusting sub-assemblies seems to impose a higher level of calculations for the solver. For now, I've often used "preliminary" (how I'd call them) constraints to pre-locate a subassembly, remove them and then kick in the proper constraint. Does often work, but not always.

Manuel
.
I hope this is not an effect of growing dimensions. If possible put a dummy part (perhaps a big box) with similar dimensions as the subassembly to mainassembly, constraint it and try out wether your problems remain or not. Results would be important.
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 (A2plus)

Post by manuelkrause »

Regarding your EDIT at P.S.
We just need to know it. Within assembly2 from hamish2014 it didn't always work safely, too.
What do you propose as work-flow, e.g. when changing a (bottom, or name it root) part in one subassembly?
I practically need to do such things in near future, as I obviously miscalculated some important distances for the final assembly.

I've seen your last posting and will follow your instructions, but it may take up to tomorrow.
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

@kbwbe:

Sorry, I dont get your point regarding my task. I just assemble the needed subassemblies into the engines' top casing assembly (fixed). Working. Add the crankshaft, working. Adding the piston rod subassembly is my current task for constraining.

There is almost no sub-assembly that is suitable for a replacement by a simple box, as I mostly only use circular constraints.

Just feel free to advise me for some other ways,

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 (A2plus)

Post by kbwbe »

manuelkrause wrote: Wed Jul 11, 2018 7:57 pm
What do you propose as work-flow, e.g. when changing a (bottom, or name it root) part in one subassembly?
I practically need to do such things in near future, as I obviously miscalculated some important distances for the final assembly.
Hi Manuel,
this is the worst horror-scenario for using Assembly 2 and A2plus at moment. You should assume that all constraints to root part will break.
You should switch off autosolving. Then fix all parts which are directly constrained to root part. In next step, delete all constraints of the root.
For this, you can select it and use the button in toolbar "deleteConstraints". This will delete all constraints of root with one click.

Update your rootpart.

Start constraining again, and set fixedPosition=False to those parts which are constrained again. Save file. Try to solve manually.
Repeat as often as all parts are newly fixed to root.

I hope we get topological naming within FreeCAD in future. It is essential. When available, these problems are easy to solve automatically.
I had a solution for FC0.16 with an own topoNamer. It worked mostly fine. Since FC0.17, i can not use it anymore. :( It was possible to update parts and subassemblies without corrections manually. A replacement will be urgently needed.
Last edited by kbwbe on Wed Jul 11, 2018 9:19 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
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

Current state looks like:
(see working constraints at left side in Tree view)

Screenshot_20180711_230137.png
Screenshot_20180711_230137.png (518.83 KiB) Viewed 1385 times

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 (A2plus)

Post by kbwbe »

Hi @Turro75,

i added just one new assembly to my standard test cases. Please think about right ordering of constraints ! :D :D :D
It is a funny thing. Each constraint is looping back to each other. It can only be solved as whole system. If thinking about sorting algorithms,
we will always have to look at such constraint loops too.

See test case here:
.
Movable-Platform.png
Movable-Platform.png (217.17 KiB) Viewed 1352 times
.
For everyone, who want's to play with this assembly, i attached the file. Change the circularEdgeConstraints/offset in small steps and look
what happens. ;)

A2plus seems to work pretty with it.

P.S. I made a copy of the file, deleted all constraints and tried, to reassemble it with Assembly 2 to compare behavior. For me, i had no chance.
Solver of Assembly 2 failed after few constraints.

You can find A2plus here: https://github.com/kbwbe/A2plus
Attachments
Assembly-Platform-6DOF.fcstd
(34.48 KiB) Downloaded 48 times
Last edited by kbwbe on Thu Jul 12, 2018 8:32 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
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

Hi @kbwbe:
Just don't recall whether it has been asked on here already, whether you consider it useful or whether it conflicts with FreeCAD in general:
Would it be possible to implement a way to temporarily disable a constraint and make it active again later on? (Just comparable with @Turro75's description of solidworks.) I ATM make some progress with my engine's assembly with fixing sub-assemblies and deleting previous constraints to make it easier for the next addition and constraining of another sub-assembly. Re-constraining the not intended fixed ones, you'd likely understand, doesn't really make fun.
Maybe it's something for your "feature request list", to be added in some future.

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 (A2plus)

Post by kbwbe »

Hi Manuel,

you seem to have a lot of difficulties with my proposed workflow. It is hard to understand, but necessary, you have to delete constraints and reconstraint parts which you want to update (in mostly all use cases).

Disabling such constraints combined with later enabling of them will usually not work, as constraints are already broken when reimporting a part.. So your problems will only happen to later point of time.

The proposals of @Turro75 aim at some other thematics. His "tempfixing" of parts shall optimize the solver algorithm. It has nothing to do with reimporting / updating parts. This is another topic.

Sorry but no better news...

You can find A2plus here: https://github.com/kbwbe/A2plus
Last edited by kbwbe on Thu Jul 12, 2018 8:44 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
Post Reply