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!
Turro75
Posts: 179
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Post by Turro75 »

It is a silly sentence I used in the past to say good bye.... Forget it.... :roll:
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 »

Turro75 wrote: Tue Oct 23, 2018 5:48 pm I'm still alive, very busy at work but alive.
Hey Turro !! I am very glad to hear from you. I hope i see you here back on place in some time ! :D
There is enough work waiting...
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 »

Turro75 wrote: Tue Oct 23, 2018 6:17 pm It is a silly sentence I used in the past to say good bye.... Forget it.... :roll:
No no, no problem at all. I just only needed to understand it.
O.k.: ...
I hope to "see you on the air" soon again! Dunno if it's correct english.
It reminds me of a beautiful Phil Collins' song... (where "in" is used instead of "on")
:mrgreen:
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Another approach to assembly solver (A2plus)

Post by triplus »

kbwbe wrote: Tue Oct 23, 2018 6:39 am Thank you very much for your feedback.
You're welcome. And thank you for the work you (and others) are doing.
It's not inside code ATM. During rework of Assembly 2 towards A2plus i messed out everything i did not need at this point, to avoid bugs. I will reimplement it in some time.
That explains it. Thanks.
User avatar
dcapeletti
Posts: 504
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Post by dcapeletti »

Hello, I have done a simple practice of connecting rod, piston, crankshaft. See https://forum.freecadweb.org/viewtopic. ... 10#p264078

Now what I would like to achieve is an animation. For example when I change the crankshaft angle using the python API with this command:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(-90,0,0), App.Vector(0,0,0)) 
A2Plus automatically resolves the constraints. Maybe there is an A2plus API that allows you to solve the constraints. Attached image.

Thanks
Attachments
FreeCAD_2018-10-24_09-08-55.png
FreeCAD_2018-10-24_09-08-55.png (133.43 KiB) Viewed 1627 times
User avatar
dcapeletti
Posts: 504
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Post by dcapeletti »

dcapeletti wrote: Wed Oct 24, 2018 12:05 pm Hello, I have done a simple practice of connecting rod, piston, crankshaft. See https://forum.freecadweb.org/viewtopic. ... 10#p264078

Now what I would like to achieve is an animation. For example when I change the crankshaft angle using the python API with this command:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(-90,0,0), App.Vector(0,0,0)) 
A2Plus automatically resolves the constraints. Maybe there is an A2plus API that allows you to solve the constraints. Attached image.

Thanks
Solved:

In python console:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(0,0,0), App.Vector(0,0,0)) 

from a2p_solversystem import SolverSystem
solver  = SolverSystem()
solver.solveSystem(App.ActiveDocument)
Thanks
Turro75
Posts: 179
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Post by Turro75 »

dcapeletti wrote: Wed Oct 24, 2018 12:32 pm
dcapeletti wrote: Wed Oct 24, 2018 12:05 pm Hello, I have done a simple practice of connecting rod, piston, crankshaft. See https://forum.freecadweb.org/viewtopic. ... 10#p264078

Now what I would like to achieve is an animation. For example when I change the crankshaft angle using the python API with this command:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(-90,0,0), App.Vector(0,0,0)) 
A2Plus automatically resolves the constraints. Maybe there is an A2plus API that allows you to solve the constraints. Attached image.

Thanks
Solved:

In python console:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(0,0,0), App.Vector(0,0,0)) 

from a2p_solversystem import SolverSystem
solver  = SolverSystem()
solver.solveSystem(App.ActiveDocument)
Thanks
If You are confortable in editing sources, try change in a2p_solversystem.py

Code: Select all

SOLVER_CONTROLDATA = {
    #Index:(posAccuracy,spinAccuracy,completeSolvingRequired)
    1:(0.1,0.1,True),
    2:(0.01,0.01,True),
    3:(0.001,0.001,True),
    4:(0.0001,0.0001,False),
    5:(0.00001,0.00001,False)
    }
to

Code: Select all

SOLVER_CONTROLDATA = {
    #Index:(posAccuracy,spinAccuracy,completeSolvingRequired)
    1:(0.1,0.1,True)
    #2:(0.01,0.01,True),
    #3:(0.001,0.001,True),
    #4:(0.0001,0.0001,False),
    #5:(0.00001,0.00001,False)
    }
this should speed up the solving process (by reducing accuracy) increasing animation speed
User avatar
dcapeletti
Posts: 504
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Post by dcapeletti »

Turro75 wrote: Wed Oct 24, 2018 3:33 pm
dcapeletti wrote: Wed Oct 24, 2018 12:32 pm
dcapeletti wrote: Wed Oct 24, 2018 12:05 pm Hello, I have done a simple practice of connecting rod, piston, crankshaft. See https://forum.freecadweb.org/viewtopic. ... 10#p264078

Now what I would like to achieve is an animation. For example when I change the crankshaft angle using the python API with this command:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(-90,0,0), App.Vector(0,0,0)) 
A2Plus automatically resolves the constraints. Maybe there is an A2plus API that allows you to solve the constraints. Attached image.

Thanks
Solved:

In python console:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(0,0,0), App.Vector(0,0,0)) 

from a2p_solversystem import SolverSystem
solver  = SolverSystem()
solver.solveSystem(App.ActiveDocument)
Thanks
If You are confortable in editing sources, try change in a2p_solversystem.py

Code: Select all

SOLVER_CONTROLDATA = {
    #Index:(posAccuracy,spinAccuracy,completeSolvingRequired)
    1:(0.1,0.1,True),
    2:(0.01,0.01,True),
    3:(0.001,0.001,True),
    4:(0.0001,0.0001,False),
    5:(0.00001,0.00001,False)
    }
to

Code: Select all

SOLVER_CONTROLDATA = {
    #Index:(posAccuracy,spinAccuracy,completeSolvingRequired)
    1:(0.1,0.1,True)
    #2:(0.01,0.01,True),
    #3:(0.001,0.001,True),
    #4:(0.0001,0.0001,False),
    #5:(0.00001,0.00001,False)
    }
this should speed up the solving process (by reducing accuracy) increasing animation speed
Thanks. If I like to edit and learn from the code, although I don't work with FreeCAD, I like to learn from it. I'll try what you say and make returns.

I wonder what the result will be of connecting an animation module combined with an assembly module.

Greetings
User avatar
dcapeletti
Posts: 504
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Post by dcapeletti »

Hi, I'd like you to look at this comment https://forum.freecadweb.org/viewtopic. ... 00#p264527 to see if it's possible to implement such functionality in A2Plus.

Thanks
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 »

dcapeletti wrote: Thu Oct 25, 2018 8:33 am Hi, I'd like you to look at this comment https://forum.freecadweb.org/viewtopic. ... 00#p264527 to see if it's possible to implement such functionality in A2Plus.

Thanks
Hi,
i will have look for this problematic. I need similar thing too.
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