feat(engine): PathNode vector-path primitive with native PDF curve operators#168
Merged
Conversation
…erators W1 of the path workstream: general-purpose PathNode (normalized DocumentPathSegment moveTo/lineTo/cubicTo/close, fill via non-zero winding and/or stroke, atomic pagination, deterministic snapshots) mirroring the PolygonNode stack one-to-one - node + PathDefinition + PathFragmentPayload + PdfPathFragmentRenderHandler emitting native moveTo/curveTo, registered in BuiltInNodeDefinitions and defaultHandlers (map dispatch, no chain edits). Control points deliberately may overshoot the unit box (Catmull-Rom-to-Bezier conversions need it; ShapePoint clamping is why segments carry raw finite doubles). Groundwork for smooth chart lines (W3) and SVG path import. 9 tests: unit validation, structural+snapshot baseline, visual demo (wave/blob/ribbon). Full gate: 1254 tests, BUILD SUCCESS.
This was referenced Jun 12, 2026
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.
What
W1 of the path workstream (smooth charts → design shapes → SVG import): a general-purpose
PathNodeprimitive — the open-path, curve-capable sibling ofPolygonNode, mirroring its stack one-to-one:DocumentPathSegment(sealed:moveTo/lineTo/ cubiccubicTo/close) — normalized unit-box coordinates in theShapePointorientation, but carried as raw finite doubles: Bézier control points deliberately may overshoot the box (Catmull-Rom→Bézier conversions need it;ShapePointclamps to [0,1], which is why it isn't reused).PathNode(atomic, fill via non-zero winding and/or stroke) +PathDefinition+PathFragmentPayload+PdfPathFragmentRenderHandleremitting nativemoveTo/curveTooperators — curves stay perfectly smooth at any zoom, no tessellation.BuiltInNodeDefinitions, one handler indefaultHandlers()(dispatch is map-first — no chain edits). Zero hot-path changes.Verification
PathNodeTest(MoveTo-first, ≥2 segments, finite coords, overshoot allowed, defensive copy),PathNodeRenderingTest(atomic placement, stable paths, committed snapshot baselinedocument/path_primitive, valid PDF),PathPrimitiveDemoTest(wave + blob + mixed ribbon vs blank diff, writestarget/visual-tests/path/path_primitive.pdf)../mvnw verify -pl .— 1254 tests, 0 failures, BUILD SUCCESS.Next: W2 — DSL
addPath(...)builder for design shapes; W3 — smooth chart lines + curved area fills through this primitive.