Skip to content
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

cap max segments #293

Merged
merged 1 commit into from
Jun 13, 2024
Merged

cap max segments #293

merged 1 commit into from
Jun 13, 2024

Conversation

bobnik
Copy link
Collaborator

@bobnik bobnik commented Jun 10, 2024

Fixes #283.

In the 90 degree case, the wiper algorithm adds a point which is way outside of the bounds of the machine (e.g, x: 8000000000, y: 0). If an effect is added that calls subsample to break up long lines, this particular case results in an extremely high number of additional points being added, which overwhelms the browser.

I was unable to figure out how to modify this algorithm to sensibly clip the line. Instead, I modified subsample to cap the number of segments into which any given line can be divided. This seems to work well, and does not noticeably change the visible pattern. Please scrutinize.

@jeffeb3 jeffeb3 merged commit 6f316a2 into master Jun 13, 2024
2 checks passed
@jeffeb3 jeffeb3 deleted the feature/issue-238-wiper-crash branch June 13, 2024 18:15
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.

crash/infinite loop with effects
2 participants