Skip to content

Change C: new primitives + curated examples - #25

Merged
asukiasov merged 6 commits into
mainfrom
core-new-primitives
Sep 6, 2026
Merged

asukiasov merged 6 commits into
mainfrom
core-new-primitives

Conversation

@asukiasov

Copy link
Copy Markdown
Owner

Summary

Adds four grid-cell primitives derived from samples/new 4/, appended to PRIMITIVE_REGISTRY at indices 14–17:

  • diamond (14) — square on its point, vertices at the edge midpoints (sample 1; centre of sample 5).
  • parallelogram (15) — full-height quad, top edge sheared right by cellSize/2; invert → backslash slant (samples 3–4).
  • bar (16) — centred axis-aligned band, full width, half-cell thick; the axis-aligned sibling of diagonal-band (sample 2).
  • gable (17) — triangle, base on one edge, apex at the opposite edge midpoint; straight sibling of cap, two form a diamond.

Each primitive: one pure (cellSize, rotation, invert) => PathSegment[] builder, straight-line segments only, no SVG transform=, coordinates mapped through transformPathSegment. Registry + primitives/index.ts are append-only; pinned-index tests added for all four, and the "exactly N registered primitives" assertion bumped to eighteen. render.test unknown-type probe moved 14 → 18.

Also:

  • 6 curated catalog entries in src/library/catalog.json (Diamond Lattice, Cube Corner, Ribbon Rows, Bar Plaid, Faceted Bloom, Gabled Diamond) — each exercises a new primitive; all decode, round-trip and render (test/library/index.test.ts).
  • docs/architecture.md and docs/primitive-survey.md updated.
  • Design doc: docs/superpowers/specs/2026-09-07-bitshaper-new-primitives-design.md; plan: docs/superpowers/plans/2026-09-07-bitshaper-new-primitives.md.

Verification

  • npm test — 427 passing
  • npx biome check . — clean
  • npm run build — ok

Does not touch web/. Please review — not merging.

🤖 Generated with Claude Code

asukiasov and others added 6 commits September 7, 2026 00:16
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…s 14-17)

Four new grid-cell primitives derived from samples/new 4/, appended to
PRIMITIVE_REGISTRY. Each is a pure straight-line path builder mapped
through transformPathSegment, emitting no SVG transform=. Pinned-index
tests and per-primitive geometry/rotation/invert tests added; render.test
unknown-type probe bumped 14 -> 18.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diamond Lattice, Cube Corner, Ribbon Rows, Bar Plaid, Faceted Bloom,
Gabled Diamond — each exercises a new primitive; all decode, round-trip
and render (test/library/index.test.ts).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@asukiasov
asukiasov merged commit bcb7920 into main Sep 6, 2026
4 checks passed
@asukiasov
asukiasov deleted the core-new-primitives branch September 6, 2026 20:29
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