-
Notifications
You must be signed in to change notification settings - Fork 38
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
[DO NOT MERGE] Calculate bezier curve length #799
base: main
Are you sure you want to change the base?
[DO NOT MERGE] Calculate bezier curve length #799
Conversation
b4d044c
to
dcd65dc
Compare
|
a9ea923
to
b8cec55
Compare
At this point I think the code that I have is correct, there was an issue with the existing implementation of the Bezier curve when dealing with points that were co-linear. If you have points P1 and P2, to compute the Bezier curve two additional control points CP1 and CP2 must be determined which control the shape of the curve. Sometimes, the control points would be outside of the bounds of Points P1 and P2, as illustrated below: x----o--------x----o However, the control points should lie within on the vector P1P2, not beyond it, like this: This is important because when the control points lie beyond the vector P1P2, the arclength of the Bezier curve is artificially made longer. Currently, some of the tests are still failing but they are mostly related to tests which utilize coordinates that are colinear (with the exception of the test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. thanks for finding and fixing the bug! I have a few small comments, but otherwise I think it is good to go.
@@ -236,4 +236,4 @@ namespace WorldBuilder | |||
} // namespace Features | |||
} // namespace WorldBuilder | |||
|
|||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you doing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what is happening here? This is the same as the current file and I made no changes to it.
40b1200
to
8bc48f0
Compare
8bc48f0
to
f99409b
Compare
Thanks for the review! I've addressed your comments, it turns out it wasn't |
After talking to @MFraters I've tentatively updated the test results. The test results should be more correct now, because the tests that were failing involved colinear points. However, we want to do a little more checking to make sure that the new code still produces correct results, so do not merge this quite yet. |
95536e3
to
b178283
Compare
Add the functionality within
bezier_curve.cc
to determine the total arc-length of the bezier curve across all user-specified coordinates, and the length of the bezier curve between each incremental pair of user-specified coordinates.