-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
bezier-rs parametric_to_euclidean()? #2117
Comments
Hello @lucasw. The bézier-rs library is not really maintained since its original creators don't contribute any more. There is currently no function for converting parametric to euclidean. You can reasonably easily do something like: let curve = Bezier::from_cubic_coordinates(0., 2., 4., 3., 6., 5., 7., -4.);
let parametric = 0.7;
let [before, after] = curve.split(parametric).map(|split| split.length(None));
let euclidean = before / (before + after); Note that the performance of the length function has been significantly improved in the unreleased version compared to 0.4. |
But it's getting some maintainance here as a part of graphite- but I shouldn't expect updates to https://crates.io/crates/bezier-rs? I'm fine with this
(and if you are taking PRs I'd like to make project() return a TValue, getting an f64 tripped me up for a while before I realized the Parametric-Euclidean difference, the compiler could have told me much faster) Thanks for pointing out split (and it turns out I didn't actually need the euclidean distance ratio, just the length of the segment before the TValue). |
Contributions are definitely welcome! I'm also working towards a new release once I have the bandwidth to square away a few outstanding issues. |
I'd like to convert the output of project() to a euclidean distance ratio, but I don't see that method, only euclidean_to_parametric() for going the other way- or is it there and named something different?
The text was updated successfully, but these errors were encountered: