Add Curvature enum for index-based handle references (#1833)#3616
Open
theaniketgiri wants to merge 1 commit intoGraphiteEditor:masterfrom
Open
Add Curvature enum for index-based handle references (#1833)#3616theaniketgiri wants to merge 1 commit intoGraphiteEditor:masterfrom
theaniketgiri wants to merge 1 commit intoGraphiteEditor:masterfrom
Conversation
…1833) This is the first step toward making SegmentDomain use handles from the Point table instead of storing coordinates inline. The Curvature enum describes segment curvature by referencing handle point indices in PointDomain, enabling: - Shared handle points across segments - Attribute-driven transformations - Future extensibility for Arc, NURBS, and other curve types Variants: - Linear: straight line between endpoints - Quadratic: single control point (index reference) - Cubic: two control points (index references) Includes unit tests for all methods.
d6228da to e58c1de Compare 9b97ab7 to 2e842cb Compare This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the
Curvatureenum as the first step toward implementing #1833 (Make a shape's Segment table use handles from the Point table).Changes
The
Curvatureenum describes segment curvature by referencing handle point indices in PointDomain, replacing inline coordinate storage. This enables:Variants
Linear: straight line between endpointsQuadratic { handle: usize }: single control point (index reference)Cubic { handle_start: usize, handle_end: usize }: two control pointsTests
Added 7 unit tests covering all methods.
Related Issues
Closes part of #1833