Skip to content

Add Curvature enum for index-based handle references (#1833)#3616

Open
theaniketgiri wants to merge 1 commit intoGraphiteEditor:masterfrom
theaniketgiri:feature/curvature-enum-1833
Open

Add Curvature enum for index-based handle references (#1833)#3616
theaniketgiri wants to merge 1 commit intoGraphiteEditor:masterfrom
theaniketgiri:feature/curvature-enum-1833

Conversation

@theaniketgiri
Copy link
Contributor

Summary

This PR adds the Curvature enum as the first step toward implementing #1833 (Make a shape's Segment table use handles from the Point table).

Changes

The Curvature enum describes segment curvature by referencing handle point indices in PointDomain, replacing inline coordinate storage. This enables:

  • Shared handle points across segments
  • Attribute-driven transformations
  • Future extensibility for Arc, NURBS, and other curve types

Variants

  • Linear: straight line between endpoints
  • Quadratic { handle: usize }: single control point (index reference)
  • Cubic { handle_start: usize, handle_end: usize }: two control points

Tests

Added 7 unit tests covering all methods.

Related Issues

Closes part of #1833

…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.
@Keavon Keavon force-pushed the master branch 6 times, most recently from d6228da to e58c1de Compare March 16, 2026 23:03
@Keavon Keavon force-pushed the master branch 5 times, most recently from 9b97ab7 to 2e842cb Compare March 19, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant