diff --git a/Sketch.py b/Sketch.py index baad888..bd669d2 100644 --- a/Sketch.py +++ b/Sketch.py @@ -15,6 +15,7 @@ class Sketch(object): def solve(self): shape_vars = {} + varid_to_shape_var = [] varid = 0 equations = [] for c in self.constraints: @@ -26,6 +27,7 @@ class Sketch(object): if not shape_var in shape_vars: shape_vars[shape_var] = varid varid += 1 + varid_to_shape_var.append(shape_var) C = empty((len(equations), len(shape_vars))) d = empty(len(equations)) for i in range(len(equations)): @@ -37,3 +39,6 @@ class Sketch(object): d[i] = e[1] s = SLE(C, d) r = s.solve() + solved_vars = r.xf + for i in range(len(solved_vars)): + varid_to_shape_var[i].setVar(solved_vars[i])