From e7039258f137ec7b4f918388a110a9c91521e76f Mon Sep 17 00:00:00 2001 From: Lorenz Neureuter Date: Fri, 17 Dec 2021 23:53:11 -0500 Subject: [PATCH] Sketch ArcAngle constraint fix - Update cost function --- cadquery/occ_impl/sketch_solver.py | 2 +- tests/test_sketch.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cadquery/occ_impl/sketch_solver.py b/cadquery/occ_impl/sketch_solver.py index 6401579f9..d57016c20 100644 --- a/cadquery/occ_impl/sketch_solver.py +++ b/cadquery/occ_impl/sketch_solver.py @@ -212,7 +212,7 @@ def orientation_cost(x, t, x0, val): def arc_angle_cost(x, t, x0, val): if t == "CIRCLE": - rv = norm(x[4] - x[3]) - val + rv = x[4] - val else: raise invalid_args(t) diff --git a/tests/test_sketch.py b/tests/test_sketch.py index 8f5e085d4..88a792da5 100644 --- a/tests/test_sketch.py +++ b/tests/test_sketch.py @@ -468,8 +468,8 @@ def test_constraint_solver(): assert s3._faces.isValid() - s3._tags["a1"][0].radius() == approx(1) - s3._tags["a1"][0].Length() == approx(pi / 3) + assert s3._tags["a1"][0].radius() == approx(1) + assert s3._tags["a1"][0].Length() == approx(pi / 3) s4 = ( Sketch()