@nexart/codemode-sdk 0.1.0 → 0.1.1
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/README.md +9 -1
- package/dist/p5-runtime.d.ts +1 -1
- package/dist/p5-runtime.d.ts.map +1 -1
- package/dist/p5-runtime.js +7 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# NexArt Code Mode Runtime SDK
|
|
2
2
|
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
|
|
5
5
|
A minimal, deterministic rendering engine for generative art.
|
|
6
6
|
|
|
@@ -297,6 +297,14 @@ Ensure your server has this endpoint available, or provide your own encoding sol
|
|
|
297
297
|
|
|
298
298
|
---
|
|
299
299
|
|
|
300
|
+
## Changelog
|
|
301
|
+
|
|
302
|
+
**0.1.1** — Fixed beginShape / vertex / endShape rendering bug. Vertex-based shapes (waves, spirals, Lissajous curves, hexagons) now render correctly and match nexart.xyz behavior.
|
|
303
|
+
|
|
304
|
+
**0.1.0** — Initial release.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
300
308
|
## License
|
|
301
309
|
|
|
302
310
|
MIT License
|
package/dist/p5-runtime.d.ts
CHANGED
package/dist/p5-runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p5-runtime.d.ts","sourceRoot":"","sources":["../p5-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,SAAS,
|
|
1
|
+
{"version":3,"file":"p5-runtime.d.ts","sourceRoot":"","sources":["../p5-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,SAAS,CAqVX;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAE3E"}
|
package/dist/p5-runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NexArt Code Mode Runtime SDK - p5-like Runtime
|
|
3
|
-
* Version: 0.1.
|
|
3
|
+
* Version: 0.1.1
|
|
4
4
|
*
|
|
5
5
|
* Minimal p5.js-like runtime for deterministic generative art execution.
|
|
6
6
|
* This is a headless runtime - no UI dependencies.
|
|
@@ -13,6 +13,7 @@ export function createP5Runtime(canvas, width, height) {
|
|
|
13
13
|
let fillEnabled = true;
|
|
14
14
|
let currentStrokeWeight = 1;
|
|
15
15
|
let colorModeSettings = { mode: 'RGB', maxR: 255, maxG: 255, maxB: 255, maxA: 255 };
|
|
16
|
+
let shapeStarted = false;
|
|
16
17
|
const parseColor = (...args) => {
|
|
17
18
|
if (args.length === 0)
|
|
18
19
|
return 'rgba(0, 0, 0, 1)';
|
|
@@ -198,13 +199,14 @@ export function createP5Runtime(canvas, width, height) {
|
|
|
198
199
|
// Vertex-based shapes
|
|
199
200
|
beginShape: () => {
|
|
200
201
|
ctx.beginPath();
|
|
202
|
+
shapeStarted = false;
|
|
201
203
|
},
|
|
202
204
|
vertex: (x, y) => {
|
|
203
|
-
if (
|
|
204
|
-
ctx.
|
|
205
|
+
if (!shapeStarted) {
|
|
206
|
+
ctx.moveTo(x, y);
|
|
207
|
+
shapeStarted = true;
|
|
205
208
|
}
|
|
206
209
|
else {
|
|
207
|
-
ctx.moveTo(x, y);
|
|
208
210
|
ctx.lineTo(x, y);
|
|
209
211
|
}
|
|
210
212
|
},
|
|
@@ -216,6 +218,7 @@ export function createP5Runtime(canvas, width, height) {
|
|
|
216
218
|
ctx.fill();
|
|
217
219
|
if (strokeEnabled)
|
|
218
220
|
ctx.stroke();
|
|
221
|
+
shapeStarted = false;
|
|
219
222
|
},
|
|
220
223
|
// Transform functions
|
|
221
224
|
push: () => {
|