@developerz.ai/ts23d 0.1.0 → 0.2.0
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/CHANGELOG.md +11 -0
- package/CLAUDE.md +1 -1
- package/README.md +10 -5
- package/dist/{chunk-a8fxakcj.js → chunk-6b05mnmx.js} +2 -2
- package/dist/{chunk-kgvbpqqw.js → chunk-7rtfjh9f.js} +6 -5
- package/dist/chunk-7rtfjh9f.js.map +10 -0
- package/dist/{chunk-1ypfs7ga.js → chunk-8j4c28jt.js} +790 -276
- package/dist/chunk-8j4c28jt.js.map +46 -0
- package/dist/{chunk-wtqhq529.js → chunk-d1fv6hrm.js} +6 -6
- package/dist/{chunk-wtqhq529.js.map → chunk-d1fv6hrm.js.map} +1 -1
- package/dist/{chunk-gcyp9b4d.js → chunk-dbq4qf52.js} +362 -215
- package/dist/chunk-dbq4qf52.js.map +25 -0
- package/dist/{chunk-xnt2sdhf.js → chunk-drna2rny.js} +2 -2
- package/dist/{chunk-ravbb06q.js → chunk-dxvypr7y.js} +2 -2
- package/dist/{chunk-11v28977.js → chunk-f6yme003.js} +85 -71
- package/dist/{chunk-11v28977.js.map → chunk-f6yme003.js.map} +6 -6
- package/dist/{chunk-4ddzsqtc.js → chunk-hg7pf34j.js} +4 -3
- package/dist/{chunk-4ddzsqtc.js.map → chunk-hg7pf34j.js.map} +5 -5
- package/dist/{chunk-w1zyhj40.js → chunk-jq4e17tj.js} +2 -2
- package/dist/{chunk-kvcep7ft.js → chunk-y63c6zcv.js} +967 -218
- package/dist/chunk-y63c6zcv.js.map +53 -0
- package/dist/cli/args.d.ts +7 -1
- package/dist/cli/bin.js +66 -25
- package/dist/cli/bin.js.map +6 -5
- package/dist/cli/manifest.d.ts +5 -1
- package/dist/cli/texture-cache.d.ts +4 -0
- package/dist/core/definition.d.ts +7 -0
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/export/credits.d.ts +4 -0
- package/dist/export/glb-options.d.ts +48 -0
- package/dist/export/glb.d.ts +5 -35
- package/dist/export/hierarchy.d.ts +23 -0
- package/dist/export/index.d.ts +2 -1
- package/dist/export/index.js +21 -7
- package/dist/export/index.js.map +1 -1
- package/dist/export/lod-coverage.d.ts +12 -0
- package/dist/export/metadata.d.ts +2 -0
- package/dist/export/version.d.ts +2 -2
- package/dist/grammar/index.js +2 -2
- package/dist/index.js +63 -17
- package/dist/index.js.map +1 -1
- package/dist/kinds/head-armour.d.ts +3 -7
- package/dist/kinds/head-bust.d.ts +3 -2
- package/dist/kinds/head-face.d.ts +3 -1
- package/dist/kinds/head-garb.d.ts +4 -0
- package/dist/kinds/head-mesh.d.ts +4 -0
- package/dist/kinds/head-mouth.d.ts +4 -0
- package/dist/kinds/head-params.d.ts +9 -1
- package/dist/kinds/head-tone.d.ts +10 -0
- package/dist/kinds/head-torso.d.ts +35 -0
- package/dist/kinds/index.js +6 -6
- package/dist/material/cc0.d.ts +4 -0
- package/dist/material/define.d.ts +34 -0
- package/dist/material/generator.d.ts +1 -1
- package/dist/material/index.d.ts +8 -3
- package/dist/material/index.js +39 -7
- package/dist/material/index.js.map +1 -1
- package/dist/material/library.d.ts +7 -0
- package/dist/material/material-def.d.ts +30 -0
- package/dist/material/paint/canvas.d.ts +7 -0
- package/dist/material/paint/default-sheet.d.ts +3 -1
- package/dist/material/paint/fabric.d.ts +4 -0
- package/dist/material/paint/image-strip.d.ts +4 -0
- package/dist/material/paint/kit.d.ts +5 -0
- package/dist/material/paint/metal.d.ts +3 -0
- package/dist/material/paint/orm.d.ts +1 -1
- package/dist/material/paint/strip.d.ts +1 -1
- package/dist/material/paint/types.d.ts +32 -2
- package/dist/material/palette.d.ts +2 -0
- package/dist/material/slots.d.ts +5 -0
- package/dist/material/texture-source.d.ts +34 -0
- package/dist/material/trim-sheet.d.ts +20 -4
- package/dist/neural/index.js +2 -2
- package/dist/passes/index.js +2 -2
- package/dist/primitives/index.js +3 -3
- package/dist/qa/index.js +2 -2
- package/dist/render/beauty.d.ts +1 -1
- package/dist/render/index.js +3 -3
- package/dist/render/lighting.d.ts +7 -0
- package/dist/render/shade.d.ts +1 -1
- package/dist/testing/index.js +5 -5
- package/docs/README.md +4 -0
- package/docs/architecture/gltf-capabilities.md +38 -1
- package/docs/architecture/materials.md +151 -0
- package/docs/idea/10-sculpting.md +166 -0
- package/docs/idea/11-materials-authoring.md +132 -0
- package/docs/idea/12-blender-bridge.md +136 -0
- package/docs/idea/13-asset-pipeline-research.md +89 -0
- package/docs/plans/roadmap.md +12 -0
- package/package.json +2 -1
- package/recipes/boxcar/README.md +7 -0
- package/recipes/boxcar/boxcar.ts +118 -34
- package/recipes/goblin_head/README.md +27 -14
- package/recipes/goblin_head/goblin_head.ts +11 -9
- package/recipes/human_head/README.md +8 -4
- package/recipes/human_head/human_head.ts +4 -3
- package/recipes/material_swatches/material_swatches.ts +11 -5
- package/recipes/orc_head/README.md +32 -20
- package/recipes/orc_head/orc_head.ts +9 -7
- package/src/cli/args.ts +16 -3
- package/src/cli/manifest.ts +6 -0
- package/src/cli/run.ts +33 -9
- package/src/cli/texture-cache.ts +24 -0
- package/src/core/asset.ts +1 -0
- package/src/core/definition.ts +7 -0
- package/src/core/errors.ts +6 -1
- package/src/export/credits.ts +25 -0
- package/src/export/glb-options.ts +53 -0
- package/src/export/glb.ts +100 -113
- package/src/export/hierarchy.ts +122 -0
- package/src/export/index.ts +17 -1
- package/src/export/lod-coverage.ts +71 -0
- package/src/export/metadata.ts +3 -0
- package/src/export/version.ts +1 -1
- package/src/kinds/head-armour.ts +103 -73
- package/src/kinds/head-bust.ts +49 -86
- package/src/kinds/head-face.ts +94 -74
- package/src/kinds/head-garb.ts +181 -0
- package/src/kinds/head-hair.ts +74 -33
- package/src/kinds/head-mesh.ts +43 -5
- package/src/kinds/head-mouth.ts +111 -0
- package/src/kinds/head-params.ts +11 -2
- package/src/kinds/head-presets.ts +30 -27
- package/src/kinds/head-tone.ts +52 -0
- package/src/kinds/head-torso.ts +230 -0
- package/src/kinds/head.ts +8 -3
- package/src/material/cc0.ts +41 -0
- package/src/material/define.ts +130 -0
- package/src/material/generator.ts +15 -8
- package/src/material/index.ts +34 -3
- package/src/material/library.ts +196 -0
- package/src/material/material-def.ts +84 -0
- package/src/material/paint/canvas.ts +11 -1
- package/src/material/paint/compose.ts +1 -1
- package/src/material/paint/decode-png.ts +19 -13
- package/src/material/paint/default-sheet.ts +40 -28
- package/src/material/paint/fabric.ts +63 -0
- package/src/material/paint/image-strip.ts +88 -0
- package/src/material/paint/kit.ts +37 -0
- package/src/material/paint/masks.ts +3 -1
- package/src/material/paint/metal.ts +109 -0
- package/src/material/paint/orm.ts +14 -1
- package/src/material/paint/planks.ts +49 -4
- package/src/material/paint/strip.ts +35 -29
- package/src/material/paint/types.ts +45 -2
- package/src/material/paint/validate.ts +19 -3
- package/src/material/palette.ts +3 -0
- package/src/material/slots.ts +18 -0
- package/src/material/texture-source.ts +86 -0
- package/src/material/trim-sheet.ts +79 -13
- package/src/render/beauty.ts +2 -2
- package/src/render/lighting.ts +26 -0
- package/src/render/shade.ts +10 -5
- package/dist/chunk-1ypfs7ga.js.map +0 -42
- package/dist/chunk-gcyp9b4d.js.map +0 -22
- package/dist/chunk-kgvbpqqw.js.map +0 -10
- package/dist/chunk-kvcep7ft.js.map +0 -43
- /package/dist/{chunk-a8fxakcj.js.map → chunk-6b05mnmx.js.map} +0 -0
- /package/dist/{chunk-xnt2sdhf.js.map → chunk-drna2rny.js.map} +0 -0
- /package/dist/{chunk-ravbb06q.js.map → chunk-dxvypr7y.js.map} +0 -0
- /package/dist/{chunk-w1zyhj40.js.map → chunk-jq4e17tj.js.map} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CompiledAsset } from '../core/index.js';
|
|
2
|
+
export declare const MSFT_LOD = "MSFT_lod";
|
|
3
|
+
export declare const SCREEN_COVERAGE = "MSFT_screencoverage";
|
|
4
|
+
export type LodCoverage = readonly [number, number, number];
|
|
5
|
+
/** Default [LOD0→1, LOD1→2, cull] for an asset from its compiled LODs (any subset, LOD0 first). */
|
|
6
|
+
export declare function defaultCoverage(lods: readonly CompiledAsset[]): LodCoverage;
|
|
7
|
+
export declare function checkCoverage(c: readonly number[], asset: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* MSFT_screencoverage for the LODs actually written (e.g. [0, 2]): entry j is the coverage where
|
|
10
|
+
* LOD j hands over — to the next included LOD's switch point, or to nothing (cull) for the last.
|
|
11
|
+
*/
|
|
12
|
+
export declare function coverageFor(levels: readonly number[], c: LodCoverage): number[];
|
|
@@ -10,6 +10,8 @@ export interface GlbMeta {
|
|
|
10
10
|
readonly license?: string;
|
|
11
11
|
/** Where the numbers came from (the recipe's `sources`) → `dc:relation`. */
|
|
12
12
|
readonly sources?: readonly string[];
|
|
13
|
+
/** Third-party inputs (e.g. CC0 texture sets) → `dc:contributor`. Filled by export. */
|
|
14
|
+
readonly credits?: readonly string[];
|
|
13
15
|
}
|
|
14
16
|
/** `asset` block, plus root `extensions` and the extension name when an XMP packet is written. */
|
|
15
17
|
export declare function metadata(name: string, meta: GlbMeta | undefined): {
|
package/dist/export/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
2
|
-
export declare const GENERATOR = "@developerz.ai/ts23d 0.
|
|
1
|
+
export declare const VERSION = "0.2.0";
|
|
2
|
+
export declare const GENERATOR = "@developerz.ai/ts23d 0.2.0";
|
package/dist/grammar/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,24 +30,40 @@ import {
|
|
|
30
30
|
rotateZ2,
|
|
31
31
|
worldMesh2,
|
|
32
32
|
worldMeshes2
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-hg7pf34j.js";
|
|
34
34
|
import {
|
|
35
|
+
CC0_WOOD_PLANKS_GREY2,
|
|
36
|
+
CC0_MATERIALS2,
|
|
37
|
+
MATERIAL_LIBRARY2,
|
|
38
|
+
hex2,
|
|
39
|
+
NATURAL2,
|
|
40
|
+
definePalette2,
|
|
41
|
+
palettes2,
|
|
42
|
+
provideTextures2,
|
|
43
|
+
creditOf2,
|
|
44
|
+
DEFAULT_SHEET2,
|
|
45
|
+
STRIP_ROWS2,
|
|
46
|
+
CUSTOM_STRIP_SLOTS2,
|
|
35
47
|
TRIM_SHEET_SIZE2,
|
|
48
|
+
stripRow2,
|
|
36
49
|
stripRect2,
|
|
37
50
|
cellRect2,
|
|
38
51
|
STRIPS2,
|
|
52
|
+
CLASSIC_STRIPS2,
|
|
53
|
+
MATERIAL_STRIPS2,
|
|
39
54
|
CELLS2,
|
|
40
55
|
DECAL_CELLS2,
|
|
41
56
|
FOLIAGE_CELLS2,
|
|
42
57
|
isFoliage2,
|
|
43
|
-
|
|
58
|
+
defineMaterial2,
|
|
59
|
+
resetMaterials2,
|
|
60
|
+
materialOf2,
|
|
61
|
+
textureSources2,
|
|
62
|
+
stripCredits2,
|
|
44
63
|
paintTrimSheet2,
|
|
45
|
-
hex2,
|
|
46
|
-
definePalette2,
|
|
47
|
-
palettes2,
|
|
48
64
|
threeMaterialSource2,
|
|
49
65
|
godotShaderSource2
|
|
50
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-y63c6zcv.js";
|
|
51
67
|
import {
|
|
52
68
|
RayGrid2,
|
|
53
69
|
bakeAo2,
|
|
@@ -56,8 +72,13 @@ import {
|
|
|
56
72
|
livery2,
|
|
57
73
|
optimize2,
|
|
58
74
|
weightedNormals2
|
|
59
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-drna2rny.js";
|
|
60
76
|
import {
|
|
77
|
+
MSFT_LOD2,
|
|
78
|
+
SCREEN_COVERAGE2,
|
|
79
|
+
defaultCoverage2,
|
|
80
|
+
checkCoverage2,
|
|
81
|
+
coverageFor2,
|
|
61
82
|
mergeToPivots2,
|
|
62
83
|
summarize2,
|
|
63
84
|
optimizeParts2,
|
|
@@ -65,8 +86,10 @@ import {
|
|
|
65
86
|
sheetFileName2,
|
|
66
87
|
sheetPngs2,
|
|
67
88
|
toGlb2,
|
|
68
|
-
exportGlb2
|
|
69
|
-
|
|
89
|
+
exportGlb2,
|
|
90
|
+
toLodGlb2,
|
|
91
|
+
exportLodGlb2
|
|
92
|
+
} from "./chunk-dbq4qf52.js";
|
|
70
93
|
import {
|
|
71
94
|
pointTriangleDistance2,
|
|
72
95
|
TriangleGrid2,
|
|
@@ -103,13 +126,13 @@ import {
|
|
|
103
126
|
lodPivots2,
|
|
104
127
|
DEFAULT_LOD_GATES2,
|
|
105
128
|
runLodQa2
|
|
106
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-jq4e17tj.js";
|
|
107
130
|
import {
|
|
108
131
|
parseSplit2,
|
|
109
132
|
layoutSplit2,
|
|
110
133
|
split2,
|
|
111
134
|
parseWhyte2
|
|
112
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-dxvypr7y.js";
|
|
113
136
|
import {
|
|
114
137
|
box2,
|
|
115
138
|
lathe2,
|
|
@@ -147,7 +170,7 @@ import {
|
|
|
147
170
|
text2,
|
|
148
171
|
tiled2,
|
|
149
172
|
valueNoise3
|
|
150
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-d1fv6hrm.js";
|
|
151
174
|
import {
|
|
152
175
|
mass2,
|
|
153
176
|
opening2,
|
|
@@ -182,12 +205,12 @@ import {
|
|
|
182
205
|
whyteAxles2,
|
|
183
206
|
trackRun2,
|
|
184
207
|
propeller2
|
|
185
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-8j4c28jt.js";
|
|
186
209
|
import {
|
|
187
210
|
localGenerator2,
|
|
188
211
|
importGlb2,
|
|
189
212
|
kubeezImages2
|
|
190
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-6b05mnmx.js";
|
|
191
214
|
import {
|
|
192
215
|
checkBeautyOptions2,
|
|
193
216
|
parseSize2,
|
|
@@ -208,15 +231,19 @@ import {
|
|
|
208
231
|
detailWindows2,
|
|
209
232
|
reviewPack2,
|
|
210
233
|
thumbnail2
|
|
211
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-f6yme003.js";
|
|
212
235
|
import {
|
|
213
236
|
manifestOf2
|
|
214
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-7rtfjh9f.js";
|
|
215
238
|
export {
|
|
216
239
|
BUDGETS2 as BUDGETS,
|
|
240
|
+
CC0_MATERIALS2 as CC0_MATERIALS,
|
|
241
|
+
CC0_WOOD_PLANKS_GREY2 as CC0_WOOD_PLANKS_GREY,
|
|
217
242
|
CELLS2 as CELLS,
|
|
218
243
|
CLASH_EPS2 as CLASH_EPS,
|
|
244
|
+
CLASSIC_STRIPS2 as CLASSIC_STRIPS,
|
|
219
245
|
CONTACT_EPS2 as CONTACT_EPS,
|
|
246
|
+
CUSTOM_STRIP_SLOTS2 as CUSTOM_STRIP_SLOTS,
|
|
220
247
|
DECAL_CELLS2 as DECAL_CELLS,
|
|
221
248
|
DEFAULT_GATES2 as DEFAULT_GATES,
|
|
222
249
|
DEFAULT_LOD_GATES2 as DEFAULT_LOD_GATES,
|
|
@@ -224,12 +251,18 @@ export {
|
|
|
224
251
|
FOLIAGE_CELLS2 as FOLIAGE_CELLS,
|
|
225
252
|
HEADS2 as HEADS,
|
|
226
253
|
HEAD_RES2 as HEAD_RES,
|
|
254
|
+
MATERIAL_LIBRARY2 as MATERIAL_LIBRARY,
|
|
255
|
+
MATERIAL_STRIPS2 as MATERIAL_STRIPS,
|
|
256
|
+
MSFT_LOD2 as MSFT_LOD,
|
|
227
257
|
MeshBuilder2 as MeshBuilder,
|
|
258
|
+
NATURAL2 as NATURAL,
|
|
228
259
|
REVIEW_THRESHOLDS2 as REVIEW_THRESHOLDS,
|
|
229
260
|
RayGrid2 as RayGrid,
|
|
261
|
+
SCREEN_COVERAGE2 as SCREEN_COVERAGE,
|
|
230
262
|
SHEET_MAPS2 as SHEET_MAPS,
|
|
231
263
|
SPECIES2 as SPECIES,
|
|
232
264
|
STRIPS2 as STRIPS,
|
|
265
|
+
STRIP_ROWS2 as STRIP_ROWS,
|
|
233
266
|
TRIM_SHEET_SIZE2 as TRIM_SHEET_SIZE,
|
|
234
267
|
TriangleGrid2 as TriangleGrid,
|
|
235
268
|
Ts23dError2 as Ts23dError,
|
|
@@ -251,23 +284,29 @@ export {
|
|
|
251
284
|
cell2 as cell,
|
|
252
285
|
cellRect2 as cellRect,
|
|
253
286
|
checkBeautyOptions2 as checkBeautyOptions,
|
|
287
|
+
checkCoverage2 as checkCoverage,
|
|
254
288
|
checkHead2 as checkHead,
|
|
255
289
|
clashes2 as clashes,
|
|
256
290
|
clear2 as clear,
|
|
257
291
|
compile2 as compile,
|
|
258
292
|
contactSheet2 as contactSheet,
|
|
293
|
+
coverageFor2 as coverageFor,
|
|
259
294
|
createRng2 as createRng,
|
|
260
295
|
creature2 as creature,
|
|
296
|
+
creditOf2 as creditOf,
|
|
261
297
|
cross2 as cross,
|
|
262
298
|
cylinder2 as cylinder,
|
|
299
|
+
defaultCoverage2 as defaultCoverage,
|
|
263
300
|
defineAsset2 as defineAsset,
|
|
264
301
|
defineFamily2 as defineFamily,
|
|
302
|
+
defineMaterial2 as defineMaterial,
|
|
265
303
|
definePalette2 as definePalette,
|
|
266
304
|
degenerateTriangles2 as degenerateTriangles,
|
|
267
305
|
detailWindows2 as detailWindows,
|
|
268
306
|
dot2 as dot,
|
|
269
307
|
encodePng2 as encodePng,
|
|
270
308
|
exportGlb2 as exportGlb,
|
|
309
|
+
exportLodGlb2 as exportLodGlb,
|
|
271
310
|
exposure2 as exposure,
|
|
272
311
|
facade2 as facade,
|
|
273
312
|
fbm2 as fbm,
|
|
@@ -308,6 +347,7 @@ export {
|
|
|
308
347
|
maskIoU2 as maskIoU,
|
|
309
348
|
maskStats2 as maskStats,
|
|
310
349
|
mass2 as mass,
|
|
350
|
+
materialOf2 as materialOf,
|
|
311
351
|
measure2 as measure,
|
|
312
352
|
measureText2 as measureText,
|
|
313
353
|
measures2 as measures,
|
|
@@ -338,8 +378,10 @@ export {
|
|
|
338
378
|
prism2 as prism,
|
|
339
379
|
propeller2 as propeller,
|
|
340
380
|
proportions2 as proportions,
|
|
381
|
+
provideTextures2 as provideTextures,
|
|
341
382
|
quatFromAxisAngle2 as quatFromAxisAngle,
|
|
342
383
|
renderBeauty2 as renderBeauty,
|
|
384
|
+
resetMaterials2 as resetMaterials,
|
|
343
385
|
reviewPack2 as reviewPack,
|
|
344
386
|
ridgeHeight2 as ridgeHeight,
|
|
345
387
|
ridged2 as ridged,
|
|
@@ -365,7 +407,9 @@ export {
|
|
|
365
407
|
silhouetteIoU2 as silhouetteIoU,
|
|
366
408
|
slopeMap2 as slopeMap,
|
|
367
409
|
split2 as split,
|
|
410
|
+
stripCredits2 as stripCredits,
|
|
368
411
|
stripRect2 as stripRect,
|
|
412
|
+
stripRow2 as stripRow,
|
|
369
413
|
sub2 as sub,
|
|
370
414
|
summarize2 as summarize,
|
|
371
415
|
surfaceSamples2 as surfaceSamples,
|
|
@@ -375,11 +419,13 @@ export {
|
|
|
375
419
|
terrainColor2 as terrainColor,
|
|
376
420
|
terrainGrid2 as terrainGrid,
|
|
377
421
|
text2 as text,
|
|
422
|
+
textureSources2 as textureSources,
|
|
378
423
|
thermalErosion2 as thermalErosion,
|
|
379
424
|
threeMaterialSource2 as threeMaterialSource,
|
|
380
425
|
thumbnail2 as thumbnail,
|
|
381
426
|
tiled2 as tiled,
|
|
382
427
|
toGlb2 as toGlb,
|
|
428
|
+
toLodGlb2 as toLodGlb,
|
|
383
429
|
toWorld2 as toWorld,
|
|
384
430
|
touches2 as touches,
|
|
385
431
|
touching2 as touching,
|
|
@@ -407,5 +453,5 @@ export {
|
|
|
407
453
|
zFighting2 as zFighting
|
|
408
454
|
};
|
|
409
455
|
|
|
410
|
-
//# debugId=
|
|
456
|
+
//# debugId=514018F8AD878FF264756E2164756E21
|
|
411
457
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import type { Vec3 } from '../core/index.js';
|
|
2
1
|
import type { SculptEdit } from '../primitives/index.js';
|
|
3
2
|
import type { HeadParams } from './head-params.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
r: Vec3;
|
|
8
|
-
};
|
|
9
|
-
export declare function armour(p: HeadParams, cx: number, s: number, b: number, nz: number): SculptEdit[];
|
|
3
|
+
import { type BustFrame } from './head-torso.js';
|
|
4
|
+
/** `cell`: the bust's sculpt cell; plates thicken to ≈ 2.5 cells so far LODs stay closed. */
|
|
5
|
+
export declare function armour(p: HeadParams, f: BustFrame, cell?: number): SculptEdit[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SculptEdit } from '../primitives/index.js';
|
|
2
2
|
import type { HeadLayout } from './head-layout.js';
|
|
3
3
|
import type { HeadParams } from './head-params.js';
|
|
4
|
-
|
|
4
|
+
/** `cell`: the bust's sculpt cell (head units), floors the plinth disc so far LODs keep it. */
|
|
5
|
+
export declare function bustEdits(p: HeadParams, l: HeadLayout, cell?: number): SculptEdit[];
|
|
@@ -3,4 +3,6 @@ import type { HeadLayout } from './head-layout.js';
|
|
|
3
3
|
import type { HeadParams } from './head-params.js';
|
|
4
4
|
/** Brain case + face plate: the forms the eyes are seated against (head.ts probes them). */
|
|
5
5
|
export declare function primaryEdits(l: HeadLayout): SculptEdit[];
|
|
6
|
-
|
|
6
|
+
/** `cell`: the sculpt cell (head units). Far LODs drop the teeth and floor the nose's radii at
|
|
7
|
+
* about 0.6 cells so a long nose survives. */
|
|
8
|
+
export declare function skullEdits(p: HeadParams, l: HeadLayout, cell?: number): SculptEdit[];
|
|
@@ -2,6 +2,8 @@ import type { Mesh, Vec3 } from '../core/index.js';
|
|
|
2
2
|
import { type Field, type SculptEdit } from '../primitives/index.js';
|
|
3
3
|
import type { HeadLayout } from './head-layout.js';
|
|
4
4
|
import type { HeadParams } from './head-params.js';
|
|
5
|
+
/** Default plinth colour (dark slate). */
|
|
6
|
+
export declare const PLINTH: Vec3;
|
|
5
7
|
/** The jaw region (head units): an ellipsoid around chin and lower lip, cut flat at the mouth
|
|
6
8
|
* line. Its skin seam runs along the lips, down the marionette lines and under the chin — creases
|
|
7
9
|
* a face already has — instead of across the cheek. */
|
|
@@ -15,6 +17,8 @@ export interface HeadEditSet {
|
|
|
15
17
|
readonly ears: readonly SculptEdit[];
|
|
16
18
|
readonly tusks: readonly SculptEdit[];
|
|
17
19
|
readonly bust: readonly SculptEdit[];
|
|
20
|
+
/** The bust-cut region (≈ 0 on the cut faces), painted as bare plinth material. */
|
|
21
|
+
readonly bustCut?: Field;
|
|
18
22
|
}
|
|
19
23
|
/** `head` and `jaw` meshes in head units at cell size `res` (units). Each is ONE sculpt (skull +
|
|
20
24
|
* ears − region, skull ∩ region + tusks), so the sculpt's range skipping covers every edit. */
|
|
@@ -2,7 +2,7 @@ import { type Vec3 } from '../core/index.js';
|
|
|
2
2
|
export type EarShape = 'round' | 'pointed';
|
|
3
3
|
export type HairStyle = 'none' | 'topknot' | 'mohawk' | 'swept' | 'tufts' | 'braids';
|
|
4
4
|
export type BeardStyle = 'none' | 'short' | 'braided' | 'goatee';
|
|
5
|
-
export type BustStyle = 'pauldrons' | 'hood' | 'tunic';
|
|
5
|
+
export type BustStyle = 'pauldrons' | 'hood' | 'tunic' | 'vest';
|
|
6
6
|
export interface HeadColors {
|
|
7
7
|
readonly skin: Vec3;
|
|
8
8
|
/** Darker skin: lips edge, nostrils, inner ear, wrinkles. */
|
|
@@ -23,6 +23,10 @@ export interface HeadColors {
|
|
|
23
23
|
readonly fur?: Vec3;
|
|
24
24
|
/** War paint / tattoo stripes (orc), or none. */
|
|
25
25
|
readonly paint?: Vec3;
|
|
26
|
+
/** The bust's plinth (stone/wood socle); default a dark slate. */
|
|
27
|
+
readonly plinth?: Vec3;
|
|
28
|
+
/** Scarf / sash cloth (vest style); default `cloth`. */
|
|
29
|
+
readonly scarf?: Vec3;
|
|
26
30
|
}
|
|
27
31
|
export interface HeadParams {
|
|
28
32
|
/** Chin to crown, metres (adult human ≈ 0.23). */
|
|
@@ -94,14 +98,18 @@ export interface HeadParams {
|
|
|
94
98
|
readonly neck: {
|
|
95
99
|
readonly radius: number;
|
|
96
100
|
};
|
|
101
|
+
/** Shoulder half-span, gear style, muscle mass (0 = bony and narrow … 1 = brute; default 0.5). */
|
|
97
102
|
readonly bust: {
|
|
98
103
|
readonly shoulders: number;
|
|
99
104
|
readonly style: BustStyle;
|
|
105
|
+
readonly mass?: number;
|
|
100
106
|
};
|
|
101
107
|
readonly hair: HairStyle;
|
|
102
108
|
readonly beard: BeardStyle;
|
|
103
109
|
/** Wart / bump count scattered on the skin (seeded). */
|
|
104
110
|
readonly warts: number;
|
|
111
|
+
/** Forehead creases (0 = smooth; a goblin's worried brow has 3). */
|
|
112
|
+
readonly wrinkles?: number;
|
|
105
113
|
readonly colors: HeadColors;
|
|
106
114
|
}
|
|
107
115
|
/** Throws T3D_RECIPE_INVALID (with a fix) when `p` cannot make a head. */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Vec3 } from '../core/index.js';
|
|
2
|
+
import type { Field } from '../primitives/index.js';
|
|
3
|
+
export interface ToneOptions {
|
|
4
|
+
/** Probe distance for the cavity test, head units (≈ the size of a fold). */
|
|
5
|
+
readonly reach: number;
|
|
6
|
+
/** 0 = flat colour, 1 = full painted tone. */
|
|
7
|
+
readonly strength?: number;
|
|
8
|
+
}
|
|
9
|
+
/** Wraps `colorAt` with cavity darkening and a warm-top / cool-under gradient. */
|
|
10
|
+
export declare function toned(field: Field, colorAt: (q: Vec3) => Vec3, o: ToneOptions): (q: Vec3) => Vec3;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Vec3 } from '../core/index.js';
|
|
2
|
+
import { type Field, type SculptEdit } from '../primitives/index.js';
|
|
3
|
+
import type { HeadLayout } from './head-layout.js';
|
|
4
|
+
import type { HeadParams } from './head-params.js';
|
|
5
|
+
/** Where the bust sits relative to the head: centre x, shoulder half-span, base, neck root… */
|
|
6
|
+
export interface BustFrame {
|
|
7
|
+
readonly cx: number;
|
|
8
|
+
readonly s: number;
|
|
9
|
+
/** Reference z the torso is laid out from (the floor lifted by the build's hunch). */
|
|
10
|
+
readonly b: number;
|
|
11
|
+
/** The asset's floor: bottom of the plinth. */
|
|
12
|
+
readonly floor: number;
|
|
13
|
+
/** Neck root (top of the sternum), z. */
|
|
14
|
+
readonly nz: number;
|
|
15
|
+
readonly m: number;
|
|
16
|
+
/** Neck radius. */
|
|
17
|
+
readonly n: number;
|
|
18
|
+
/** Where the trapezius meets the neck, z (high behind the ear on a brute). */
|
|
19
|
+
readonly trapZ: number;
|
|
20
|
+
/** Top of the plinth = bottom of the chest cut, z. */
|
|
21
|
+
readonly cutZ: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function frameOf(p: HeadParams, l: HeadLayout): BustFrame;
|
|
24
|
+
/** Anatomy volumes (plain adds), every one grown by `g`. */
|
|
25
|
+
export declare function torsoForms(f: BustFrame, g?: number): SculptEdit[];
|
|
26
|
+
/** Signed distance to the bust-cut region (negative inside): ≈ 0 on the cut faces. */
|
|
27
|
+
export declare function cutField(f: BustFrame): Field;
|
|
28
|
+
/** Keeps a group to the bust silhouette: the U-cut under the chest, rising to cut the arms. */
|
|
29
|
+
export declare function bustCut(f: BustFrame, g?: number): SculptEdit;
|
|
30
|
+
/** The bare body: anatomy in `color`, sternal notch and groove, then the bust cut. */
|
|
31
|
+
export declare function bodyEdits(p: HeadParams, f: BustFrame, color: Vec3): SculptEdit[];
|
|
32
|
+
/** A turned plinth: wide disc with a bead moulding, then a narrower socle up to the chest cut.
|
|
33
|
+
* Both start below the floor, so the bust's flat base cut alone makes the underside. */
|
|
34
|
+
/** `minT`: floor for the disc's thickness (≈ a cell), so far LODs keep the bust on the ground. */
|
|
35
|
+
export declare function plinthEdits(p: HeadParams, f: BustFrame, minT?: number): SculptEdit[];
|
package/dist/kinds/index.js
CHANGED
|
@@ -32,12 +32,12 @@ import {
|
|
|
32
32
|
whyteAxles2,
|
|
33
33
|
trackRun2,
|
|
34
34
|
propeller2
|
|
35
|
-
} from "../chunk-
|
|
36
|
-
import"../chunk-
|
|
37
|
-
import"../chunk-
|
|
38
|
-
import"../chunk-
|
|
39
|
-
import"../chunk-
|
|
40
|
-
import"../chunk-
|
|
35
|
+
} from "../chunk-8j4c28jt.js";
|
|
36
|
+
import"../chunk-dxvypr7y.js";
|
|
37
|
+
import"../chunk-d1fv6hrm.js";
|
|
38
|
+
import"../chunk-y63c6zcv.js";
|
|
39
|
+
import"../chunk-drna2rny.js";
|
|
40
|
+
import"../chunk-hg7pf34j.js";
|
|
41
41
|
export {
|
|
42
42
|
HEADS2 as HEADS,
|
|
43
43
|
HEAD_RES2 as HEAD_RES,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type MaterialDef } from './material-def.js';
|
|
2
|
+
import type { StripRecipe } from './paint/types.js';
|
|
3
|
+
import { type TextureSource } from './texture-source.js';
|
|
4
|
+
import { type CustomStripId, type StripId } from './trim-sheet.js';
|
|
5
|
+
/**
|
|
6
|
+
* Register a project material and return its strip id for `strip:` options.
|
|
7
|
+
* @example
|
|
8
|
+
* const teak = defineMaterial({ id: 'teak_deck', kind: 'planks', roughness: 0.6,
|
|
9
|
+
* albedo: '#8a5a32', albedo2: '#5a3a1e', params: { width: 0.12, rings: 0.5 } });
|
|
10
|
+
* box({ size: [4, 2, 0.05], strip: teak, color: NATURAL });
|
|
11
|
+
*/
|
|
12
|
+
export declare function defineMaterial(def: MaterialDef): CustomStripId;
|
|
13
|
+
/**
|
|
14
|
+
* Forget every defined material (tests; long-lived workers that reload recipes). Built-ins stay.
|
|
15
|
+
* Meshes compiled before the reset keep UVs into rows that may be reassigned.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resetMaterials(): void;
|
|
18
|
+
export interface MaterialInfo {
|
|
19
|
+
readonly id: StripId;
|
|
20
|
+
/** classic = greyscale strip tinted by vertex colour; library/defined carry their own colour. */
|
|
21
|
+
readonly origin: 'classic' | 'library' | 'defined';
|
|
22
|
+
readonly recipe: StripRecipe;
|
|
23
|
+
readonly description: string;
|
|
24
|
+
readonly sources: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
/** What a strip is: its recipe, origin, description and sources. Unknown ids throw. */
|
|
27
|
+
export declare function materialOf(id: StripId): MaterialInfo;
|
|
28
|
+
/** Every texture set a defined material references (what `bun run textures` fetches). */
|
|
29
|
+
export declare function textureSources(): readonly TextureSource[];
|
|
30
|
+
/**
|
|
31
|
+
* Credit lines for the image strips a mesh samples: any V coordinate inside such a strip's row
|
|
32
|
+
* counts. Empty when no image strip is used (the GLB stays byte-identical).
|
|
33
|
+
*/
|
|
34
|
+
export declare function stripCredits(vs: ArrayLike<number>): string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PaintedSheet, SheetRecipe } from './paint/types.js';
|
|
2
2
|
export { DEFAULT_SHEET } from './paint/default-sheet.js';
|
|
3
|
-
export type { CellImage, PaintedSheet, SheetRecipe, StripKind, StripRecipe, } from './paint/types.js';
|
|
3
|
+
export type { CellImage, MaterialPainter, MaterialSurface, PaintedSheet, PaintKit, SheetRecipe, StripKind, StripRecipe, } from './paint/types.js';
|
|
4
4
|
export declare function paintTrimSheet(recipe?: SheetRecipe): PaintedSheet;
|
package/dist/material/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { CC0_MATERIALS, CC0_WOOD_PLANKS_GREY } from './cc0.js';
|
|
2
|
+
export { defineMaterial, type MaterialInfo, materialOf, resetMaterials, stripCredits, textureSources, } from './define.js';
|
|
3
|
+
export { type CellImage, DEFAULT_SHEET, type MaterialPainter, type MaterialSurface, type PaintedSheet, type PaintKit, paintTrimSheet, type SheetRecipe, type StripKind, type StripRecipe, } from './generator.js';
|
|
4
|
+
export { MATERIAL_LIBRARY } from './library.js';
|
|
5
|
+
export type { MaterialDef } from './material-def.js';
|
|
6
|
+
export { definePalette, hex, NATURAL, type Palette, palettes } from './palette.js';
|
|
3
7
|
export { godotShaderSource, type ShaderHints, threeMaterialSource } from './shader.js';
|
|
4
|
-
export {
|
|
8
|
+
export { creditOf, provideTextures, type TextureCache, type TextureFile, type TextureSource, } from './texture-source.js';
|
|
9
|
+
export { type BuiltinStripId, CELLS, type CellId, CLASSIC_STRIPS, type ClassicStripId, CUSTOM_STRIP_SLOTS, type CustomStripId, cellRect, DECAL_CELLS, type DecalCellId, FOLIAGE_CELLS, type FoliageCellId, isFoliage, MATERIAL_STRIPS, type MaterialStripId, STRIP_ROWS, STRIPS, type StripId, stripRect, stripRow, TRIM_SHEET_SIZE, type UvRect, } from './trim-sheet.js';
|
package/dist/material/index.js
CHANGED
|
@@ -1,38 +1,70 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CC0_WOOD_PLANKS_GREY2,
|
|
3
|
+
CC0_MATERIALS2,
|
|
4
|
+
MATERIAL_LIBRARY2,
|
|
5
|
+
hex2,
|
|
6
|
+
NATURAL2,
|
|
7
|
+
definePalette2,
|
|
8
|
+
palettes2,
|
|
9
|
+
provideTextures2,
|
|
10
|
+
creditOf2,
|
|
11
|
+
DEFAULT_SHEET2,
|
|
12
|
+
STRIP_ROWS2,
|
|
13
|
+
CUSTOM_STRIP_SLOTS2,
|
|
2
14
|
TRIM_SHEET_SIZE2,
|
|
15
|
+
stripRow2,
|
|
3
16
|
stripRect2,
|
|
4
17
|
cellRect2,
|
|
5
18
|
STRIPS2,
|
|
19
|
+
CLASSIC_STRIPS2,
|
|
20
|
+
MATERIAL_STRIPS2,
|
|
6
21
|
CELLS2,
|
|
7
22
|
DECAL_CELLS2,
|
|
8
23
|
FOLIAGE_CELLS2,
|
|
9
24
|
isFoliage2,
|
|
10
|
-
|
|
25
|
+
defineMaterial2,
|
|
26
|
+
resetMaterials2,
|
|
27
|
+
materialOf2,
|
|
28
|
+
textureSources2,
|
|
29
|
+
stripCredits2,
|
|
11
30
|
paintTrimSheet2,
|
|
12
|
-
hex2,
|
|
13
|
-
definePalette2,
|
|
14
|
-
palettes2,
|
|
15
31
|
threeMaterialSource2,
|
|
16
32
|
godotShaderSource2
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import"../chunk-
|
|
33
|
+
} from "../chunk-y63c6zcv.js";
|
|
34
|
+
import"../chunk-hg7pf34j.js";
|
|
19
35
|
export {
|
|
36
|
+
CC0_MATERIALS2 as CC0_MATERIALS,
|
|
37
|
+
CC0_WOOD_PLANKS_GREY2 as CC0_WOOD_PLANKS_GREY,
|
|
20
38
|
CELLS2 as CELLS,
|
|
39
|
+
CLASSIC_STRIPS2 as CLASSIC_STRIPS,
|
|
40
|
+
CUSTOM_STRIP_SLOTS2 as CUSTOM_STRIP_SLOTS,
|
|
21
41
|
DECAL_CELLS2 as DECAL_CELLS,
|
|
22
42
|
DEFAULT_SHEET2 as DEFAULT_SHEET,
|
|
23
43
|
FOLIAGE_CELLS2 as FOLIAGE_CELLS,
|
|
44
|
+
MATERIAL_LIBRARY2 as MATERIAL_LIBRARY,
|
|
45
|
+
MATERIAL_STRIPS2 as MATERIAL_STRIPS,
|
|
46
|
+
NATURAL2 as NATURAL,
|
|
24
47
|
STRIPS2 as STRIPS,
|
|
48
|
+
STRIP_ROWS2 as STRIP_ROWS,
|
|
25
49
|
TRIM_SHEET_SIZE2 as TRIM_SHEET_SIZE,
|
|
26
50
|
cellRect2 as cellRect,
|
|
51
|
+
creditOf2 as creditOf,
|
|
52
|
+
defineMaterial2 as defineMaterial,
|
|
27
53
|
definePalette2 as definePalette,
|
|
28
54
|
godotShaderSource2 as godotShaderSource,
|
|
29
55
|
hex2 as hex,
|
|
30
56
|
isFoliage2 as isFoliage,
|
|
57
|
+
materialOf2 as materialOf,
|
|
31
58
|
paintTrimSheet2 as paintTrimSheet,
|
|
32
59
|
palettes2 as palettes,
|
|
60
|
+
provideTextures2 as provideTextures,
|
|
61
|
+
resetMaterials2 as resetMaterials,
|
|
62
|
+
stripCredits2 as stripCredits,
|
|
33
63
|
stripRect2 as stripRect,
|
|
64
|
+
stripRow2 as stripRow,
|
|
65
|
+
textureSources2 as textureSources,
|
|
34
66
|
threeMaterialSource2 as threeMaterialSource
|
|
35
67
|
};
|
|
36
68
|
|
|
37
|
-
//# debugId=
|
|
69
|
+
//# debugId=DC34FA57446536B164756E2164756E21
|
|
38
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MaterialDef } from './material-def.js';
|
|
2
|
+
import type { MaterialStripId } from './trim-sheet.js';
|
|
3
|
+
type Library = Readonly<Record<MaterialStripId, MaterialDef & {
|
|
4
|
+
readonly id: MaterialStripId;
|
|
5
|
+
}>>;
|
|
6
|
+
export declare const MATERIAL_LIBRARY: Library;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Vec3 } from '../core/index.js';
|
|
2
|
+
import type { MaterialPainter, StripKind, StripRecipe } from './paint/types.js';
|
|
3
|
+
import { type TextureSource } from './texture-source.js';
|
|
4
|
+
export interface MaterialDef {
|
|
5
|
+
/** snake_case, unique; becomes the strip id recipes pass as `strip`. */
|
|
6
|
+
readonly id: string;
|
|
7
|
+
/** Base painter the strip starts from. Default 'noise' (a quiet surface). */
|
|
8
|
+
readonly kind?: StripKind;
|
|
9
|
+
/** World metres the strip's V span represents (typical face height). Default 1. */
|
|
10
|
+
readonly scaleMetres?: number;
|
|
11
|
+
/** Perceptual roughness 0..1 (glTF): 0 mirror, 1 chalk. */
|
|
12
|
+
readonly roughness: number;
|
|
13
|
+
/** 0 dielectric, 1 metal. Default 0. Avoid in-between values except for dirt/oxide blends. */
|
|
14
|
+
readonly metalness?: number;
|
|
15
|
+
/** Intrinsic base colour: sRGB '#rrggbb' or linear RGB. Default white (vertex colour = hue). */
|
|
16
|
+
readonly albedo?: string | Vec3;
|
|
17
|
+
/** Second colour the painter blends to (latewood, rust, verdigris, bare wood under paint). */
|
|
18
|
+
readonly albedo2?: string | Vec3;
|
|
19
|
+
/** Painter knobs for `kind` (see each painter's header in src/material/paint/). */
|
|
20
|
+
readonly params?: Readonly<Record<string, number>>;
|
|
21
|
+
/** Your own layer, painted after `kind`: write height/tone/rough/metal/mix per texel. */
|
|
22
|
+
readonly paint?: MaterialPainter;
|
|
23
|
+
/** Paint from a CC0 texture set (opt-in, needs `bun run textures`) instead of `kind`. */
|
|
24
|
+
readonly texture?: TextureSource;
|
|
25
|
+
readonly description?: string;
|
|
26
|
+
/** Where the numbers come from (URLs). */
|
|
27
|
+
readonly sources?: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
/** Validate a definition and turn it into the strip recipe the sheet painter runs. */
|
|
30
|
+
export declare function toStripRecipe(d: MaterialDef): StripRecipe;
|