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!
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

@kbwbe:
Can you please, with your next commits, fix the wrong "print" without brackets?
And this other one in devel-branch:
-> inconsistent use of tabs and spaces in indentation (a2p_rigid.py, line 172)

@wandererfan:
Thank you for taking care of the visibility of PartContainers!

I've tested it across a chain of subassemblies, and when properly updating imported parts in the intermediate subassemblies everything remains consistent (visible/invisible as selected in the very first .fcstd part).
Very good work indeed, thank you!

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 »

manuelkrause wrote: Wed Aug 15, 2018 11:29 am Can you please, with your next commits, fix the wrong "print" without brackets?
Did you find false prints in "devel" branch ? If yes, where ?
If you found them in branch "turro-dof-3", then @Turro75 should fix this within his PR's.
Otherwise i have to redo this after each merge.
manuelkrause wrote: Wed Aug 15, 2018 11:29 am And this other one in devel-branch:
-> inconsistent use of tabs and spaces in indentation (a2p_rigid.py, line 172)
I fixed it in devel branch...
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 »

kbwbe wrote: Wed Aug 15, 2018 12:15 pm
manuelkrause wrote: Wed Aug 15, 2018 11:29 am Can you please, with your next commits, fix the wrong "print" without brackets?
Did you find false prints in "devel" branch ? If yes, where ?
If you found them in branch "turro-dof-3", then @Turro75 should fix this within his PR's.
Otherwise i have to redo this after each merge.
manuelkrause wrote: Wed Aug 15, 2018 11:29 am And this other one in devel-branch:
-> inconsistent use of tabs and spaces in indentation (a2p_rigid.py, line 172)
I fixed it in devel branch...
It's line 287 in a2p_importpart.py:
print "imported Object is empty/none"
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 Aug 15, 2018 12:21 pm It's line 287 in a2p_importpart.py:
print "imported Object is empty/none"
Fixed in "devel" branch.
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 »

kbwbe wrote: Wed Aug 15, 2018 12:30 pm Fixed in "devel" branch.
Thank you!
Now I'm only waiting for your fix for "recalculating the refPointsBoundBoxSize when calculating the spincenter"...
:-D

(Edited wrong copy/paste)
Last edited by manuelkrause on Wed Aug 15, 2018 4:05 pm, edited 1 time in total.
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

@kbwbe:
I hope you allow me some nitpicking before going for release...
IMO two points should be fixed therefore:

* Cannot find icon: preferences-a2plus
Group icon for preferences-a2plus is not of size 96x96

* When using "Edit imported part" and the imported part is a subassemby it fails and gives the following in Report view:
Running the Python command 'a2p_editImportedPart' failed:
Traceback (most recent call last):
File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 458, in Activated
obj = selection[0]

list index out of range

EDIT:
Sorry, I was too fast...
It does NOT fail!!!
It only spits out the mentioned error message.
/EDIT

Regards
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

@kbwbe:
Just forget the last point... It only happens, when having another part in the foreground and using "Edit" on a non activated assembly part in Tree view -- what is quite logical.

Sorry for the noise.
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 Aug 15, 2018 2:29 pm @kbwbe:
* Cannot find icon: preferences-a2plus
Group icon for preferences-a2plus is not of size 96x96
@wandererfan,
need your help. I do not get the .ui-file working regarding the icon for preferences page. Is there a trick ??
manuelkrause wrote: Wed Aug 15, 2018 2:29 pm * When using "Edit imported part" and the imported part is a subassemby it fails and gives the following in Report view:
Running the Python command 'a2p_editImportedPart' failed:
Traceback (most recent call last):
File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 458, in Activated
obj = selection[0]

list index out of range
This happens, if you try to edit a part but you don't have selected one.
It is fixed on "devel" branch. Now you get a console warning.
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
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,

i need your help.

How can i do a function like that:

booleanResult = rigid.isFullConstrainedTo(anotherRigid) ?
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
Turro75
Posts: 179
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Post by Turro75 »

kbwbe wrote: Wed Aug 15, 2018 5:35 pm @Turro75,

i need your help.

How can i do a function like that:

booleanResult = rigid.isFullConstrainedTo(anotherRigid) ?
The function below does nearly what You need, it checks if tempfixed linked obj fully constraint the rigid.

Code: Select all

def linkedTempFixedDOF(self):
        self.pointConstraints = []
        _dofPos = a2p_libDOF.initPosDOF
        _dofRot = a2p_libDOF.initRotDOF
        self.reorderDependencies()
        if not self.tempfixed:
            if len(self.dependencies) > 0:            
                for x in self.dependencies:
                    if x.dependedRigid.tempfixed:
                        _dofPos, _dofRot = x.calcDOF(_dofPos,_dofRot, self.pointConstraints)
        
        return len(_dofPos) + len(_dofRot)
If return value is 0 , the rigid is fully constrained.

Just be sure that point constraint deps are evaluated as last, reorderdependency does this.

This is taken from a2p_rigid in turro dof 3
Post Reply