diff --git a/cadquery/occ_impl/sketch_solver.py b/cadquery/occ_impl/sketch_solver.py index d57016c20..f59942c3e 100644 --- a/cadquery/occ_impl/sketch_solver.py +++ b/cadquery/occ_impl/sketch_solver.py @@ -160,7 +160,7 @@ def length_cost(x, t, x0, val): if t == "LINE": rv = norm(x[2:] - x[:2]) - val elif t == "CIRCLE": - rv = norm(x[2] * (x[4] - x[3])) - val + rv = norm(x[2] * x[4]) - val else: raise invalid_args(t) diff --git a/tests/test_sketch.py b/tests/test_sketch.py index 516ca430c..09846989d 100644 --- a/tests/test_sketch.py +++ b/tests/test_sketch.py @@ -449,8 +449,8 @@ def test_constraint_solver(): assert s2._faces.isValid() - s2._tags["s1"][0].Length() == approx(0.5) - s2._tags["a1"][0].Length() == approx(1.0) + assert s2._tags["s1"][0].Length() == approx(0.5) + assert s2._tags["a1"][0].Length() == approx(1.0) s3 = ( Sketch()