@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.
Files changed (162) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/CLAUDE.md +1 -1
  3. package/README.md +10 -5
  4. package/dist/{chunk-a8fxakcj.js → chunk-6b05mnmx.js} +2 -2
  5. package/dist/{chunk-kgvbpqqw.js → chunk-7rtfjh9f.js} +6 -5
  6. package/dist/chunk-7rtfjh9f.js.map +10 -0
  7. package/dist/{chunk-1ypfs7ga.js → chunk-8j4c28jt.js} +790 -276
  8. package/dist/chunk-8j4c28jt.js.map +46 -0
  9. package/dist/{chunk-wtqhq529.js → chunk-d1fv6hrm.js} +6 -6
  10. package/dist/{chunk-wtqhq529.js.map → chunk-d1fv6hrm.js.map} +1 -1
  11. package/dist/{chunk-gcyp9b4d.js → chunk-dbq4qf52.js} +362 -215
  12. package/dist/chunk-dbq4qf52.js.map +25 -0
  13. package/dist/{chunk-xnt2sdhf.js → chunk-drna2rny.js} +2 -2
  14. package/dist/{chunk-ravbb06q.js → chunk-dxvypr7y.js} +2 -2
  15. package/dist/{chunk-11v28977.js → chunk-f6yme003.js} +85 -71
  16. package/dist/{chunk-11v28977.js.map → chunk-f6yme003.js.map} +6 -6
  17. package/dist/{chunk-4ddzsqtc.js → chunk-hg7pf34j.js} +4 -3
  18. package/dist/{chunk-4ddzsqtc.js.map → chunk-hg7pf34j.js.map} +5 -5
  19. package/dist/{chunk-w1zyhj40.js → chunk-jq4e17tj.js} +2 -2
  20. package/dist/{chunk-kvcep7ft.js → chunk-y63c6zcv.js} +967 -218
  21. package/dist/chunk-y63c6zcv.js.map +53 -0
  22. package/dist/cli/args.d.ts +7 -1
  23. package/dist/cli/bin.js +66 -25
  24. package/dist/cli/bin.js.map +6 -5
  25. package/dist/cli/manifest.d.ts +5 -1
  26. package/dist/cli/texture-cache.d.ts +4 -0
  27. package/dist/core/definition.d.ts +7 -0
  28. package/dist/core/errors.d.ts +1 -1
  29. package/dist/core/index.js +1 -1
  30. package/dist/export/credits.d.ts +4 -0
  31. package/dist/export/glb-options.d.ts +48 -0
  32. package/dist/export/glb.d.ts +5 -35
  33. package/dist/export/hierarchy.d.ts +23 -0
  34. package/dist/export/index.d.ts +2 -1
  35. package/dist/export/index.js +21 -7
  36. package/dist/export/index.js.map +1 -1
  37. package/dist/export/lod-coverage.d.ts +12 -0
  38. package/dist/export/metadata.d.ts +2 -0
  39. package/dist/export/version.d.ts +2 -2
  40. package/dist/grammar/index.js +2 -2
  41. package/dist/index.js +63 -17
  42. package/dist/index.js.map +1 -1
  43. package/dist/kinds/head-armour.d.ts +3 -7
  44. package/dist/kinds/head-bust.d.ts +3 -2
  45. package/dist/kinds/head-face.d.ts +3 -1
  46. package/dist/kinds/head-garb.d.ts +4 -0
  47. package/dist/kinds/head-mesh.d.ts +4 -0
  48. package/dist/kinds/head-mouth.d.ts +4 -0
  49. package/dist/kinds/head-params.d.ts +9 -1
  50. package/dist/kinds/head-tone.d.ts +10 -0
  51. package/dist/kinds/head-torso.d.ts +35 -0
  52. package/dist/kinds/index.js +6 -6
  53. package/dist/material/cc0.d.ts +4 -0
  54. package/dist/material/define.d.ts +34 -0
  55. package/dist/material/generator.d.ts +1 -1
  56. package/dist/material/index.d.ts +8 -3
  57. package/dist/material/index.js +39 -7
  58. package/dist/material/index.js.map +1 -1
  59. package/dist/material/library.d.ts +7 -0
  60. package/dist/material/material-def.d.ts +30 -0
  61. package/dist/material/paint/canvas.d.ts +7 -0
  62. package/dist/material/paint/default-sheet.d.ts +3 -1
  63. package/dist/material/paint/fabric.d.ts +4 -0
  64. package/dist/material/paint/image-strip.d.ts +4 -0
  65. package/dist/material/paint/kit.d.ts +5 -0
  66. package/dist/material/paint/metal.d.ts +3 -0
  67. package/dist/material/paint/orm.d.ts +1 -1
  68. package/dist/material/paint/strip.d.ts +1 -1
  69. package/dist/material/paint/types.d.ts +32 -2
  70. package/dist/material/palette.d.ts +2 -0
  71. package/dist/material/slots.d.ts +5 -0
  72. package/dist/material/texture-source.d.ts +34 -0
  73. package/dist/material/trim-sheet.d.ts +20 -4
  74. package/dist/neural/index.js +2 -2
  75. package/dist/passes/index.js +2 -2
  76. package/dist/primitives/index.js +3 -3
  77. package/dist/qa/index.js +2 -2
  78. package/dist/render/beauty.d.ts +1 -1
  79. package/dist/render/index.js +3 -3
  80. package/dist/render/lighting.d.ts +7 -0
  81. package/dist/render/shade.d.ts +1 -1
  82. package/dist/testing/index.js +5 -5
  83. package/docs/README.md +4 -0
  84. package/docs/architecture/gltf-capabilities.md +38 -1
  85. package/docs/architecture/materials.md +151 -0
  86. package/docs/idea/10-sculpting.md +166 -0
  87. package/docs/idea/11-materials-authoring.md +132 -0
  88. package/docs/idea/12-blender-bridge.md +136 -0
  89. package/docs/idea/13-asset-pipeline-research.md +89 -0
  90. package/docs/plans/roadmap.md +12 -0
  91. package/package.json +2 -1
  92. package/recipes/boxcar/README.md +7 -0
  93. package/recipes/boxcar/boxcar.ts +118 -34
  94. package/recipes/goblin_head/README.md +27 -14
  95. package/recipes/goblin_head/goblin_head.ts +11 -9
  96. package/recipes/human_head/README.md +8 -4
  97. package/recipes/human_head/human_head.ts +4 -3
  98. package/recipes/material_swatches/material_swatches.ts +11 -5
  99. package/recipes/orc_head/README.md +32 -20
  100. package/recipes/orc_head/orc_head.ts +9 -7
  101. package/src/cli/args.ts +16 -3
  102. package/src/cli/manifest.ts +6 -0
  103. package/src/cli/run.ts +33 -9
  104. package/src/cli/texture-cache.ts +24 -0
  105. package/src/core/asset.ts +1 -0
  106. package/src/core/definition.ts +7 -0
  107. package/src/core/errors.ts +6 -1
  108. package/src/export/credits.ts +25 -0
  109. package/src/export/glb-options.ts +53 -0
  110. package/src/export/glb.ts +100 -113
  111. package/src/export/hierarchy.ts +122 -0
  112. package/src/export/index.ts +17 -1
  113. package/src/export/lod-coverage.ts +71 -0
  114. package/src/export/metadata.ts +3 -0
  115. package/src/export/version.ts +1 -1
  116. package/src/kinds/head-armour.ts +103 -73
  117. package/src/kinds/head-bust.ts +49 -86
  118. package/src/kinds/head-face.ts +94 -74
  119. package/src/kinds/head-garb.ts +181 -0
  120. package/src/kinds/head-hair.ts +74 -33
  121. package/src/kinds/head-mesh.ts +43 -5
  122. package/src/kinds/head-mouth.ts +111 -0
  123. package/src/kinds/head-params.ts +11 -2
  124. package/src/kinds/head-presets.ts +30 -27
  125. package/src/kinds/head-tone.ts +52 -0
  126. package/src/kinds/head-torso.ts +230 -0
  127. package/src/kinds/head.ts +8 -3
  128. package/src/material/cc0.ts +41 -0
  129. package/src/material/define.ts +130 -0
  130. package/src/material/generator.ts +15 -8
  131. package/src/material/index.ts +34 -3
  132. package/src/material/library.ts +196 -0
  133. package/src/material/material-def.ts +84 -0
  134. package/src/material/paint/canvas.ts +11 -1
  135. package/src/material/paint/compose.ts +1 -1
  136. package/src/material/paint/decode-png.ts +19 -13
  137. package/src/material/paint/default-sheet.ts +40 -28
  138. package/src/material/paint/fabric.ts +63 -0
  139. package/src/material/paint/image-strip.ts +88 -0
  140. package/src/material/paint/kit.ts +37 -0
  141. package/src/material/paint/masks.ts +3 -1
  142. package/src/material/paint/metal.ts +109 -0
  143. package/src/material/paint/orm.ts +14 -1
  144. package/src/material/paint/planks.ts +49 -4
  145. package/src/material/paint/strip.ts +35 -29
  146. package/src/material/paint/types.ts +45 -2
  147. package/src/material/paint/validate.ts +19 -3
  148. package/src/material/palette.ts +3 -0
  149. package/src/material/slots.ts +18 -0
  150. package/src/material/texture-source.ts +86 -0
  151. package/src/material/trim-sheet.ts +79 -13
  152. package/src/render/beauty.ts +2 -2
  153. package/src/render/lighting.ts +26 -0
  154. package/src/render/shade.ts +10 -5
  155. package/dist/chunk-1ypfs7ga.js.map +0 -42
  156. package/dist/chunk-gcyp9b4d.js.map +0 -22
  157. package/dist/chunk-kgvbpqqw.js.map +0 -10
  158. package/dist/chunk-kvcep7ft.js.map +0 -43
  159. /package/dist/{chunk-a8fxakcj.js.map → chunk-6b05mnmx.js.map} +0 -0
  160. /package/dist/{chunk-xnt2sdhf.js.map → chunk-drna2rny.js.map} +0 -0
  161. /package/dist/{chunk-ravbb06q.js.map → chunk-dxvypr7y.js.map} +0 -0
  162. /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): {
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0";
2
- export declare const GENERATOR = "@developerz.ai/ts23d 0.1.0";
1
+ export declare const VERSION = "0.2.0";
2
+ export declare const GENERATOR = "@developerz.ai/ts23d 0.2.0";
@@ -3,8 +3,8 @@ import {
3
3
  layoutSplit2,
4
4
  split2,
5
5
  parseWhyte2
6
- } from "../chunk-ravbb06q.js";
7
- import"../chunk-4ddzsqtc.js";
6
+ } from "../chunk-dxvypr7y.js";
7
+ import"../chunk-hg7pf34j.js";
8
8
  export {
9
9
  layoutSplit2 as layoutSplit,
10
10
  parseSplit2 as parseSplit,
package/dist/index.js CHANGED
@@ -30,24 +30,40 @@ import {
30
30
  rotateZ2,
31
31
  worldMesh2,
32
32
  worldMeshes2
33
- } from "./chunk-4ddzsqtc.js";
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
- DEFAULT_SHEET2,
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-kvcep7ft.js";
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-xnt2sdhf.js";
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
- } from "./chunk-gcyp9b4d.js";
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-w1zyhj40.js";
129
+ } from "./chunk-jq4e17tj.js";
107
130
  import {
108
131
  parseSplit2,
109
132
  layoutSplit2,
110
133
  split2,
111
134
  parseWhyte2
112
- } from "./chunk-ravbb06q.js";
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-wtqhq529.js";
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-1ypfs7ga.js";
208
+ } from "./chunk-8j4c28jt.js";
186
209
  import {
187
210
  localGenerator2,
188
211
  importGlb2,
189
212
  kubeezImages2
190
- } from "./chunk-a8fxakcj.js";
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-11v28977.js";
234
+ } from "./chunk-f6yme003.js";
212
235
  import {
213
236
  manifestOf2
214
- } from "./chunk-kgvbpqqw.js";
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=72A146AAD343702B64756E2164756E21
456
+ //# debugId=514018F8AD878FF264756E2164756E21
411
457
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "72A146AAD343702B64756E2164756E21",
7
+ "debugId": "514018F8AD878FF264756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -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
- /** Chest ellipsoid of the bust (shared with head-bust.ts so the strap hugs it). */
5
- export declare const chestOf: (cx: number, s: number, b: number) => {
6
- at: Vec3;
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 { SculptEdit } from '../primitives/index.js';
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
- export declare function bustEdits(p: HeadParams, l: HeadLayout): SculptEdit[];
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
- export declare function skullEdits(p: HeadParams, l: HeadLayout): SculptEdit[];
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[];
@@ -0,0 +1,4 @@
1
+ import type { SculptEdit } from '../primitives/index.js';
2
+ import type { HeadParams } from './head-params.js';
3
+ import { type BustFrame } from './head-torso.js';
4
+ export declare function vest(p: HeadParams, f: BustFrame): 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. */
@@ -0,0 +1,4 @@
1
+ import type { SculptEdit } from '../primitives/index.js';
2
+ import type { HeadLayout } from './head-layout.js';
3
+ import type { HeadParams } from './head-params.js';
4
+ export declare function mouthEdits(p: HeadParams, l: HeadLayout, teeth?: boolean): SculptEdit[];
@@ -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[];
@@ -32,12 +32,12 @@ import {
32
32
  whyteAxles2,
33
33
  trackRun2,
34
34
  propeller2
35
- } from "../chunk-1ypfs7ga.js";
36
- import"../chunk-ravbb06q.js";
37
- import"../chunk-wtqhq529.js";
38
- import"../chunk-kvcep7ft.js";
39
- import"../chunk-xnt2sdhf.js";
40
- import"../chunk-4ddzsqtc.js";
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,4 @@
1
+ import type { MaterialDef } from './material-def.js';
2
+ /** Poly Haven "Wood Planks Grey" by Rob Tuytel (CC0), 1.5 m square, 1k PNG maps. */
3
+ export declare const CC0_WOOD_PLANKS_GREY: MaterialDef;
4
+ export declare const CC0_MATERIALS: readonly MaterialDef[];
@@ -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;
@@ -1,4 +1,9 @@
1
- export { type CellImage, DEFAULT_SHEET, type PaintedSheet, paintTrimSheet, type SheetRecipe, type StripKind, type StripRecipe, } from './generator.js';
2
- export { definePalette, hex, type Palette, palettes } from './palette.js';
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 { CELLS, type CellId, cellRect, DECAL_CELLS, type DecalCellId, FOLIAGE_CELLS, type FoliageCellId, isFoliage, STRIPS, type StripId, stripRect, TRIM_SHEET_SIZE, type UvRect, } from './trim-sheet.js';
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';
@@ -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
- DEFAULT_SHEET2,
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-kvcep7ft.js";
18
- import"../chunk-4ddzsqtc.js";
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=00CB682D745D7A0764756E2164756E21
69
+ //# debugId=DC34FA57446536B164756E2164756E21
38
70
  //# sourceMappingURL=index.js.map
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "00CB682D745D7A0764756E2164756E21",
7
+ "debugId": "DC34FA57446536B164756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -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;