You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a discussion with @o0Ignition0o, I like his suggestion to compute the minimum bounding rect, so I suggest having two methods:
fnbounding_rect(&self) -> Rect
which is a naive implementation that returns the minimum rectangle containing the control points of the curve, and
fnminimum_bounding_rect(&self) -> Rect
Which is slightly more expensive but returns a tighter rect. find_y_inflection should be useful for this, and for some reason find_x_inflection is missing but it could be added. find_y_maximum is also relevant, but find_x_maximum, find_x_minimum and find_y_minimum are missing too (should not be hard to add the missing methods taking inspiration from the existing ones).
This looks good, I'll give it a try ! I'm also considering rotating the curve to "flatten" the start and end points, before invoking find_y_maximum. I don't know if it would be the fastest implementation to get the minimum_bounding_rect, but I'll make a pr and see if I can improve it :)
We first need to reexport euclid's rectangle type (
euclid::Rect<T>
) in bezier/src/lib.rs the same way we reexport the Point type, and add a method:To
QuadraticBezierSegment
andCubicBezierSegment
.The text was updated successfully, but these errors were encountered: