Skip to content

Conversation

@DJMcNab
Copy link
Member

@DJMcNab DJMcNab commented Jan 23, 2026

This was one of the key points raised for follow-up in #1360, to make this API harder to misuse.

The implementation strategy is to have a new ExactPathElements trait, which is implemented for Shapes which don't require approximation.
To allow shapes which do require a tolerance to be used without allocation, the within function can be used, which creates an exact shape from an inexact shape within the provided tolerance.

This ensures that the common-case of rectangles and similar is ergonomic, whilst the case where tolerance is needed is handled by the user. This still completely avoids per-path allocations.

The ExactPathElements is based on code by @tomcur from #vello > Determining correct `Shape` tolerance. There are reasonable arguments that ExactPathElements actually belongs in Kurbo, but I also think that, if this is the direction we decide to go, migrating that code into Kurbo would (relatively) straightforward.

DJMcNab and others added 3 commits January 23, 2026 16:22
This represents shapes which can be turned into exact paths

Co-Authored-By: Tom Churchman <thomas@churchman.nl>
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.

1 participant