@skyf0xx/hedgehog 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -155,7 +155,11 @@ Borrowed technique:
|
|
|
155
155
|
|
|
156
156
|
Author the motif as hand-built SVG, or as a Paper.js sketch if it needs
|
|
157
157
|
to evolve programmatically across sections — output either the SVG
|
|
158
|
-
markup or the Paper.js setup into `src/motifs/`.
|
|
158
|
+
markup or the Paper.js setup into `src/motifs/`. Use the
|
|
159
|
+
`svg-motif-authoring` skill for the actual drawing: build the shape from
|
|
160
|
+
primitives and boolean ops or a parametric generator, never a hand-typed
|
|
161
|
+
freehand bezier path — that's the difference between a sourced motif and
|
|
162
|
+
generic clip-art geometry.
|
|
159
163
|
|
|
160
164
|
## Workflow
|
|
161
165
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: svg-motif-authoring
|
|
3
|
+
description: Use whenever `landing-systems` authors the signature motif (Chain Method step 6, `hedgehog-landing-loop`) — hand-authoring an SVG or Paper.js sketch from scratch. Trigger on "draw the motif", "author the SVG", "write src/motifs/". Technique for producing a clean, distinctive vector shape without freehand bezier-path guessing, which is where hand-drawn motifs go wrong.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SVG Motif Authoring
|
|
7
|
+
|
|
8
|
+
Freehand `<path d="...">` coordinates written directly, number by number, are
|
|
9
|
+
the failure mode this skill exists to avoid. Bezier control points are
|
|
10
|
+
unreadable as numbers — there's no way to tell what a curve looks like from
|
|
11
|
+
its `d` string while writing it, so hand-typed paths drift into lumpy,
|
|
12
|
+
asymmetric, or self-intersecting geometry that reads as generic clip-art
|
|
13
|
+
rather than the sourced, deliberate motif `landing-systems` step 6 specifies.
|
|
14
|
+
|
|
15
|
+
## The rule
|
|
16
|
+
|
|
17
|
+
**Never hand-write a multi-point bezier path as raw numbers.** Build the
|
|
18
|
+
motif from primitives and operations you can reason about exactly, in this
|
|
19
|
+
order of preference:
|
|
20
|
+
|
|
21
|
+
1. **Primitive composition** — circles, rects, polygons, and single-arc paths
|
|
22
|
+
(`M`/`L`/`A` only, no freehand `C`/`Q`), combined via position, rotation,
|
|
23
|
+
and scale. Most sourced motifs (a material's cross-section, a tool's
|
|
24
|
+
silhouette, a natural form reduced to its defining contour) decompose into
|
|
25
|
+
2–4 primitives plus boolean ops, not one continuous freehand outline.
|
|
26
|
+
2. **Boolean ops on primitives** — union, subtract, intersect (as
|
|
27
|
+
`<clipPath>`/`<mask>`, or Paper.js's `PathItem.unite/subtract/intersect`)
|
|
28
|
+
to derive the actual silhouette. This is how the motif stays exact and
|
|
29
|
+
reproducible instead of eyeballed.
|
|
30
|
+
3. **Parametric/generative construction** — when the source genuinely has an
|
|
31
|
+
organic contour (a leaf vein, a wave, a woodgrain line), generate it: a
|
|
32
|
+
Paper.js script driven by a formula (sine-based waveform, L-system,
|
|
33
|
+
Voronoi cell, noise-perturbed circle) rather than a hand-typed curve.
|
|
34
|
+
Write the *generator*, not the resulting points — the generator is
|
|
35
|
+
legible and adjustable, a hand-typed curve is neither.
|
|
36
|
+
4. **Single freehand bezier segment, only as last resort** — if a genuinely
|
|
37
|
+
organic, non-formulaic curve is unavoidable (rare — most "organic" shapes
|
|
38
|
+
in step 6's Ingredient Vocabulary are formula-expressible per #3), keep it
|
|
39
|
+
to one continuous stroke, symmetric where the source is symmetric, and
|
|
40
|
+
verify per the check below before accepting it.
|
|
41
|
+
|
|
42
|
+
## Verifying a path before committing it
|
|
43
|
+
|
|
44
|
+
A path is not correct because it compiles. Before writing it into
|
|
45
|
+
`src/motifs/` and handing off:
|
|
46
|
+
|
|
47
|
+
- **Render it and look.** Use the Bash tool to write a standalone HTML file
|
|
48
|
+
wrapping the SVG (or the Paper.js canvas output) and open it, or inline it
|
|
49
|
+
in the dev server's page temporarily — don't judge geometry from the
|
|
50
|
+
markup alone.
|
|
51
|
+
- **State the path's point count and what each segment is for**, in a
|
|
52
|
+
one-line comment or in your own reasoning, before accepting it. If you
|
|
53
|
+
can't say why a control point is where it is, it was guessed, not
|
|
54
|
+
authored — redo it via primitives instead.
|
|
55
|
+
- **Check symmetry/proportion deliberately** where the source motif implies
|
|
56
|
+
it (step 6's "literalness" and "scale range" fields) — a hand-guessed
|
|
57
|
+
curve almost always drifts asymmetric even when the source is symmetric.
|
|
58
|
+
- **Prefer fewer anchor points.** A motif with 4 deliberate anchor points
|
|
59
|
+
reads as designed; one with 20 freehand points reads as a mouse-drawn
|
|
60
|
+
scribble, regardless of what it depicts.
|
|
61
|
+
|
|
62
|
+
## Paper.js specifics
|
|
63
|
+
|
|
64
|
+
For motifs that must evolve across sections (`landing-systems` step 6's
|
|
65
|
+
persistence/continuity fields):
|
|
66
|
+
|
|
67
|
+
- Construct the base shape from `Path.Circle`, `Path.Rectangle`,
|
|
68
|
+
`Path.RegularPolygon`, or a formula-driven `Path` built point-by-point in a
|
|
69
|
+
loop (e.g. `for (let t = 0; t <= 1; t += step)` sampling a parametric
|
|
70
|
+
function) — never `Path()` with hand-typed segment coordinates.
|
|
71
|
+
- Express augmentation/inversion/retrograde (the motif-variation vocabulary
|
|
72
|
+
step 6 borrows from music theory) as transforms (`scale`, `rotate`,
|
|
73
|
+
`reflect`) or formula-parameter changes on the same generator, not as a
|
|
74
|
+
hand-edited copy of the base path.
|
|
75
|
+
|
|
76
|
+
## Constraints
|
|
77
|
+
|
|
78
|
+
- This skill governs *how* the motif is drawn, not *what* it is — the
|
|
79
|
+
source, persistence, continuity, scale range, and literalness are
|
|
80
|
+
`landing-systems` step 6's decisions (see `landing-systems.md`); this
|
|
81
|
+
skill only prevents the geometry itself from being guessed.
|
|
82
|
+
- Don't reach for an icon library or stock SVG asset as a shortcut around
|
|
83
|
+
hard geometry — `landing-systems`'s existing constraint against generic
|
|
84
|
+
decoration still applies. A hard-to-draw motif is a signal to simplify via
|
|
85
|
+
more primitives, not to substitute a decorative asset.
|
|
86
|
+
- `landing-builder` implements the motif exactly as authored here — a motif
|
|
87
|
+
that's hard to render cleanly should be fixed at this step, not smoothed
|
|
88
|
+
over during build.
|