Unlock custom brushes, natural fill effects and intuitive hatching in p5.js
Cleaning
acamposuribef0c71afa7c12
diff --git a/package.json b/package.jsonindex 29ef47c..053744d 100644--- a/package.json+++ b/package.json@@ -10,6 +10,10 @@"test:watch": "vitest","build": "rollup --config -w"},+ "files": [+ "dist",+ "src"+ ],"sideEffects": false,"type": "module","repository": {diff --git a/test/index.html b/test/index.htmlindex 557ab48..b73dfbf 100644--- a/test/index.html+++ b/test/index.html@@ -181,67 +181,67 @@<p>Use these pages to visually inspect the p5 build. Each links to its standalone counterpart.</p></div><div class="grid">- <a class="card" href="./visual_suite.html">+ <a class="card" href="./p5/visual_suite.html"><h3>Visual API Suite</h3><p>Wide coverage page that exercises most public APIs and logs error-message checks to the console.</p><span class="meta">Coverage</span>- <span class="path">test/visual_suite.html</span>+ <span class="path">test/p5/visual_suite.html</span></a>- <a class="card" href="./hatch_test.html">+ <a class="card" href="./p5/hatch_test.html"><h3>Hatch Test</h3><p>Exercises hatch angles, spacing, rand/continuous/gradient options, cross-hatching, brush types, shapes, and multi-polygon arrays.</p><span class="meta">Coverage</span>- <span class="path">test/hatch_test.html</span>+ <span class="path">test/p5/hatch_test.html</span></a>- <a class="card" href="./fill_circle_explorer.html">+ <a class="card" href="./p5/fill_circle_explorer.html"><h3>Fill Circle Explorer</h3><p>Seeded single-shape page for inspecting watercolor fill bleed, opacity, texture, border, and palette color on a centered circle.</p><span class="meta">Explorer</span>- <span class="path">test/fill_circle_explorer.html</span>+ <span class="path">test/p5/fill_circle_explorer.html</span></a>- <a class="card" href="./wash_test.html">+ <a class="card" href="./p5/wash_test.html"><h3>Wash Test</h3><p>Direct WEBGL wash page that draws five random rect and circle polygons with palette colors at full opacity.</p><span class="meta">Coverage</span>- <span class="path">test/wash_test.html</span>+ <span class="path">test/p5/wash_test.html</span></a>- <a class="card" href="./field_explorer.html">+ <a class="card" href="./p5/field_explorer.html"><h3>Flow Field Explorer</h3><p>Interactive field inspector for comparing built-in fields with adjustable density and line length.</p><span class="meta">Explorer</span>- <span class="path">test/field_explorer.html</span>+ <span class="path">test/p5/field_explorer.html</span></a>- <a class="card" href="./angle_mode_test.html">+ <a class="card" href="./p5/angle_mode_test.html"><h3>Angle Mode Test</h3><p>Compares degrees, radians, mixed mode changes, stored hatch angles, low-level Position movement, and custom fields.</p><span class="meta">Behavior</span>- <span class="path">test/angle_mode_test.html</span>+ <span class="path">test/p5/angle_mode_test.html</span></a>- <a class="card" href="./transform_test.html">+ <a class="card" href="./p5/transform_test.html"><h3>Transform Alignment</h3><p>Checks that brush strokes and fills align with native p5 reference geometry under translate, rotate, and scale.</p><span class="meta">Geometry</span>- <span class="path">test/transform_test.html</span>+ <span class="path">test/p5/transform_test.html</span></a>- <a class="card" href="./pushpop_test.html">+ <a class="card" href="./p5/pushpop_test.html"><h3>Push / Pop State</h3><p>Verifies that p5 push/pop restores stroke, brush, fill, and hatch state correctly.</p><span class="meta">State</span>- <span class="path">test/pushpop_test.html</span>+ <span class="path">test/p5/pushpop_test.html</span></a>- <a class="card" href="./pastel_hatching_test.html">+ <a class="card" href="./p5/pastel_hatching_test.html"><h3>Pastel Hatching Test</h3><p>Minimal global-mode sketch with a custom crayon brush and a single centered rectangle for pastel hatching experiments.</p><span class="meta">Experiment</span>- <span class="path">test/pastel_hatching_test.html</span>+ <span class="path">test/p5/pastel_hatching_test.html</span></a></div></section>diff --git a/test/angle_mode_test.html b/test/p5/angle_mode_test.htmlsimilarity index 100%rename from test/angle_mode_test.htmlrename to test/p5/angle_mode_test.htmldiff --git a/test/angle_mode_test.js b/test/p5/angle_mode_test.jssimilarity index 100%rename from test/angle_mode_test.jsrename to test/p5/angle_mode_test.jsdiff --git a/test/field_explorer.html b/test/p5/field_explorer.htmlsimilarity index 100%rename from test/field_explorer.htmlrename to test/p5/field_explorer.htmldiff --git a/test/fill.test.js b/test/p5/fill.test.jssimilarity index 97%rename from test/fill.test.jsrename to test/p5/fill.test.jsindex d3243d4..c85aad7 100644--- a/test/fill.test.js+++ b/test/p5/fill.test.js@@ -67,7 +67,7 @@ vi.mock("../src/core/plot.js", () => ({Plot: class Plot {},}));-import { createFill, fill } from "../src/fill/fill.js";+import { createFill, fill } from "../../src/fill/fill.js";describe("createFill()", () => {beforeEach(() => {diff --git a/test/fill_circle_explorer.html b/test/p5/fill_circle_explorer.htmlsimilarity index 100%rename from test/fill_circle_explorer.htmlrename to test/p5/fill_circle_explorer.htmldiff --git a/test/fill_circle_explorer.js b/test/p5/fill_circle_explorer.jssimilarity index 100%rename from test/fill_circle_explorer.jsrename to test/p5/fill_circle_explorer.jsdiff --git a/test/hatch_test.html b/test/p5/hatch_test.htmlsimilarity index 100%rename from test/hatch_test.htmlrename to test/p5/hatch_test.htmldiff --git a/test/hatch_test.js b/test/p5/hatch_test.jssimilarity index 100%rename from test/hatch_test.jsrename to test/p5/hatch_test.jsdiff --git a/test/p5_first_frame_profiler.js b/test/p5/p5_first_frame_profiler.jssimilarity index 100%rename from test/p5_first_frame_profiler.jsrename to test/p5/p5_first_frame_profiler.jsdiff --git a/test/pastel_hatching_test.html b/test/p5/pastel_hatching_test.htmlsimilarity index 100%rename from test/pastel_hatching_test.htmlrename to test/p5/pastel_hatching_test.htmldiff --git a/test/pastel_hatching_test.js b/test/p5/pastel_hatching_test.jssimilarity index 100%rename from test/pastel_hatching_test.jsrename to test/p5/pastel_hatching_test.jsdiff --git a/test/pushpop_test.html b/test/p5/pushpop_test.htmlsimilarity index 100%rename from test/pushpop_test.htmlrename to test/p5/pushpop_test.htmldiff --git a/test/sketch.js b/test/p5/sketch.jssimilarity index 100%rename from test/sketch.jsrename to test/p5/sketch.jsdiff --git a/test/stroke_pressure.test.js b/test/p5/stroke_pressure.test.jssimilarity index 97%rename from test/stroke_pressure.test.jsrename to test/p5/stroke_pressure.test.jsindex 15bd377..9861716 100644--- a/test/stroke_pressure.test.js+++ b/test/p5/stroke_pressure.test.js@@ -59,7 +59,7 @@ vi.mock("../src/stroke/gl_draw.js", () => ({snapshotMatrix: () => {},}));-import { add, box, normalizePressure } from "../src/stroke/stroke.js";+import { add, box, normalizePressure } from "../../src/stroke/stroke.js";describe("normalizePressure()", () => {it("keeps function pressure in explicit custom mode", () => {diff --git a/test/transform_test.html b/test/p5/transform_test.htmlsimilarity index 100%rename from test/transform_test.htmlrename to test/p5/transform_test.htmldiff --git a/test/unit.test.js b/test/p5/unit.test.jssimilarity index 98%rename from test/unit.test.jsrename to test/p5/unit.test.jsindex 1dce827..bcb743d 100644--- a/test/unit.test.js+++ b/test/p5/unit.test.js@@ -72,10 +72,10 @@ import {seed,weightedRand,toDegreesSigned,-} from "../src/core/utils.js";-import { arc } from "../src/core/primitives.js";-import { Position, addField, field as activateField, noField } from "../src/core/flowfield.js";-import { hatch } from "../src/hatch/hatch.js";+} from "../../src/core/utils.js";+import { arc } from "../../src/core/primitives.js";+import { Position, addField, field as activateField, noField } from "../../src/core/flowfield.js";+import { hatch } from "../../src/hatch/hatch.js";beforeEach(() => {currentAngleMode.value = "radians";diff --git a/test/visual_suite.html b/test/p5/visual_suite.htmlsimilarity index 100%rename from test/visual_suite.htmlrename to test/p5/visual_suite.htmldiff --git a/test/wash_test.html b/test/p5/wash_test.htmlsimilarity index 100%rename from test/wash_test.htmlrename to test/p5/wash_test.htmldiff --git a/test/wash_test.js b/test/p5/wash_test.jssimilarity index 100%rename from test/wash_test.jsrename to test/p5/wash_test.js