Skip to content

Refactor the 'Sample Points' node to use Kurbo API. #2629

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

indierusty
Copy link
Contributor

Closes #

Comment on lines +90 to +92
let lengths = segments_length
.map(|segments_length| segments_length.to_vec())
.unwrap_or(bezpath.segments().map(|segment| segment.perimeter(PERIMETER_ACCURACY)).collect());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why allocate?

Copy link
Contributor Author

@indierusty indierusty May 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the global_euclidean_to_local_euclidean function needed &[f64] and also to calculate total_length. I tried without coverting the segments length to Vec but could not figure out a way to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To calculate the lengths of the segment when pre-computed it not provided then I will have to create Vec of f64s to store the lengths right?

@indierusty indierusty marked this pull request as ready for review May 4, 2025 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants