Skip to content

Commit

Permalink
Fix sketch solver line_point method relative/absolute mixup (#1336)
Browse files Browse the repository at this point in the history
* Sketch: Fix line_point implementation

Enable assert that fails without the fix ( issue #1127 )

* Change channel order

---------

Co-authored-by: AU <adam-urbanczyk@users.noreply.github.com>
  • Loading branch information
voneiden and adam-urbanczyk authored Jun 17, 2023
1 parent 665815b commit b96eb8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cadquery/occ_impl/sketch_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def arc_point(x, val):

def line_point(x, val):

return x[:2] + val * x[2:]
return x[:2] + val * (x[2:] - x[:2])


def arc_first_tangent(x):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def test_constraint_solver():

midpoint = (seg2.startPoint() + seg2.endPoint()) / 2

(midpoint - seg1.startPoint()).Length == approx(2)
assert (midpoint - seg1.startPoint()).Length == approx(2)

s5 = (
Sketch()
Expand Down

0 comments on commit b96eb8a

Please sign in to comment.