Bug Fix: Workbench added point-variables with Vec class for coordinates (from matfunc.py) instead of vector class (from vector.py).
Added a conversion to vector in GeometricProblem.add_paint & .set_point
This commit is contained in:
parent
4fe301a5e6
commit
e361ef14d0
|
@ -47,16 +47,18 @@ class GeometricProblem (Notifier, Listener):
|
|||
self.prototype = {}
|
||||
self.cg = ConstraintGraph()
|
||||
|
||||
def add_point(self, variable, position):
|
||||
def add_point(self, variable,pos):
|
||||
"""add a point variable with a prototype position"""
|
||||
position = vector.vector(pos)
|
||||
if variable not in self.prototype:
|
||||
self.prototype[variable] = position
|
||||
self.cg.add_variable(variable)
|
||||
else:
|
||||
raise StandardError, "point already in problem"
|
||||
|
||||
def set_point(self, variable, position):
|
||||
def set_point(self, variable, pos):
|
||||
"""set prototype position of point variable"""
|
||||
position = vector.vector(pos)
|
||||
if variable in self.prototype:
|
||||
self.prototype[variable] = position
|
||||
self.send_notify(("set_point", (variable,position)))
|
||||
|
|
|
@ -771,13 +771,13 @@ def runstats():
|
|||
stats_parametric()
|
||||
|
||||
def runtests():
|
||||
#diag_select("clsolver3D")
|
||||
#test(double_banana_plus_one_problem())
|
||||
#test(double_banana_problem())
|
||||
#test(double_tetrahedron_problem())
|
||||
#test(ada_tetrahedron_problem())
|
||||
#test(random_triangular_problem_3D(10,10.0,0.0,0.5))
|
||||
#test(random_distance_problem_3D(10,1.0,0.0))
|
||||
#diag_select("clsolver3D")
|
||||
test(fix_problem_3d())
|
||||
|
||||
if __name__ == "__main__": runtests()
|
||||
|
|
Loading…
Reference in New Issue
Block a user