Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Postby manuelkrause » Tue Oct 23, 2018 5:55 pm

Turro75 wrote:
Tue Oct 23, 2018 5:48 pm
Hey Guys,

I'm still alive, very busy at work but alive.

@Kbwbe I'm really impressed by Your whole work

@Manuelkrause in the end You are becoming a serious Python developer ;)
the sequence of selection became obsolete after the introduction of DOF handling.

see You on the air!
Nice to read you again, Valerio!
But on the air?!
ATM I don't understand this from you: "the sequence of selection became obsolete after the introduction of DOF handling."
What do you refer to with "sequence of selection" ?

Best regards

EDIT: I now understood what you've written. Except for the
"see You on the air!"
Turro75
Posts: 166
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Postby Turro75 » Tue Oct 23, 2018 6:17 pm

It is a silly sentence I used in the past to say good bye.... Forget it.... :roll:
kbwbe
Posts: 853
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Tue Oct 23, 2018 6:42 pm

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.26b, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
anisim (deutsch): https://www.youtube.com/watch?v=vDcaFq6IEJM
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Postby manuelkrause » Tue Oct 23, 2018 6:43 pm

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
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: Another approach to assembly solver (A2plus)

Postby triplus » Tue Oct 23, 2018 9:22 pm

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: 383
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Postby dcapeletti » 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
Attachments
FreeCAD_2018-10-24_09-08-55.png
FreeCAD_2018-10-24_09-08-55.png (133.43 KiB) Viewed 316 times
User avatar
dcapeletti
Posts: 383
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Postby dcapeletti » 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
Turro75
Posts: 166
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Postby Turro75 » 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
User avatar
dcapeletti
Posts: 383
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Postby dcapeletti » Wed Oct 24, 2018 4:16 pm

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: 383
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Postby dcapeletti » 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