Ohh... I see how that happens.
Please take my PR, better leave python libraries to eliminate the duplicates, it will probably be faster than looping on the entries.
Ohh... I see how that happens.
Thank you, PR merged.project4 wrote: ↑Thu Jul 26, 2018 4:43 pmOhh... I see how that happens.
Please take my PR, better leave python libraries to eliminate the duplicates, it will probably be faster than looping on the entries.
The DOF can't get to the 3'rd stage accuracy... It does resolve 2 accuracies and than report that it can't resolve.kbwbe wrote: ↑Thu Jul 26, 2018 4:55 pmThank you, PR merged.project4 wrote: ↑Thu Jul 26, 2018 4:43 pmOhh... I see how that happens.
Please take my PR, better leave python libraries to eliminate the duplicates, it will probably be faster than looping on the entries.
After doing some tests today, IMHO the solver mode "partial solving" is the better one for most use-cases. I intend to set it as default mode. Also i think that the branch "solver-stabilization" is the better one than "master". It should be merged.
Suggestions ?
Do you mean 6DOF-example platform ? It works for me, but i did not apply latest PR local on my machine.
Hi @project4,
Thinking about it a bit more, to have a better code organization, I would move the Rigid and the Dependency classes to its own files...kbwbe wrote: ↑Thu Jul 26, 2018 4:55 pmThank you, PR merged.project4 wrote: ↑Thu Jul 26, 2018 4:43 pmOhh... I see how that happens.
Please take my PR, better leave python libraries to eliminate the duplicates, it will probably be faster than looping on the entries.
After doing some tests today, IMHO the solver mode "partial solving" is the better one for most use-cases. I intend to set it as default mode. Also i think that the branch "solver-stabilization" is the better one than "master". It should be merged.
Suggestions ?
Funny !manuelkrause wrote: ↑Thu Jul 26, 2018 11:02 pm And yes, I know A2plus-Man isn't ready ATM and some proportions aren't ideal.
Code: Select all
def calcSpinCenter(self):
newSpinCenter = Base.Vector(0,0,0)
countRefPoints = 0
for dep in self.dependencies:
if dep.refPoint != None:
newSpinCenter.add(dep.refPoint)
FreeCAD.Console.PrintMessage("Ref point: {}, new center {}\n".format(dep.refPoint, newSpinCenter))
countRefPoints += 1
if countRefPoints > 0:
newSpinCenter.multiply(1.0/countRefPoints)
self.spinCenter = newSpinCenter
FreeCAD.Console.PrintMessage("Spin center: {} num of points: {}\n".format(self.spinCenter, countRefPoints))
Code: Select all
Ref point: Vector (49.99999999999983, 149.99999999999994, 20.0), new center Vector (0.0, 0.0, 0.0)
Spin center: Vector (0.0, 0.0, 0.0) num of points: 1
Ref point: Vector (50.0, 150.0, 20.0), new center Vector (0.0, 0.0, 0.0)
Spin center: Vector (0.0, 0.0, 0.0) num of points: 1
Code: Select all
newSpinCenter = newSpinCenter.add(dep.refPoint)
and
self.spinCenter = newSpinCenter.multiply(1.0/countRefPoints)
Hi @project4,project4 wrote: ↑Fri Jul 27, 2018 2:36 pm @kbwbe
I'm playing with the rotations to see how it works and it looks like the spinCenter calculations doesn't work...
What's wrong with that code?The output is:Code: Select all
def calcSpinCenter(self): newSpinCenter = Base.Vector(0,0,0) countRefPoints = 0 for dep in self.dependencies: if dep.refPoint != None: newSpinCenter.add(dep.refPoint) FreeCAD.Console.PrintMessage("Ref point: {}, new center {}\n".format(dep.refPoint, newSpinCenter)) countRefPoints += 1 if countRefPoints > 0: newSpinCenter.multiply(1.0/countRefPoints) self.spinCenter = newSpinCenter FreeCAD.Console.PrintMessage("Spin center: {} num of points: {}\n".format(self.spinCenter, countRefPoints))
Should be:Code: Select all
Ref point: Vector (49.99999999999983, 149.99999999999994, 20.0), new center Vector (0.0, 0.0, 0.0) Spin center: Vector (0.0, 0.0, 0.0) num of points: 1 Ref point: Vector (50.0, 150.0, 20.0), new center Vector (0.0, 0.0, 0.0) Spin center: Vector (0.0, 0.0, 0.0) num of points: 1
I hate when the APIs are not consistent... The WIKI says that multiply doesn't return anything, but in fact it does!Code: Select all
newSpinCenter = newSpinCenter.add(dep.refPoint) and self.spinCenter = newSpinCenter.multiply(1.0/countRefPoints)
So based on the APIs some functions do change the object's data and some do not... Go figure.
I'm still playing with the code, so I won't PR a fix yet. I want to try my concepts first.