Skip to content

feat(engine): PathNode vector-path primitive with native PDF curve operators#168

Merged
DemchaAV merged 1 commit into
developfrom
feat/path-node-primitive
Jun 12, 2026
Merged

feat(engine): PathNode vector-path primitive with native PDF curve operators#168
DemchaAV merged 1 commit into
developfrom
feat/path-node-primitive

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

What

W1 of the path workstream (smooth charts → design shapes → SVG import): a general-purpose PathNode primitive — the open-path, curve-capable sibling of PolygonNode, mirroring its stack one-to-one:

  • DocumentPathSegment (sealed: moveTo / lineTo / cubic cubicTo / close) — normalized unit-box coordinates in the ShapePoint orientation, but carried as raw finite doubles: Bézier control points deliberately may overshoot the box (Catmull-Rom→Bézier conversions need it; ShapePoint clamps to [0,1], which is why it isn't reused).
  • PathNode (atomic, fill via non-zero winding and/or stroke) + PathDefinition + PathFragmentPayload + PdfPathFragmentRenderHandler emitting native moveTo/curveTo operators — curves stay perfectly smooth at any zoom, no tessellation.
  • Registration only: one line in BuiltInNodeDefinitions, one handler in defaultHandlers() (dispatch is map-first — no chain edits). Zero hot-path changes.

Verification

  • 9 new tests: PathNodeTest (MoveTo-first, ≥2 segments, finite coords, overshoot allowed, defensive copy), PathNodeRenderingTest (atomic placement, stable paths, committed snapshot baseline document/path_primitive, valid PDF), PathPrimitiveDemoTest (wave + blob + mixed ribbon vs blank diff, writes target/visual-tests/path/path_primitive.pdf).
  • Rendered demo eyeballed: sine wave is perfectly smooth (no facets), filled blob with overshooting controls, mixed line/curve filled ribbon.
  • API hygiene checker green; full gate ./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.

…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.
@DemchaAV DemchaAV merged commit 7f6e840 into develop Jun 12, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/path-node-primitive branch June 12, 2026 00:33
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