Skip to content

Commit fdc5d0f

Browse files
authored
Merge pull request #962 from CadQuery/arc-length-fix
Fix arc length cost
2 parents 4fcada6 + c7d55b6 commit fdc5d0f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cadquery/occ_impl/sketch_solver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def length_cost(x, t, x0, val):
160160
if t == "LINE":
161161
rv = norm(x[2:] - x[:2]) - val
162162
elif t == "CIRCLE":
163-
rv = norm(x[2] * (x[4] - x[3])) - val
163+
rv = norm(x[2] * x[4]) - val
164164
else:
165165
raise invalid_args(t)
166166

tests/test_sketch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ def test_constraint_solver():
449449

450450
assert s2._faces.isValid()
451451

452-
s2._tags["s1"][0].Length() == approx(0.5)
453-
s2._tags["a1"][0].Length() == approx(1.0)
452+
assert s2._tags["s1"][0].Length() == approx(0.5)
453+
assert s2._tags["a1"][0].Length() == approx(1.0)
454454

455455
s3 = (
456456
Sketch()

0 commit comments

Comments
 (0)