-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sketch_solver.line_point has incorrect implementation? #1127
Labels
Comments
I tried the suggested fix -- WFM and fwiw, LGTM. |
voneiden
added a commit
to voneiden/cadquery
that referenced
this issue
May 19, 2023
voneiden
added a commit
to voneiden/cadquery
that referenced
this issue
May 20, 2023
@adam-urbanczyk I've added a test case that uses distance constraint on a rectangle that fails against master and succeeds against the fix. |
Will you open a PR? |
Oh dear, have I've opened it one year ago against my own repo? 😂 Yeah I'll open a proper PR later today ..! |
voneiden
added a commit
to voneiden/cadquery
that referenced
this issue
May 20, 2023
@adam-urbanczyk Alrighty: #1336 |
voneiden
added a commit
to voneiden/cadquery
that referenced
this issue
Jun 14, 2023
Enable assert that fails without the fix ( issue CadQuery#1127 )
adam-urbanczyk
added a commit
that referenced
this issue
Jun 17, 2023
* Sketch: Fix line_point implementation Enable assert that fails without the fix ( issue #1127 ) * Change channel order --------- Co-authored-by: AU <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background
Tested out sketching with constraints and found myself in a situation where it seemed like my Distance constraint between a midpoint of a line and a midpoint of an arc was not respected.
Output
Expected
Difference is subtle, but the current output produces a distance that is about 3.88 (measured from stl output) instead of the constrained 4.5.
Probable cause
After fiddling a bit with a debugger I noticed that line_point returned a rather odd value for the midpoint (-1.64, -0.85) instead of an expected (0, -0.56).
https://github.com/CadQuery/cadquery/blob/master/cadquery/sketch.py#L924 sends lines/segments to the solver as a tuple (p1.x, p1.y, p2.x, p2.y) where p1 is start point and p2 is end point.
https://github.com/CadQuery/cadquery/blob/master/cadquery/occ_impl/sketch_solver.py#L85 appears to behave as if the above tuple is actually (p1.x, p1.y, d.x, d.y) where p1 is start point and d is a vector from the start point to the end point.
Possible fix
I can get expected results if I change the implementation of line_point to
Thoughts?
The text was updated successfully, but these errors were encountered: