@drawcall/charta 0.1.11 → 0.1.12
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/dist/grammar.d.ts.map +1 -1
- package/dist/grammar.js +42 -76
- package/dist/grass/index.d.ts +5 -0
- package/dist/grass/index.d.ts.map +1 -1
- package/dist/grass/index.js +14 -0
- package/dist/pillars/index.d.ts +8 -1
- package/dist/pillars/index.d.ts.map +1 -1
- package/dist/pillars/index.js +16 -1
- package/dist/place/index.d.ts +8 -1
- package/dist/place/index.d.ts.map +1 -1
- package/dist/place/index.js +21 -1
- package/dist/tiles/index.d.ts +7 -1
- package/dist/tiles/index.d.ts.map +1 -1
- package/dist/tiles/index.js +32 -0
- package/dist/walls/index.d.ts +8 -1
- package/dist/walls/index.d.ts.map +1 -1
- package/dist/walls/index.js +29 -1
- package/dist/water/index.d.ts +7 -1
- package/dist/water/index.d.ts.map +1 -1
- package/dist/water/index.js +11 -0
- package/package.json +1 -1
package/dist/grammar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../src/grammar.ts"],"names":[],"mappings":"AAOA,UAAU,YAAY;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,IAAI,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC;IACrC,IAAI,EAAE,MAAM,GAAG,CAAC;IAChB,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;IACtC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CACrC;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,EAAE,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AA;CAAE,GAAG;IAAE,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAA;CAAE,CAAC;AAEnF,UAAU,OAAO;IACf,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,OAAO,EAAE,OAuEd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/dist/grammar.js
CHANGED
|
@@ -14,43 +14,35 @@ const grammar = {
|
|
|
14
14
|
{ "name": "File$ebnf$1", "symbols": ["NL"], "postprocess": id },
|
|
15
15
|
{ "name": "File$ebnf$1", "symbols": [], "postprocess": () => null },
|
|
16
16
|
{ "name": "File", "symbols": ["Rows", "File$ebnf$1"], "postprocess": (d) => d[0] },
|
|
17
|
-
{ "name": "NLS$ebnf$1", "symbols": ["NL"] },
|
|
18
|
-
{ "name": "NLS$ebnf$1", "symbols": ["NLS$ebnf$1", "NL"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
19
|
-
{ "name": "NLS", "symbols": ["NLS$ebnf$1"], "postprocess": () => null },
|
|
20
|
-
{ "name": "NL", "symbols": [{ "literal": "\n" }] },
|
|
21
17
|
{ "name": "Rows$ebnf$1", "symbols": [] },
|
|
22
|
-
{ "name": "Rows$ebnf$1$subexpression$1", "symbols": ["
|
|
18
|
+
{ "name": "Rows$ebnf$1$subexpression$1", "symbols": ["NL", "Row"] },
|
|
23
19
|
{ "name": "Rows$ebnf$1", "symbols": ["Rows$ebnf$1", "Rows$ebnf$1$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
24
20
|
{ "name": "Rows", "symbols": ["Row", "Rows$ebnf$1"], "postprocess": ([head, tail]) => [head, ...tail.map(([, row]) => row)] },
|
|
25
|
-
{ "name": "Row
|
|
26
|
-
{ "name": "
|
|
27
|
-
{ "name": "
|
|
28
|
-
{ "name": "
|
|
29
|
-
{ "name": "
|
|
30
|
-
{ "name": "
|
|
31
|
-
{ "name": "Row$ebnf$3", "symbols": ["Row$ebnf$3", "WS"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
32
|
-
{ "name": "Row", "symbols": ["Row$ebnf$1", "Cell", "Row$ebnf$2", "Row$ebnf$3"], "postprocess": (d, loc) => {
|
|
33
|
-
const head = d[1];
|
|
34
|
-
const tail = d[2];
|
|
35
|
-
const row = [head, ...tail.map(([, cell]) => cell)];
|
|
36
|
-
row.offset = loc;
|
|
37
|
-
return row;
|
|
38
|
-
} },
|
|
39
|
-
{ "name": "Cell$ebnf$1", "symbols": ["Calls"], "postprocess": id },
|
|
21
|
+
{ "name": "Row", "symbols": ["_", "CellList", "_"], "postprocess": (d, loc) => { const row = d[1]; row.offset = loc; return row; } },
|
|
22
|
+
{ "name": "CellList$ebnf$1", "symbols": [] },
|
|
23
|
+
{ "name": "CellList$ebnf$1$subexpression$1", "symbols": ["PIPE", "Cell"] },
|
|
24
|
+
{ "name": "CellList$ebnf$1", "symbols": ["CellList$ebnf$1", "CellList$ebnf$1$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
25
|
+
{ "name": "CellList", "symbols": ["Cell", "CellList$ebnf$1"], "postprocess": ([head, tail]) => [head, ...tail.map(([, cell]) => cell)] },
|
|
26
|
+
{ "name": "Cell$ebnf$1", "symbols": ["CallList"], "postprocess": id },
|
|
40
27
|
{ "name": "Cell$ebnf$1", "symbols": [], "postprocess": () => null },
|
|
41
28
|
{ "name": "Cell", "symbols": ["Cell$ebnf$1"], "postprocess": (d) => d[0] || [] },
|
|
42
|
-
{ "name": "
|
|
43
|
-
{ "name": "
|
|
44
|
-
{ "name": "
|
|
45
|
-
{ "name": "
|
|
46
|
-
{ "name": "Call", "symbols": ["Ident", "
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{ "name": "
|
|
53
|
-
{ "name": "
|
|
29
|
+
{ "name": "CallList$ebnf$1", "symbols": [] },
|
|
30
|
+
{ "name": "CallList$ebnf$1$subexpression$1", "symbols": ["__", "Call"] },
|
|
31
|
+
{ "name": "CallList$ebnf$1", "symbols": ["CallList$ebnf$1", "CallList$ebnf$1$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
32
|
+
{ "name": "CallList", "symbols": ["Call", "CallList$ebnf$1"], "postprocess": ([first, rest]) => [first, ...rest.map(([, c]) => c)] },
|
|
33
|
+
{ "name": "Call", "symbols": ["Ident", { "literal": "(" }, "Args", { "literal": ")" }], "postprocess": (d, loc) => ({
|
|
34
|
+
name: d[0],
|
|
35
|
+
locationParams: d[2].pos,
|
|
36
|
+
keyParams: d[2].kv,
|
|
37
|
+
offset: loc
|
|
38
|
+
}) },
|
|
39
|
+
{ "name": "Args$ebnf$1", "symbols": ["ArgItems"], "postprocess": id },
|
|
40
|
+
{ "name": "Args$ebnf$1", "symbols": [], "postprocess": () => null },
|
|
41
|
+
{ "name": "Args", "symbols": ["_", "Args$ebnf$1", "_"], "postprocess": (d) => d[1] || { pos: [], kv: [] } },
|
|
42
|
+
{ "name": "ArgItems$ebnf$1", "symbols": [] },
|
|
43
|
+
{ "name": "ArgItems$ebnf$1$subexpression$1", "symbols": ["COMMA", "Arg"] },
|
|
44
|
+
{ "name": "ArgItems$ebnf$1", "symbols": ["ArgItems$ebnf$1", "ArgItems$ebnf$1$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
45
|
+
{ "name": "ArgItems", "symbols": ["Arg", "ArgItems$ebnf$1"], "postprocess": (d) => {
|
|
54
46
|
const items = [d[0], ...d[1].map((x) => x[1])];
|
|
55
47
|
const pos = [];
|
|
56
48
|
const kv = [];
|
|
@@ -62,57 +54,31 @@ const grammar = {
|
|
|
62
54
|
}
|
|
63
55
|
return { pos, kv };
|
|
64
56
|
} },
|
|
65
|
-
{ "name": "
|
|
66
|
-
{ "name": "ArgsBlock", "symbols": ["_"], "postprocess": () => ({ pos: [], kv: [] }) },
|
|
67
|
-
{ "name": "Arg", "symbols": ["Ident", "WSOpt", "EQ", "WSOpt", "Value"], "postprocess": (d) => ({ kind: 'kv', key: d[0], value: d[4] }) },
|
|
57
|
+
{ "name": "Arg", "symbols": ["Ident", "_", { "literal": "=" }, "_", "Value"], "postprocess": (d) => ({ kind: 'kv', key: d[0], value: d[4] }) },
|
|
68
58
|
{ "name": "Arg", "symbols": ["Value"], "postprocess": (d) => d[0] },
|
|
69
|
-
{ "name": "Value", "symbols": ["
|
|
70
|
-
{ "name": "Value", "symbols": ["
|
|
71
|
-
{ "name": "
|
|
72
|
-
{ "name": "
|
|
73
|
-
{ "name": "
|
|
74
|
-
{ "name": "
|
|
75
|
-
{ "name": "
|
|
76
|
-
{ "name": "
|
|
77
|
-
{ "name": "
|
|
78
|
-
{ "name": "UnescapedString", "symbols": ["UnescapedString$ebnf$1"], "postprocess": (d) => d[0].join("") },
|
|
79
|
-
{ "name": "UnescapedStringChar", "symbols": [/[^ \t,()=|\n"]/] },
|
|
80
|
-
{ "name": "LPAREN", "symbols": [{ "literal": "(" }] },
|
|
81
|
-
{ "name": "RPAREN", "symbols": [{ "literal": ")" }] },
|
|
82
|
-
{ "name": "PIPE", "symbols": [{ "literal": "|" }] },
|
|
83
|
-
{ "name": "COMMA", "symbols": [{ "literal": "," }] },
|
|
84
|
-
{ "name": "EQ", "symbols": [{ "literal": "=" }] },
|
|
85
|
-
{ "name": "PIPESep$ebnf$1", "symbols": [] },
|
|
86
|
-
{ "name": "PIPESep$ebnf$1", "symbols": ["PIPESep$ebnf$1", "WS"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
87
|
-
{ "name": "PIPESep$ebnf$2", "symbols": [] },
|
|
88
|
-
{ "name": "PIPESep$ebnf$2", "symbols": ["PIPESep$ebnf$2", "WS"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
89
|
-
{ "name": "PIPESep", "symbols": ["PIPESep$ebnf$1", "PIPE", "PIPESep$ebnf$2"] },
|
|
90
|
-
{ "name": "COMMASEP$ebnf$1", "symbols": [] },
|
|
91
|
-
{ "name": "COMMASEP$ebnf$1", "symbols": ["COMMASEP$ebnf$1", "WS"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
92
|
-
{ "name": "COMMASEP$ebnf$2", "symbols": [] },
|
|
93
|
-
{ "name": "COMMASEP$ebnf$2", "symbols": ["COMMASEP$ebnf$2", "WS"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
94
|
-
{ "name": "COMMASEP", "symbols": ["COMMASEP$ebnf$1", "COMMA", "COMMASEP$ebnf$2"] },
|
|
59
|
+
{ "name": "Value", "symbols": [{ "literal": "\"" }, "QuotedContent", { "literal": "\"" }], "postprocess": (d) => d[1] },
|
|
60
|
+
{ "name": "Value", "symbols": ["UnquotedValue"], "postprocess": (d) => d[0] },
|
|
61
|
+
{ "name": "QuotedContent$ebnf$1", "symbols": [] },
|
|
62
|
+
{ "name": "QuotedContent$ebnf$1", "symbols": ["QuotedContent$ebnf$1", /[^"]/], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
63
|
+
{ "name": "QuotedContent", "symbols": ["QuotedContent$ebnf$1"], "postprocess": (d) => d[0].join("") },
|
|
64
|
+
{ "name": "UnquotedValue$ebnf$1", "symbols": ["UnquotedChar"] },
|
|
65
|
+
{ "name": "UnquotedValue$ebnf$1", "symbols": ["UnquotedValue$ebnf$1", "UnquotedChar"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
66
|
+
{ "name": "UnquotedValue", "symbols": ["UnquotedValue$ebnf$1"], "postprocess": (d) => d[0].join("") },
|
|
67
|
+
{ "name": "UnquotedChar", "symbols": [/[^ \t,()=|\n"]/] },
|
|
95
68
|
{ "name": "Ident$ebnf$1", "symbols": [] },
|
|
96
69
|
{ "name": "Ident$ebnf$1", "symbols": ["Ident$ebnf$1", "IdentRest"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
97
|
-
{ "name": "Ident", "symbols": ["IdentStart", "Ident$ebnf$1"], "postprocess": ([
|
|
70
|
+
{ "name": "Ident", "symbols": ["IdentStart", "Ident$ebnf$1"], "postprocess": ([s, r]) => s + r.join("") },
|
|
98
71
|
{ "name": "IdentStart", "symbols": [/[a-z_\/]/] },
|
|
99
72
|
{ "name": "IdentRest", "symbols": [/[a-z0-9A-Z_\/-]/] },
|
|
100
|
-
{ "name": "
|
|
101
|
-
{ "name": "
|
|
102
|
-
{ "name": "
|
|
103
|
-
{ "name": "WSOpt$ebnf$1", "symbols": [] },
|
|
104
|
-
{ "name": "WSOpt$ebnf$1", "symbols": ["WSOpt$ebnf$1", "WS"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
105
|
-
{ "name": "WSOpt", "symbols": ["WSOpt$ebnf$1"], "postprocess": () => null },
|
|
73
|
+
{ "name": "PIPE", "symbols": ["_", { "literal": "|" }, "_"], "postprocess": () => null },
|
|
74
|
+
{ "name": "COMMA", "symbols": ["_", { "literal": "," }, "_"], "postprocess": () => null },
|
|
75
|
+
{ "name": "NL", "symbols": [{ "literal": "\n" }], "postprocess": () => null },
|
|
106
76
|
{ "name": "_$ebnf$1", "symbols": [] },
|
|
107
|
-
{ "name": "_$ebnf$1
|
|
108
|
-
{ "name": "_$ebnf$1", "symbols": ["_$ebnf$1", "_$ebnf$1$subexpression$1"], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
77
|
+
{ "name": "_$ebnf$1", "symbols": ["_$ebnf$1", /[ \t]/], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
109
78
|
{ "name": "_", "symbols": ["_$ebnf$1"], "postprocess": () => null },
|
|
110
|
-
{ "name": "__$ebnf$1", "symbols": [
|
|
111
|
-
{ "name": "__$ebnf$1", "symbols": ["__$ebnf$1",
|
|
112
|
-
{ "name": "__", "symbols": ["__$ebnf$1"], "postprocess": () => null }
|
|
113
|
-
{ "name": "_unit", "symbols": ["WS"] },
|
|
114
|
-
{ "name": "WS", "symbols": [/[ \t]/] },
|
|
115
|
-
{ "name": "notnl", "symbols": [/[^\n]/] }
|
|
79
|
+
{ "name": "__$ebnf$1", "symbols": [/[ \t]/] },
|
|
80
|
+
{ "name": "__$ebnf$1", "symbols": ["__$ebnf$1", /[ \t]/], "postprocess": (d) => d[0].concat([d[1]]) },
|
|
81
|
+
{ "name": "__", "symbols": ["__$ebnf$1"], "postprocess": () => null }
|
|
116
82
|
],
|
|
117
83
|
ParserStart: "File",
|
|
118
84
|
};
|
package/dist/grass/index.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ export type GrassOptions = GrassMaterialOptions & {
|
|
|
18
18
|
* Default: 0.8.
|
|
19
19
|
*/
|
|
20
20
|
variationStrength?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Mock mode: validates grass() calls exist but skips expensive blade generation.
|
|
23
|
+
* Useful for server-side validation. Default: false.
|
|
24
|
+
*/
|
|
25
|
+
mock?: boolean;
|
|
21
26
|
};
|
|
22
27
|
export declare class GrassMesh extends InstancedMesh {
|
|
23
28
|
constructor(interpreter: Interpreter, material?: Material, opts?: GrassOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/grass/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACb,QAAQ,EAMT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAY9E,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/grass/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACb,QAAQ,EAMT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAY9E,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,qBAAa,SAAU,SAAQ,aAAa;gBAExC,WAAW,EAAE,WAAW,EACxB,QAAQ,GAAE,QAAkC,EAC5C,IAAI,GAAE,YAAiB;CAoP1B"}
|
package/dist/grass/index.js
CHANGED
|
@@ -11,6 +11,20 @@ const UpVector = new Vector3(0, 1, 0);
|
|
|
11
11
|
const colorHelper = new Color();
|
|
12
12
|
export class GrassMesh extends InstancedMesh {
|
|
13
13
|
constructor(interpreter, material = new MeshPhongMaterial(), opts = {}) {
|
|
14
|
+
// Mock mode: validate grass calls exist, skip geometry allocation entirely
|
|
15
|
+
if (opts.mock) {
|
|
16
|
+
super(undefined, material, 0);
|
|
17
|
+
// Still validate all grass() calls to catch errors
|
|
18
|
+
const rows = interpreter.getRows();
|
|
19
|
+
const cols = interpreter.getCols();
|
|
20
|
+
for (let row = 0; row < rows; row++) {
|
|
21
|
+
for (let col = 0; col < cols; col++) {
|
|
22
|
+
// getCalls validates the schema and reports errors
|
|
23
|
+
interpreter.getCalls([row, col], { grass: grassSchema });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
14
28
|
material.side = DoubleSide;
|
|
15
29
|
const rows = interpreter.getRows();
|
|
16
30
|
const cols = interpreter.getCols();
|
package/dist/pillars/index.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { InstancedMesh, Material } from 'three';
|
|
2
2
|
import { Interpreter } from '../interpreter.js';
|
|
3
3
|
export type PillarCorner = 'topleft' | 'topright' | 'bottomright' | 'bottomleft';
|
|
4
|
+
export type PillarMeshOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* Mock mode: validates pillar calls but skips geometry creation.
|
|
7
|
+
* Useful for server-side validation. Default: false.
|
|
8
|
+
*/
|
|
9
|
+
mock?: boolean;
|
|
10
|
+
};
|
|
4
11
|
export declare class PillarMesh extends InstancedMesh {
|
|
5
|
-
constructor(interpreter: Interpreter, material?: Material);
|
|
12
|
+
constructor(interpreter: Interpreter, material?: Material, options?: PillarMeshOptions);
|
|
6
13
|
}
|
|
7
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pillars/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAEb,QAAQ,EAMT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAO/C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,YAAY,CAAA;AAuBhF,qBAAa,UAAW,SAAQ,aAAa;gBAC/B,WAAW,EAAE,WAAW,EAAE,QAAQ,GAAE,QAAkC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pillars/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAEb,QAAQ,EAMT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAO/C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,YAAY,CAAA;AAuBhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,UAAW,SAAQ,aAAa;gBAC/B,WAAW,EAAE,WAAW,EAAE,QAAQ,GAAE,QAAkC,EAAE,OAAO,GAAE,iBAAsB;CAoLpH"}
|
package/dist/pillars/index.js
CHANGED
|
@@ -14,10 +14,25 @@ const pillarSchema = object({
|
|
|
14
14
|
topY: coerce.number().optional(),
|
|
15
15
|
});
|
|
16
16
|
export class PillarMesh extends InstancedMesh {
|
|
17
|
-
constructor(interpreter, material = new MeshBasicMaterial()) {
|
|
17
|
+
constructor(interpreter, material = new MeshBasicMaterial(), options = {}) {
|
|
18
18
|
const rows = interpreter.getRows();
|
|
19
19
|
const cols = interpreter.getCols();
|
|
20
20
|
const cellSize = interpreter.getCellSize();
|
|
21
|
+
// Mock mode: validate calls exist but skip geometry creation
|
|
22
|
+
if (options.mock) {
|
|
23
|
+
// Use undefined geometry with 0 instances - no memory allocation
|
|
24
|
+
super(undefined, material, 0);
|
|
25
|
+
for (let row = 0; row < rows; row++) {
|
|
26
|
+
for (let col = 0; col < cols; col++) {
|
|
27
|
+
const entries = interpreter.getCalls([row, col], { pillar: pillarSchema });
|
|
28
|
+
for (const [, parsed, , loc] of entries) {
|
|
29
|
+
// Validate texture reference
|
|
30
|
+
interpreter.getAsset(Texture, `${parsed.texture}BaseColorTexture`, loc);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
21
36
|
// Collect pillar instances with resolved heights
|
|
22
37
|
const pillars = [];
|
|
23
38
|
// tilesGeometry is only required for height sampling; fetch lazily where needed
|
package/dist/place/index.d.ts
CHANGED
|
@@ -22,9 +22,16 @@ export declare class PrefabBatchBuilder {
|
|
|
22
22
|
add(matrix: Matrix4): this;
|
|
23
23
|
build(): Object3D;
|
|
24
24
|
}
|
|
25
|
+
export type PlaceGroupOptions = {
|
|
26
|
+
/**
|
|
27
|
+
* Mock mode: validates scatter/place calls exist but skips expensive instance generation.
|
|
28
|
+
* Useful for server-side validation. Default: false.
|
|
29
|
+
*/
|
|
30
|
+
mock?: boolean;
|
|
31
|
+
};
|
|
25
32
|
export declare class PlaceGroup extends Group {
|
|
26
33
|
private batchBuilders;
|
|
27
|
-
constructor(interpreter: Interpreter, _materialFallback?: Material);
|
|
34
|
+
constructor(interpreter: Interpreter, _materialFallback?: Material, opts?: PlaceGroupOptions);
|
|
28
35
|
dispose(): void;
|
|
29
36
|
}
|
|
30
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/place/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAQ,MAAM,OAAO,CAAA;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAmC/C,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;AAEvD,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE;IACvC,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,UAAU,CAAA;IACpB,KAAK,EAAE,OAAO,CAAA;IACd,WAAW,EAAE,WAAW,CAAA;IACxB,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAA;IAC5D,IAAI,EAAE,MAAM,CAAA;CACb,KAAK,IAAI,CAAA;AAKV,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAOvD;AAED,qBAAa,kBAAkB;aAIX,UAAU,EAAE,OAAO;IACnC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAJpC,OAAO,CAAC,QAAQ,CAAqB;gBAGnB,UAAU,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AO,CAAC,KAAK,QAAQ;IAG5E,GAAG,CAAC,MAAM,EAAE,OAAO;IAKZ,KAAK,IAAI,QAAQ;CAKzB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAA;AAED,qBAAa,UAAW,SAAQ,KAAK;IACnC,OAAO,CAAC,aAAa,CAAgC;gBAEzC,WAAW,EAAE,WAAW,EAAE,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAE,iBAAsB;IA2OhG,OAAO;CAOR"}
|
package/dist/place/index.js
CHANGED
|
@@ -59,8 +59,28 @@ export class PrefabBatchBuilder {
|
|
|
59
59
|
}
|
|
60
60
|
export class PlaceGroup extends Group {
|
|
61
61
|
batchBuilders = new Set();
|
|
62
|
-
constructor(interpreter, _materialFallback) {
|
|
62
|
+
constructor(interpreter, _materialFallback, opts = {}) {
|
|
63
63
|
super();
|
|
64
|
+
// Mock mode: validate scatter/place calls exist, skip expensive generation
|
|
65
|
+
if (opts.mock) {
|
|
66
|
+
const rows = interpreter.getRows();
|
|
67
|
+
const cols = interpreter.getCols();
|
|
68
|
+
for (let row = 0; row < rows; row++) {
|
|
69
|
+
for (let col = 0; col < cols; col++) {
|
|
70
|
+
// getCalls validates the schema and reports errors
|
|
71
|
+
const scatterEntries = interpreter.getCalls([row, col], { scatter: scatterSchema });
|
|
72
|
+
const placeEntries = interpreter.getCalls([row, col], { place: placeSchema });
|
|
73
|
+
// Validate that referenced models exist (triggers "unknown asset" errors)
|
|
74
|
+
for (const [, parsed, , loc] of scatterEntries) {
|
|
75
|
+
interpreter.getAsset(PrefabBatchBuilder, `${parsed.model}Prefab`, loc);
|
|
76
|
+
}
|
|
77
|
+
for (const [, parsed, , loc] of placeEntries) {
|
|
78
|
+
interpreter.getAsset(PrefabBatchBuilder, `${parsed.model}Prefab`, loc);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
64
84
|
const rows = interpreter.getRows();
|
|
65
85
|
const cols = interpreter.getCols();
|
|
66
86
|
const cellSize = interpreter.getCellSize();
|
package/dist/tiles/index.d.ts
CHANGED
|
@@ -10,7 +10,13 @@ export declare const ceilingSchema: import("zod").ZodObject<{
|
|
|
10
10
|
texture: import("zod").ZodString;
|
|
11
11
|
y: coerce.ZodCoercedNumber<unknown>;
|
|
12
12
|
}, import("zod/v4/core").$strip>;
|
|
13
|
-
export type TilesMeshOptions = {
|
|
13
|
+
export type TilesMeshOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* Mock mode: validates ground/ceiling/wall calls but skips geometry creation.
|
|
16
|
+
* Useful for server-side validation. Default: false.
|
|
17
|
+
*/
|
|
18
|
+
mock?: boolean;
|
|
19
|
+
};
|
|
14
20
|
export declare class TilesMesh extends Mesh<TilesGeometry> {
|
|
15
21
|
constructor(interpreter: Interpreter, material?: Material, options?: TilesMeshOptions);
|
|
16
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tiles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,IAAI,EAOL,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAkB,MAAM,KAAK,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAuB,MAAM,eAAe,CAAA;AAMlE,eAAO,MAAM,YAAY;;;gCAAoD,CAAA;AAC7E,eAAO,MAAM,aAAa;;;gCAAoD,CAAA;AAE9E,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tiles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,IAAI,EAOL,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAkB,MAAM,KAAK,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAuB,MAAM,eAAe,CAAA;AAMlE,eAAO,MAAM,YAAY;;;gCAAoD,CAAA;AAC7E,eAAO,MAAM,aAAa;;;gCAAoD,CAAA;AAE9E,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAyCD,qBAAa,SAAU,SAAQ,IAAI,CAAC,aAAa,CAAC;gBACpC,WAAW,EAAE,WAAW,EAAE,QAAQ,GAAE,QAAkC,EAAE,OAAO,GAAE,gBAAqB;CA0JnH"}
|
package/dist/tiles/index.js
CHANGED
|
@@ -36,6 +36,38 @@ export class TilesMesh extends Mesh {
|
|
|
36
36
|
constructor(interpreter, material = new MeshBasicMaterial(), options = {}) {
|
|
37
37
|
const rows = interpreter.getRows();
|
|
38
38
|
const cols = interpreter.getCols();
|
|
39
|
+
// Mock mode: validate calls exist but skip geometry creation
|
|
40
|
+
if (options.mock) {
|
|
41
|
+
super(undefined);
|
|
42
|
+
for (let row = 0; row < rows; row++) {
|
|
43
|
+
for (let col = 0; col < cols; col++) {
|
|
44
|
+
// Validate all ground/ceiling/wall calls and their parameters
|
|
45
|
+
const calls = interpreter.getCalls([row, col], {
|
|
46
|
+
ground: groundSchema,
|
|
47
|
+
ceiling: ceilingSchema,
|
|
48
|
+
wall: wallSchema,
|
|
49
|
+
});
|
|
50
|
+
// Also validate wall heights using the helper
|
|
51
|
+
resolveHeights([row, col], calls.map(([_1, parsed, _2, loc]) => ({
|
|
52
|
+
loc,
|
|
53
|
+
layerY: 'y' in parsed ? parsed.y : undefined,
|
|
54
|
+
explicitWallY: 'bottomY' in parsed ? parsed.bottomY : undefined,
|
|
55
|
+
})), interpreter, false);
|
|
56
|
+
resolveHeights([row, col], calls.map(([_1, parsed, _2, loc]) => ({
|
|
57
|
+
loc,
|
|
58
|
+
layerY: 'y' in parsed ? parsed.y : undefined,
|
|
59
|
+
explicitWallY: 'topY' in parsed ? parsed.topY : undefined,
|
|
60
|
+
})), interpreter, true);
|
|
61
|
+
// Validate texture references
|
|
62
|
+
for (const [name, parsed, , loc] of calls) {
|
|
63
|
+
if (name === 'ground' || name === 'ceiling') {
|
|
64
|
+
interpreter.getAsset(Texture, `${parsed.texture}BaseColorTexture`, loc);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
39
71
|
// Helper to manage texture indices on the fly
|
|
40
72
|
const textureIndex = new Map();
|
|
41
73
|
const getTextureIndex = (name, loc) => {
|
package/dist/walls/index.d.ts
CHANGED
|
@@ -80,8 +80,15 @@ export declare function computeWallVerticalBounds(interpreter: Interpreter, tile
|
|
|
80
80
|
worldWallX: number;
|
|
81
81
|
worldWallZ: number;
|
|
82
82
|
} | undefined;
|
|
83
|
+
export type WallMeshOptions = {
|
|
84
|
+
/**
|
|
85
|
+
* Mock mode: validates wall/window/door calls but skips geometry creation.
|
|
86
|
+
* Useful for server-side validation. Default: false.
|
|
87
|
+
*/
|
|
88
|
+
mock?: boolean;
|
|
89
|
+
};
|
|
83
90
|
export declare class WallMesh extends Mesh {
|
|
84
|
-
constructor(interpreter: Interpreter, material?: Material);
|
|
91
|
+
constructor(interpreter: Interpreter, material?: Material, options?: WallMeshOptions);
|
|
85
92
|
}
|
|
86
93
|
export declare function isLayerConnectedToWall(wallTopY: number, wallBotY: number, y: number, tileSize: number): boolean;
|
|
87
94
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/walls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAER,IAAI,EAGJ,YAAY,EAEZ,YAAY,EAOb,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;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AM,EACX,OAAO,EAAE,MAAM,EACf,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACxD,MAAM,EAAE,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,EACtD,GAAG,EAAE,aAAa;;;;;cAqInB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,QAAS,SAAQ,IAAI;gBACpB,WAAW,EAAE,WAAW,EAAE,QAAQ,GAAE,QAAkC,EAAE,OAAO,GAAE,eAAoB;CA6SlH;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAGrG"}
|
package/dist/walls/index.js
CHANGED
|
@@ -160,10 +160,38 @@ export function computeWallVerticalBounds(interpreter, tilesGeometry, row, col,
|
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
export class WallMesh extends Mesh {
|
|
163
|
-
constructor(interpreter, material = new MeshBasicMaterial()) {
|
|
163
|
+
constructor(interpreter, material = new MeshBasicMaterial(), options = {}) {
|
|
164
164
|
const rows = interpreter.getRows();
|
|
165
165
|
const cols = interpreter.getCols();
|
|
166
166
|
const cellSize = interpreter.getCellSize();
|
|
167
|
+
// Mock mode: validate calls exist but skip geometry creation
|
|
168
|
+
if (options.mock) {
|
|
169
|
+
super();
|
|
170
|
+
for (let row = 0; row < rows; row++) {
|
|
171
|
+
for (let col = 0; col < cols; col++) {
|
|
172
|
+
// Validate all wall/window/door calls
|
|
173
|
+
const entries = interpreter.getCalls([row, col], {
|
|
174
|
+
wall: wallSchema,
|
|
175
|
+
window: windowSchema,
|
|
176
|
+
door: doorSchema,
|
|
177
|
+
});
|
|
178
|
+
// Validate texture references and wall ordering
|
|
179
|
+
let hasWall = false;
|
|
180
|
+
for (const [name, parsed, , loc] of entries) {
|
|
181
|
+
if (name === 'wall') {
|
|
182
|
+
hasWall = true;
|
|
183
|
+
interpreter.getAsset(Texture, `${parsed.texture}BaseColorTexture`, loc);
|
|
184
|
+
}
|
|
185
|
+
else if (name === 'window' || name === 'door') {
|
|
186
|
+
if (!hasWall) {
|
|
187
|
+
interpreter.reportError(new ChartaError(`${name} without preceding wall`, interpreter.getSource(), loc));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
167
195
|
const tilesGeometry = interpreter.getAsset(TilesGeometry, 'tilesGeometry');
|
|
168
196
|
if (!tilesGeometry) {
|
|
169
197
|
super();
|
package/dist/water/index.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Mesh } from "three";
|
|
2
2
|
import { Interpreter } from "../interpreter.js";
|
|
3
|
-
export type WaterMeshOptions = {
|
|
3
|
+
export type WaterMeshOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* Mock mode: validates water calls but skips geometry creation.
|
|
6
|
+
* Useful for server-side validation. Default: false.
|
|
7
|
+
*/
|
|
8
|
+
mock?: boolean;
|
|
9
|
+
};
|
|
4
10
|
export declare class WaterMesh extends Mesh {
|
|
5
11
|
constructor(interpreter: Interpreter, options?: WaterMeshOptions);
|
|
6
12
|
dispose(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/water/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAY,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/water/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAY,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAIF,qBAAa,SAAU,SAAQ,IAAI;gBACrB,WAAW,EAAE,WAAW,EAAE,OAAO,GAAE,gBAAqB;IAkDpE,OAAO,IAAI,IAAI;CAMhB;AAED,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
|
package/dist/water/index.js
CHANGED
|
@@ -6,6 +6,17 @@ export class WaterMesh extends Mesh {
|
|
|
6
6
|
constructor(interpreter, options = {}) {
|
|
7
7
|
const rows = interpreter.getRows();
|
|
8
8
|
const cols = interpreter.getCols();
|
|
9
|
+
// Mock mode: validate calls exist but skip geometry creation
|
|
10
|
+
if (options.mock) {
|
|
11
|
+
super();
|
|
12
|
+
for (let row = 0; row < rows; row++) {
|
|
13
|
+
for (let col = 0; col < cols; col++) {
|
|
14
|
+
// Validate water calls
|
|
15
|
+
interpreter.getCalls([row, col], { water: waterSchema });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
9
20
|
// Build tiles[row][col] => Array<Tile>, containing only water tiles
|
|
10
21
|
const tiles = new Array(rows)
|
|
11
22
|
.fill(undefined)
|