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

Restore arc_tolerance value when using Clipper2's InflatePaths #98017

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

rburing
Copy link
Member

@rburing rburing commented Oct 9, 2024

This was missed when upgrading from Clipper to Clipper2.

The value used to be passed as the second argument to the ClipperOffset constructor here (with an inaccurate/outdated comment, as the default is 0.25 unscaled):

ClipperOffset co(2.0, 0.25f * (real_t)SCALE_FACTOR); // Defaults from ClipperOffset.

Now we set the same parameter in Clipper2 by passing it to InflatePaths.

The MRP now yields results and timings of the same order of magnitude as with Clipper in 4.2.2:

4.2.2 offset join round:
execution time: 46034
result size: 23 

4.2.2 offset join miter:
execution time: 24829
result size: 7 

4.4 offset join round:
execution time: 51572
result size: 25

4.4 offset join miter:
execution time: 25920
result size: 7 

This was missed when upgrading from Clipper to Clipper2.
@rburing rburing added this to the 4.4 milestone Oct 9, 2024
@rburing rburing requested a review from a team as a code owner October 9, 2024 12:32
@rburing rburing added cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release bug performance labels Oct 9, 2024
@rburing rburing requested a review from smix8 October 9, 2024 12:42
@clayjohn clayjohn merged commit 68f053b into godotengine:master Oct 10, 2024
19 checks passed
@clayjohn
Copy link
Member

Thank you!

@rburing rburing deleted the clipper2_arc_tolerance branch October 10, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release performance regression topic:2d
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The efficiency of Geometry2D polygon offset with JOIN_ROUND operation has slowed down significantly in 4.3
3 participants