Skip to content

Add fast path for constant curvature discretization#250

Merged
gpeairs merged 9 commits into
mainfrom
gp/constant-curvature
Jul 15, 2026
Merged

Add fast path for constant curvature discretization#250
gpeairs merged 9 commits into
mainfrom
gp/constant-curvature

Conversation

@gpeairs

@gpeairs gpeairs commented Jul 7, 2026

Copy link
Copy Markdown
Member

Address part of the over-refinement problem mentioned in #247 -- now we get the same number of points as through circular_arc when we are discretizing circular arcs. This seems to be about 3x faster than marching. DemoQPU17 gets a fingerprint update, but all changes are <1nm slivers.

Also fix some duplication in BSpline discretization (another item in the same issue), including removing a redundant calculation of the curvature which saves about 30% of render time. I looked at using Paths._curvature! with pre-allocated G, H for B-spline curvature calls but benchmarks were ambiguous.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@gpeairs

gpeairs commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

This is actually slower than before on large turns. Should get to the bottom of that. (Edit: circular_arc was slower than it needed to be, mainly fixed by making sure the inner call always receives floats. Now the full Turn rendering pipeline is generally faster than v1.15.)

@laylagi laylagi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall this looks good to me. I left one correctness question inline around the new Turn fast path, but the constant-curvature approach and the offset-turn handling make sense to me. Thanks!

Comment thread src/render/discretization.jl Outdated
@gpeairs
gpeairs force-pushed the gp/constant-curvature branch from dca474c to 0748f03 Compare July 15, 2026 10:17

@laylagi laylagi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, looking good!

@gpeairs
gpeairs merged commit 7ea7b59 into main Jul 15, 2026
10 checks passed
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