-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Add Area and Centroid nodes #1749
Add Area and Centroid nodes #1749
Conversation
3e4f70c
to
c2cb287
Compare
9f2cfc4
to
2671107
Compare
ab7adc3
to
67467f0
Compare
67467f0
to
64b6bb2
Compare
!build |
@@ -218,6 +218,20 @@ impl Bezier { | |||
|
|||
self.get_points().all(|point| point.abs_diff_eq(start, MAX_ABSOLUTE_DIFFERENCE)) | |||
} | |||
|
|||
// TODO: What about the case when a handle extends beyond the start or end point? Is that considered "equivalent to a line"? |
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 added this TODO comment. Can you please resolve this by mentioning the appropriate thing here to document this edge case? Thanks!
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.
The is_linear
will function will declare it as a line and that is what we want. The problem is in the place is_linear
will be used. The start and end points will be chosen incorrectly. Instead it should use the handle point if it is further than start or end points.
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.
Actually this was originally put because the pen tool uses cubic beziers for straight lines. The handle are exactly at the same position of start and end. Since its actual use-case was covered. I did not think any further. If we want it to work for all cases then I will require some time think about it.
|
!build |
|
Cool! capture_29_.mp4 |
perimeter_centroid
forBezier
andSubpath
that calculates the line integral of position.is_linear
which check if the bezier curve is equivalent to a line. Used in the calculation of intersection of two bezier curves where initially a line-like cubic bezier would give the wrong area.