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

Fix crash when using tangent on angles with PI/2 value #2110

Merged
merged 3 commits into from
Jul 3, 2024

Conversation

wawanbreton
Copy link
Contributor

@wawanbreton wawanbreton commented Jul 2, 2024

std::tan with a value of PI/2 works but returns a huge number, which will crash subsequent processings (like offsetting a polygon with this value). A function has been added to process a "safe tangent" calculation that return a big but not huge number.
There was previously a similar safety in the code, but it was completely inefficient...

CURA-11804

Note: unit tests are fixed in an other branch (not merged at the time of writing this)

std::tan with a value of PI/2 works but return a huge number, which will
crash subsequent processings. A function has been added to process a
"safe tangent" calculation that return a big but not huge number.

CURA-11804
Copy link
Member

@rburema rburema left a comment

Choose a reason for hiding this comment

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

lgtm :-)

@Vandresc Vandresc merged commit d2851fd into main Jul 3, 2024
27 checks passed
@Vandresc Vandresc deleted the CURA-11804_fix_90_overhang_crash branch July 3, 2024 12:27
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.

4 participants