@developerz.ai/ts23d 0.0.0-stage → 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/.claude/agents/bug-hunter.md +21 -0
- package/.claude/agents/docs-author.md +13 -0
- package/.claude/agents/dx-auditor.md +14 -0
- package/.claude/agents/primitive-author.md +22 -0
- package/.claude/agents/recipe-author.md +36 -0
- package/.claude/agents/visual-reviewer.md +23 -0
- package/.claude/commands/feature.md +28 -0
- package/.claude/commands/new-recipe.md +19 -0
- package/.claude/commands/release.md +14 -0
- package/.claude/commands/verify.md +9 -0
- package/.claude/skills/author-recipe/SKILL.md +93 -0
- package/CHANGELOG.md +90 -0
- package/CLAUDE.md +85 -0
- package/LICENSE +21 -0
- package/README.md +385 -2
- package/dist/chunk-6b05mnmx.js +19 -0
- package/dist/chunk-6b05mnmx.js.map +11 -0
- package/dist/chunk-7rtfjh9f.js +45 -0
- package/dist/chunk-7rtfjh9f.js.map +10 -0
- package/dist/chunk-8j4c28jt.js +4085 -0
- package/dist/chunk-8j4c28jt.js.map +46 -0
- package/dist/chunk-d1fv6hrm.js +2532 -0
- package/dist/chunk-d1fv6hrm.js.map +43 -0
- package/dist/chunk-dbq4qf52.js +902 -0
- package/dist/chunk-dbq4qf52.js.map +25 -0
- package/dist/chunk-drna2rny.js +836 -0
- package/dist/chunk-drna2rny.js.map +17 -0
- package/dist/chunk-dxvypr7y.js +89 -0
- package/dist/chunk-dxvypr7y.js.map +11 -0
- package/dist/chunk-f6yme003.js +1589 -0
- package/dist/chunk-f6yme003.js.map +30 -0
- package/dist/chunk-hg7pf34j.js +465 -0
- package/dist/chunk-hg7pf34j.js.map +19 -0
- package/dist/chunk-jq4e17tj.js +1031 -0
- package/dist/chunk-jq4e17tj.js.map +21 -0
- package/dist/chunk-y63c6zcv.js +2668 -0
- package/dist/chunk-y63c6zcv.js.map +53 -0
- package/dist/cli/args.d.ts +30 -0
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.js +348 -0
- package/dist/cli/bin.js.map +15 -0
- package/dist/cli/load.d.ts +2 -0
- package/dist/cli/manifest.d.ts +53 -0
- package/dist/cli/render-cmds.d.ts +12 -0
- package/dist/cli/run.d.ts +1 -0
- package/dist/cli/texture-cache.d.ts +4 -0
- package/dist/core/asset.d.ts +10 -0
- package/dist/core/definition.d.ts +155 -0
- package/dist/core/errors.d.ts +17 -0
- package/dist/core/family.d.ts +23 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.js +69 -0
- package/dist/core/index.js.map +9 -0
- package/dist/core/mesh.d.ts +35 -0
- package/dist/core/part.d.ts +114 -0
- package/dist/core/png.d.ts +1 -0
- package/dist/core/rng.d.ts +12 -0
- package/dist/core/transform.d.ts +20 -0
- package/dist/core/vec.d.ts +11 -0
- package/dist/core/world.d.ts +16 -0
- package/dist/export/bin-writer.d.ts +16 -0
- package/dist/export/container.d.ts +3 -0
- package/dist/export/credits.d.ts +4 -0
- package/dist/export/glb-options.d.ts +48 -0
- package/dist/export/glb.d.ts +8 -0
- package/dist/export/hierarchy.d.ts +23 -0
- package/dist/export/index.d.ts +5 -0
- package/dist/export/index.js +40 -0
- package/dist/export/index.js.map +9 -0
- package/dist/export/lights.d.ts +8 -0
- package/dist/export/lod-coverage.d.ts +12 -0
- package/dist/export/materials.d.ts +23 -0
- package/dist/export/merge-pivots.d.ts +6 -0
- package/dist/export/metadata.d.ts +21 -0
- package/dist/export/motion.d.ts +9 -0
- package/dist/export/optimize-parts.d.ts +26 -0
- package/dist/export/primitive.d.ts +3 -0
- package/dist/export/tangents.d.ts +2 -0
- package/dist/export/textures.d.ts +22 -0
- package/dist/export/version.d.ts +2 -0
- package/dist/grammar/index.d.ts +2 -0
- package/dist/grammar/index.js +16 -0
- package/dist/grammar/index.js.map +9 -0
- package/dist/grammar/split.d.ts +21 -0
- package/dist/grammar/whyte.d.ts +5 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +457 -0
- package/dist/index.js.map +9 -0
- package/dist/kinds/building.d.ts +44 -0
- package/dist/kinds/faces.d.ts +27 -0
- package/dist/kinds/head-armour.d.ts +5 -0
- package/dist/kinds/head-beard.d.ts +6 -0
- package/dist/kinds/head-bust.d.ts +5 -0
- package/dist/kinds/head-extras.d.ts +15 -0
- package/dist/kinds/head-face.d.ts +8 -0
- package/dist/kinds/head-garb.d.ts +4 -0
- package/dist/kinds/head-geom.d.ts +7 -0
- package/dist/kinds/head-hair.d.ts +4 -0
- package/dist/kinds/head-layout.d.ts +29 -0
- package/dist/kinds/head-mesh.d.ts +31 -0
- package/dist/kinds/head-mouth.d.ts +4 -0
- package/dist/kinds/head-params.d.ts +116 -0
- package/dist/kinds/head-presets.d.ts +19 -0
- package/dist/kinds/head-rim.d.ts +10 -0
- package/dist/kinds/head-tone.d.ts +10 -0
- package/dist/kinds/head-torso.d.ts +35 -0
- package/dist/kinds/head.d.ts +39 -0
- package/dist/kinds/hull-lines.d.ts +65 -0
- package/dist/kinds/hull-skin.d.ts +6 -0
- package/dist/kinds/hull.d.ts +14 -0
- package/dist/kinds/index.d.ts +16 -0
- package/dist/kinds/index.js +78 -0
- package/dist/kinds/index.js.map +9 -0
- package/dist/kinds/mass.d.ts +15 -0
- package/dist/kinds/openings.d.ts +30 -0
- package/dist/kinds/planned.d.ts +6 -0
- package/dist/kinds/roof-chimney.d.ts +16 -0
- package/dist/kinds/roof-shape.d.ts +64 -0
- package/dist/kinds/roof.d.ts +31 -0
- package/dist/kinds/vegetation-fronds.d.ts +15 -0
- package/dist/kinds/vegetation-impostor.d.ts +9 -0
- package/dist/kinds/vegetation-leaves.d.ts +15 -0
- package/dist/kinds/vegetation-mesh.d.ts +21 -0
- package/dist/kinds/vegetation-params.d.ts +90 -0
- package/dist/kinds/vegetation-presets.d.ts +20 -0
- package/dist/kinds/vegetation-skeleton.d.ts +20 -0
- package/dist/kinds/vegetation.d.ts +42 -0
- package/dist/kinds/vehicle.d.ts +42 -0
- package/dist/material/cc0.d.ts +4 -0
- package/dist/material/define.d.ts +34 -0
- package/dist/material/generator.d.ts +4 -0
- package/dist/material/index.d.ts +9 -0
- package/dist/material/index.js +70 -0
- package/dist/material/index.js.map +9 -0
- package/dist/material/library.d.ts +7 -0
- package/dist/material/material-def.d.ts +30 -0
- package/dist/material/paint/bond.d.ts +3 -0
- package/dist/material/paint/canvas.d.ts +39 -0
- package/dist/material/paint/cell.d.ts +4 -0
- package/dist/material/paint/cells-round.d.ts +5 -0
- package/dist/material/paint/cells.d.ts +7 -0
- package/dist/material/paint/compose.d.ts +5 -0
- package/dist/material/paint/concrete.d.ts +3 -0
- package/dist/material/paint/courses.d.ts +31 -0
- package/dist/material/paint/decode-png.d.ts +6 -0
- package/dist/material/paint/default-sheet.d.ts +4 -0
- package/dist/material/paint/fabric.d.ts +4 -0
- package/dist/material/paint/foliage-broad.d.ts +5 -0
- package/dist/material/paint/foliage-common.d.ts +35 -0
- package/dist/material/paint/foliage-compound.d.ts +4 -0
- package/dist/material/paint/foliage-conifer.d.ts +5 -0
- package/dist/material/paint/foliage-raster.d.ts +26 -0
- package/dist/material/paint/foliage.d.ts +3 -0
- package/dist/material/paint/image-strip.d.ts +4 -0
- package/dist/material/paint/kit.d.ts +5 -0
- package/dist/material/paint/masks.d.ts +3 -0
- package/dist/material/paint/metal.d.ts +3 -0
- package/dist/material/paint/noise.d.ts +9 -0
- package/dist/material/paint/normal.d.ts +8 -0
- package/dist/material/paint/orm.d.ts +8 -0
- package/dist/material/paint/planks.d.ts +3 -0
- package/dist/material/paint/plates.d.ts +3 -0
- package/dist/material/paint/shapes.d.ts +8 -0
- package/dist/material/paint/slate.d.ts +3 -0
- package/dist/material/paint/stamp.d.ts +3 -0
- package/dist/material/paint/strip.d.ts +3 -0
- package/dist/material/paint/surface.d.ts +5 -0
- package/dist/material/paint/types.d.ts +65 -0
- package/dist/material/paint/validate.d.ts +3 -0
- package/dist/material/palette.d.ts +14 -0
- package/dist/material/shader-godot.d.ts +2 -0
- package/dist/material/shader-three.d.ts +2 -0
- package/dist/material/shader.d.ts +46 -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 +38 -0
- package/dist/neural/generator.d.ts +25 -0
- package/dist/neural/images.d.ts +17 -0
- package/dist/neural/index.d.ts +2 -0
- package/dist/neural/index.js +14 -0
- package/dist/neural/index.js.map +9 -0
- package/dist/passes/bake-ao.d.ts +17 -0
- package/dist/passes/grime.d.ts +15 -0
- package/dist/passes/index.d.ts +6 -0
- package/dist/passes/index.js +22 -0
- package/dist/passes/index.js.map +9 -0
- package/dist/passes/livery.d.ts +19 -0
- package/dist/passes/optimize-cache.d.ts +15 -0
- package/dist/passes/optimize-weld.d.ts +15 -0
- package/dist/passes/optimize.d.ts +28 -0
- package/dist/passes/ray-grid.d.ts +23 -0
- package/dist/passes/weighted-normals.d.ts +8 -0
- package/dist/primitives/beam.d.ts +17 -0
- package/dist/primitives/bevel-box.d.ts +13 -0
- package/dist/primitives/box.d.ts +16 -0
- package/dist/primitives/cell.d.ts +20 -0
- package/dist/primitives/check.d.ts +12 -0
- package/dist/primitives/closed.d.ts +11 -0
- package/dist/primitives/erosion.d.ts +22 -0
- package/dist/primitives/font-5x7.d.ts +3 -0
- package/dist/primitives/heightfield.d.ts +16 -0
- package/dist/primitives/index.d.ts +23 -0
- package/dist/primitives/index.js +81 -0
- package/dist/primitives/index.js.map +9 -0
- package/dist/primitives/lathe-facets.d.ts +8 -0
- package/dist/primitives/lathe.d.ts +26 -0
- package/dist/primitives/lattice.d.ts +30 -0
- package/dist/primitives/loft.d.ts +15 -0
- package/dist/primitives/mc-table.d.ts +2 -0
- package/dist/primitives/member.d.ts +19 -0
- package/dist/primitives/noise.d.ts +34 -0
- package/dist/primitives/planar.d.ts +10 -0
- package/dist/primitives/prism.d.ts +13 -0
- package/dist/primitives/sculpt-edit.d.ts +56 -0
- package/dist/primitives/sculpt-tree.d.ts +23 -0
- package/dist/primitives/sculpt.d.ts +27 -0
- package/dist/primitives/sdf-grid.d.ts +17 -0
- package/dist/primitives/sdf-ops.d.ts +37 -0
- package/dist/primitives/sdf.d.ts +21 -0
- package/dist/primitives/strip-uv.d.ts +11 -0
- package/dist/primitives/surface-nets.d.ts +7 -0
- package/dist/primitives/sweep.d.ts +19 -0
- package/dist/primitives/terrain-color.d.ts +30 -0
- package/dist/primitives/terrain-grid.d.ts +36 -0
- package/dist/primitives/text-layout.d.ts +22 -0
- package/dist/primitives/text.d.ts +27 -0
- package/dist/primitives/tiled.d.ts +22 -0
- package/dist/primitives/transport.d.ts +17 -0
- package/dist/primitives/triangulate.d.ts +2 -0
- package/dist/primitives/value-noise.d.ts +10 -0
- package/dist/qa/checks.d.ts +11 -0
- package/dist/qa/clash.d.ts +2 -0
- package/dist/qa/floating.d.ts +5 -0
- package/dist/qa/gates.d.ts +12 -0
- package/dist/qa/geometry.d.ts +21 -0
- package/dist/qa/index.d.ts +12 -0
- package/dist/qa/index.js +78 -0
- package/dist/qa/index.js.map +9 -0
- package/dist/qa/inside.d.ts +12 -0
- package/dist/qa/inspect.d.ts +18 -0
- package/dist/qa/lods.d.ts +12 -0
- package/dist/qa/measures.d.ts +4 -0
- package/dist/qa/occlusion.d.ts +3 -0
- package/dist/qa/sanity.d.ts +7 -0
- package/dist/qa/types.d.ts +12 -0
- package/dist/render/beauty.d.ts +40 -0
- package/dist/render/camera.d.ts +33 -0
- package/dist/render/depth-map.d.ts +38 -0
- package/dist/render/font.d.ts +1 -0
- package/dist/render/ground.d.ts +13 -0
- package/dist/render/index.d.ts +10 -0
- package/dist/render/index.js +47 -0
- package/dist/render/index.js.map +9 -0
- package/dist/render/lighting.d.ts +27 -0
- package/dist/render/lod-strip.d.ts +5 -0
- package/dist/render/metrics.d.ts +37 -0
- package/dist/render/options.d.ts +28 -0
- package/dist/render/photo-match.d.ts +19 -0
- package/dist/render/raster.d.ts +25 -0
- package/dist/render/resolve.d.ts +11 -0
- package/dist/render/review-prompt.d.ts +2 -0
- package/dist/render/review-warnings.d.ts +34 -0
- package/dist/render/review.d.ts +24 -0
- package/dist/render/scene.d.ts +18 -0
- package/dist/render/shade.d.ts +22 -0
- package/dist/render/sheet.d.ts +15 -0
- package/dist/render/texture.d.ts +15 -0
- package/dist/render/thumbnail.d.ts +8 -0
- package/dist/render/vis-buffer.d.ts +18 -0
- package/dist/testing/assert.d.ts +21 -0
- package/dist/testing/compiled.d.ts +15 -0
- package/dist/testing/hash.d.ts +1 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.js +134 -0
- package/dist/testing/index.js.map +13 -0
- package/dist/testing/snapshot.d.ts +13 -0
- package/docs/README.md +56 -0
- package/docs/architecture/README.md +68 -0
- package/docs/architecture/adding-a-kind.md +44 -0
- package/docs/architecture/adding-a-primitive.md +49 -0
- package/docs/architecture/errors.md +47 -0
- package/docs/architecture/glb-production.md +214 -0
- package/docs/architecture/gltf-capabilities.md +117 -0
- package/docs/architecture/materials.md +151 -0
- package/docs/decisions/001-recipe-compiler-over-ai-meshes.md +27 -0
- package/docs/decisions/002-typescript-not-json.md +22 -0
- package/docs/decisions/003-shared-trim-sheet.md +21 -0
- package/docs/decisions/004-z-up-metres.md +21 -0
- package/docs/decisions/005-zero-runtime-deps.md +21 -0
- package/docs/decisions/006-single-package-subpath-exports.md +20 -0
- package/docs/decisions/007-cpu-contact-sheets.md +21 -0
- package/docs/decisions/008-surface-materials.md +21 -0
- package/docs/decisions/009-gltf-front-axis.md +21 -0
- package/docs/decisions/README.md +15 -0
- package/docs/idea/01-vision.md +117 -0
- package/docs/idea/02-dsl.md +343 -0
- package/docs/idea/03-ir.md +97 -0
- package/docs/idea/04-materials.md +114 -0
- package/docs/idea/05-agent-loop.md +141 -0
- package/docs/idea/06-qa.md +101 -0
- package/docs/idea/07-what-fits.md +45 -0
- package/docs/idea/08-neural-adapters.md +78 -0
- package/docs/idea/09-kinds.md +105 -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/landscape.md +49 -0
- package/docs/plans/roadmap.md +139 -0
- package/examples/build-with-bun.ts +41 -0
- package/llms.txt +47 -0
- package/package.json +100 -4
- package/recipes/README.md +38 -0
- package/recipes/asteroid/README.md +46 -0
- package/recipes/asteroid/asteroid.ts +336 -0
- package/recipes/boulders/README.md +28 -0
- package/recipes/boulders/boulders.ts +117 -0
- package/recipes/boxcar/README.md +53 -0
- package/recipes/boxcar/boxcar.ts +1000 -0
- package/recipes/cargo_container_scifi/README.md +52 -0
- package/recipes/cargo_container_scifi/cargo_container_scifi.ts +461 -0
- package/recipes/dropship/README.md +84 -0
- package/recipes/dropship/dropship.ts +1144 -0
- package/recipes/eiffel_tower/README.md +110 -0
- package/recipes/eiffel_tower/eiffel_tower.ts +781 -0
- package/recipes/goblin_head/README.md +75 -0
- package/recipes/goblin_head/goblin_head.ts +38 -0
- package/recipes/human_head/README.md +68 -0
- package/recipes/human_head/human_head.ts +38 -0
- package/recipes/loco_440/README.md +32 -0
- package/recipes/loco_440/loco_440.ts +1404 -0
- package/recipes/material_swatches/README.md +21 -0
- package/recipes/material_swatches/material_swatches.ts +189 -0
- package/recipes/mountain_range/README.md +45 -0
- package/recipes/mountain_range/mountain_range.ts +128 -0
- package/recipes/oak/README.md +30 -0
- package/recipes/oak/oak.ts +19 -0
- package/recipes/orc_head/README.md +78 -0
- package/recipes/orc_head/orc_head.ts +41 -0
- package/recipes/palm/README.md +30 -0
- package/recipes/palm/palm.ts +19 -0
- package/recipes/pine/README.md +29 -0
- package/recipes/pine/pine.ts +19 -0
- package/recipes/signal_gantry/README.md +36 -0
- package/recipes/signal_gantry/signal_gantry.ts +522 -0
- package/recipes/station_halt/README.md +39 -0
- package/recipes/station_halt/station_halt.ts +722 -0
- package/recipes/t34/README.md +44 -0
- package/recipes/t34/t34.ts +1068 -0
- package/recipes/tiger_1/README.md +75 -0
- package/recipes/tiger_1/tiger_1.ts +1370 -0
- package/recipes/water_tower/README.md +40 -0
- package/recipes/water_tower/water_tower.ts +542 -0
- package/src/cli/args.ts +125 -0
- package/src/cli/bin.ts +7 -0
- package/src/cli/load.ts +17 -0
- package/src/cli/manifest.ts +95 -0
- package/src/cli/render-cmds.ts +66 -0
- package/src/cli/run.ts +192 -0
- package/src/cli/texture-cache.ts +24 -0
- package/src/core/asset.ts +129 -0
- package/src/core/definition.ts +156 -0
- package/src/core/errors.ts +50 -0
- package/src/core/family.ts +50 -0
- package/src/core/index.ts +66 -0
- package/src/core/mesh.ts +114 -0
- package/src/core/part.ts +130 -0
- package/src/core/png.ts +49 -0
- package/src/core/rng.ts +49 -0
- package/src/core/transform.ts +90 -0
- package/src/core/vec.ts +26 -0
- package/src/core/world.ts +80 -0
- package/src/export/bin-writer.ts +79 -0
- package/src/export/container.ts +35 -0
- package/src/export/credits.ts +25 -0
- package/src/export/glb-options.ts +53 -0
- package/src/export/glb.ts +187 -0
- package/src/export/hierarchy.ts +122 -0
- package/src/export/index.ts +34 -0
- package/src/export/lights.ts +49 -0
- package/src/export/lod-coverage.ts +71 -0
- package/src/export/materials.ts +126 -0
- package/src/export/merge-pivots.ts +146 -0
- package/src/export/metadata.ts +62 -0
- package/src/export/motion.ts +70 -0
- package/src/export/optimize-parts.ts +80 -0
- package/src/export/primitive.ts +35 -0
- package/src/export/tangents.ts +75 -0
- package/src/export/textures.ts +88 -0
- package/src/export/version.ts +6 -0
- package/src/grammar/index.ts +4 -0
- package/src/grammar/split.ts +87 -0
- package/src/grammar/whyte.ts +20 -0
- package/src/index.ts +14 -0
- package/src/kinds/building.ts +153 -0
- package/src/kinds/faces.ts +138 -0
- package/src/kinds/head-armour.ts +181 -0
- package/src/kinds/head-beard.ts +133 -0
- package/src/kinds/head-bust.ts +184 -0
- package/src/kinds/head-extras.ts +150 -0
- package/src/kinds/head-face.ts +242 -0
- package/src/kinds/head-garb.ts +181 -0
- package/src/kinds/head-geom.ts +31 -0
- package/src/kinds/head-hair.ts +193 -0
- package/src/kinds/head-layout.ts +63 -0
- package/src/kinds/head-mesh.ts +195 -0
- package/src/kinds/head-mouth.ts +111 -0
- package/src/kinds/head-params.ts +162 -0
- package/src/kinds/head-presets.ts +155 -0
- package/src/kinds/head-rim.ts +128 -0
- package/src/kinds/head-tone.ts +52 -0
- package/src/kinds/head-torso.ts +230 -0
- package/src/kinds/head.ts +176 -0
- package/src/kinds/hull-lines.ts +160 -0
- package/src/kinds/hull-skin.ts +83 -0
- package/src/kinds/hull.ts +209 -0
- package/src/kinds/index.ts +63 -0
- package/src/kinds/mass.ts +110 -0
- package/src/kinds/openings.ts +141 -0
- package/src/kinds/planned.ts +12 -0
- package/src/kinds/roof-chimney.ts +100 -0
- package/src/kinds/roof-shape.ts +230 -0
- package/src/kinds/roof.ts +250 -0
- package/src/kinds/vegetation-fronds.ts +126 -0
- package/src/kinds/vegetation-impostor.ts +118 -0
- package/src/kinds/vegetation-leaves.ts +168 -0
- package/src/kinds/vegetation-mesh.ts +174 -0
- package/src/kinds/vegetation-params.ts +147 -0
- package/src/kinds/vegetation-presets.ts +184 -0
- package/src/kinds/vegetation-skeleton.ts +168 -0
- package/src/kinds/vegetation.ts +199 -0
- package/src/kinds/vehicle.ts +144 -0
- package/src/material/cc0.ts +41 -0
- package/src/material/define.ts +130 -0
- package/src/material/generator.ts +63 -0
- package/src/material/index.ts +60 -0
- package/src/material/library.ts +196 -0
- package/src/material/material-def.ts +84 -0
- package/src/material/paint/bond.ts +60 -0
- package/src/material/paint/canvas.ts +101 -0
- package/src/material/paint/cell.ts +39 -0
- package/src/material/paint/cells-round.ts +119 -0
- package/src/material/paint/cells.ts +111 -0
- package/src/material/paint/compose.ts +53 -0
- package/src/material/paint/concrete.ts +62 -0
- package/src/material/paint/courses.ts +85 -0
- package/src/material/paint/decode-png.ts +106 -0
- package/src/material/paint/default-sheet.ts +73 -0
- package/src/material/paint/fabric.ts +63 -0
- package/src/material/paint/foliage-broad.ts +126 -0
- package/src/material/paint/foliage-common.ts +93 -0
- package/src/material/paint/foliage-compound.ts +135 -0
- package/src/material/paint/foliage-conifer.ts +143 -0
- package/src/material/paint/foliage-raster.ts +196 -0
- package/src/material/paint/foliage.ts +23 -0
- package/src/material/paint/image-strip.ts +88 -0
- package/src/material/paint/kit.ts +37 -0
- package/src/material/paint/masks.ts +46 -0
- package/src/material/paint/metal.ts +109 -0
- package/src/material/paint/noise.ts +52 -0
- package/src/material/paint/normal.ts +52 -0
- package/src/material/paint/orm.ts +108 -0
- package/src/material/paint/planks.ts +101 -0
- package/src/material/paint/plates.ts +72 -0
- package/src/material/paint/shapes.ts +28 -0
- package/src/material/paint/slate.ts +52 -0
- package/src/material/paint/stamp.ts +40 -0
- package/src/material/paint/strip.ts +48 -0
- package/src/material/paint/surface.ts +60 -0
- package/src/material/paint/types.ts +94 -0
- package/src/material/paint/validate.ts +74 -0
- package/src/material/palette.ts +46 -0
- package/src/material/shader-godot.ts +77 -0
- package/src/material/shader-three.ts +103 -0
- package/src/material/shader.ts +100 -0
- package/src/material/slots.ts +18 -0
- package/src/material/texture-source.ts +86 -0
- package/src/material/trim-sheet.ts +166 -0
- package/src/neural/generator.ts +37 -0
- package/src/neural/images.ts +27 -0
- package/src/neural/index.ts +10 -0
- package/src/passes/bake-ao.ts +183 -0
- package/src/passes/grime.ts +37 -0
- package/src/passes/index.ts +8 -0
- package/src/passes/livery.ts +66 -0
- package/src/passes/optimize-cache.ts +175 -0
- package/src/passes/optimize-weld.ts +147 -0
- package/src/passes/optimize.ts +85 -0
- package/src/passes/ray-grid.ts +237 -0
- package/src/passes/weighted-normals.ts +125 -0
- package/src/primitives/beam.ts +60 -0
- package/src/primitives/bevel-box.ts +140 -0
- package/src/primitives/box.ts +90 -0
- package/src/primitives/cell.ts +115 -0
- package/src/primitives/check.ts +49 -0
- package/src/primitives/closed.ts +74 -0
- package/src/primitives/erosion.ts +183 -0
- package/src/primitives/font-5x7.ts +117 -0
- package/src/primitives/heightfield.ts +101 -0
- package/src/primitives/index.ts +56 -0
- package/src/primitives/lathe-facets.ts +45 -0
- package/src/primitives/lathe.ts +174 -0
- package/src/primitives/lattice.ts +131 -0
- package/src/primitives/loft.ts +174 -0
- package/src/primitives/mc-table.ts +41 -0
- package/src/primitives/member.ts +130 -0
- package/src/primitives/noise.ts +157 -0
- package/src/primitives/planar.ts +55 -0
- package/src/primitives/prism.ts +85 -0
- package/src/primitives/sculpt-edit.ts +212 -0
- package/src/primitives/sculpt-tree.ts +226 -0
- package/src/primitives/sculpt.ts +80 -0
- package/src/primitives/sdf-grid.ts +131 -0
- package/src/primitives/sdf-ops.ts +145 -0
- package/src/primitives/sdf.ts +83 -0
- package/src/primitives/strip-uv.ts +26 -0
- package/src/primitives/surface-nets.ts +161 -0
- package/src/primitives/sweep.ts +162 -0
- package/src/primitives/terrain-color.ts +85 -0
- package/src/primitives/terrain-grid.ts +137 -0
- package/src/primitives/text-layout.ts +85 -0
- package/src/primitives/text.ts +197 -0
- package/src/primitives/tiled.ts +93 -0
- package/src/primitives/transport.ts +85 -0
- package/src/primitives/triangulate.ts +42 -0
- package/src/primitives/value-noise.ts +62 -0
- package/src/qa/checks.ts +110 -0
- package/src/qa/clash.ts +177 -0
- package/src/qa/floating.ts +63 -0
- package/src/qa/gates.ts +126 -0
- package/src/qa/geometry.ts +187 -0
- package/src/qa/index.ts +28 -0
- package/src/qa/inside.ts +114 -0
- package/src/qa/inspect.ts +107 -0
- package/src/qa/lods.ts +97 -0
- package/src/qa/measures.ts +67 -0
- package/src/qa/occlusion.ts +166 -0
- package/src/qa/sanity.ts +137 -0
- package/src/qa/types.ts +17 -0
- package/src/render/beauty.ts +115 -0
- package/src/render/camera.ts +142 -0
- package/src/render/depth-map.ts +191 -0
- package/src/render/font.ts +76 -0
- package/src/render/ground.ts +87 -0
- package/src/render/index.ts +34 -0
- package/src/render/lighting.ts +121 -0
- package/src/render/lod-strip.ts +34 -0
- package/src/render/metrics.ts +147 -0
- package/src/render/options.ts +81 -0
- package/src/render/photo-match.ts +28 -0
- package/src/render/raster.ts +143 -0
- package/src/render/resolve.ts +109 -0
- package/src/render/review-prompt.ts +59 -0
- package/src/render/review-warnings.ts +92 -0
- package/src/render/review.ts +103 -0
- package/src/render/scene.ts +119 -0
- package/src/render/shade.ts +204 -0
- package/src/render/sheet.ts +88 -0
- package/src/render/texture.ts +97 -0
- package/src/render/thumbnail.ts +75 -0
- package/src/render/vis-buffer.ts +119 -0
- package/src/testing/assert.ts +115 -0
- package/src/testing/compiled.ts +31 -0
- package/src/testing/hash.ts +14 -0
- package/src/testing/index.ts +14 -0
- package/src/testing/snapshot.ts +37 -0
- package/src/types/gltf-validator.d.ts +13 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Vec3 } from '../../core/index.js';
|
|
2
|
+
export interface Canvas {
|
|
3
|
+
readonly w: number;
|
|
4
|
+
readonly h: number;
|
|
5
|
+
/** World metres the canvas spans along U (x) and V (y). Row y grows with world up (+V). */
|
|
6
|
+
readonly metresU: number;
|
|
7
|
+
readonly metresV: number;
|
|
8
|
+
/** Strips wrap along U (tile seamlessly); cells clamp. */
|
|
9
|
+
readonly wrapU: boolean;
|
|
10
|
+
readonly height: Float32Array;
|
|
11
|
+
readonly tone: Float32Array;
|
|
12
|
+
readonly rough: Float32Array;
|
|
13
|
+
readonly metal: Float32Array;
|
|
14
|
+
/** Extra occlusion multiplied into the cavity AO (foliage darkens toward the twig). */
|
|
15
|
+
readonly occl: Float32Array;
|
|
16
|
+
/** 0 = `colours[0]`, 1 = `colours[1]` (latewood, rust, bare wood under chipped paint…). */
|
|
17
|
+
readonly mix: Float32Array;
|
|
18
|
+
/** Linear albedo pair for material strips; null = greyscale (vertex colour carries hue). */
|
|
19
|
+
colours: readonly [Vec3, Vec3] | null;
|
|
20
|
+
/** sRGB RGBA override (stamped images, coloured foliage); null when painted greyscale. */
|
|
21
|
+
rgba: Uint8Array | null;
|
|
22
|
+
/** Tangent-space normal override (image strips); null = derived from `height`. */
|
|
23
|
+
normalRgba: Uint8Array | null;
|
|
24
|
+
}
|
|
25
|
+
export declare function createCanvas(w: number, h: number, metresU: number, metresV: number, wrapU: boolean): Canvas;
|
|
26
|
+
/** Metres per pixel along x and y. */
|
|
27
|
+
export declare const pxU: (c: Canvas) => number;
|
|
28
|
+
export declare const pxV: (c: Canvas) => number;
|
|
29
|
+
/** Noise period (lattice cells across the canvas width) for a feature size in metres. */
|
|
30
|
+
export declare function periodFor(c: Canvas, featureMetres: number): number;
|
|
31
|
+
/**
|
|
32
|
+
* fBm sampled at metres (xm, ym) with feature size `sizeU` along U and `sizeV` along V,
|
|
33
|
+
* snapped so it tiles along U. Returns [-1, 1].
|
|
34
|
+
*/
|
|
35
|
+
export declare function noiseAt(c: Canvas, xm: number, ym: number, sizeU: number, sizeV: number, seed: number, octaves?: number): number;
|
|
36
|
+
/** Read a parameter with a default, rejecting nothing (validation happens in the generator). */
|
|
37
|
+
export declare const param: (params: Readonly<Record<string, number>> | undefined, key: string, fallback: number) => number;
|
|
38
|
+
export declare const clamp01: (v: number) => number;
|
|
39
|
+
export declare const smooth: (e0: number, e1: number, v: number) => number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Canvas } from './canvas.js';
|
|
2
|
+
import type { StripRecipe } from './types.js';
|
|
3
|
+
export declare function paintClock(c: Canvas, r: StripRecipe, _seed: number): void;
|
|
4
|
+
export declare function paintSmokebox(c: Canvas, r: StripRecipe, seed: number): void;
|
|
5
|
+
export declare function paintPorthole(c: Canvas, r: StripRecipe, seed: number): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Canvas } from './canvas.js';
|
|
2
|
+
import type { StripRecipe } from './types.js';
|
|
3
|
+
/** Pane tone: dark enough that `luma < 0.3` marks glass for window glow. */
|
|
4
|
+
export declare const PANE_TONE = 0.12;
|
|
5
|
+
export declare function paintWindowSash(c: Canvas, r: StripRecipe, seed: number): void;
|
|
6
|
+
export declare function paintDoorPanel(c: Canvas, r: StripRecipe, seed: number): void;
|
|
7
|
+
export declare function paintSign(c: Canvas, r: StripRecipe, _seed: number): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Canvas } from './canvas.js';
|
|
2
|
+
import type { PaintedSheet } from './types.js';
|
|
3
|
+
/** An empty sheet: white albedo (vertex colour reads true), flat normal, AO 1, rough 0.8. */
|
|
4
|
+
export declare function blankSheet(size: number): PaintedSheet;
|
|
5
|
+
export declare function composeRegion(sheet: PaintedSheet, c: Canvas, x0: number, y0: number, pad: number): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Canvas } from './canvas.js';
|
|
2
|
+
export interface CourseSpec {
|
|
3
|
+
/** Course height, metres (along V). */
|
|
4
|
+
readonly course: number;
|
|
5
|
+
/** Mean tile length, metres (along U). */
|
|
6
|
+
readonly length: number;
|
|
7
|
+
/** 0 = regular; 0.5 = sizes vary ±25 %. */
|
|
8
|
+
readonly irregular: number;
|
|
9
|
+
/** Fraction of a tile each odd course shifts; random offsets when irregular. */
|
|
10
|
+
readonly stagger: number;
|
|
11
|
+
readonly seed: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class Courses {
|
|
14
|
+
/** Tile index within the current course, per column. */
|
|
15
|
+
readonly id: Int32Array;
|
|
16
|
+
/** Distance to the nearest vertical joint, metres, per column. */
|
|
17
|
+
readonly dx: Float32Array;
|
|
18
|
+
/** Distance from the tile's left joint, metres, per column. */
|
|
19
|
+
readonly ux: Float32Array;
|
|
20
|
+
/** The current course: index and its bottom / top in metres. */
|
|
21
|
+
index: number;
|
|
22
|
+
y0: number;
|
|
23
|
+
y1: number;
|
|
24
|
+
private readonly bounds;
|
|
25
|
+
private readonly c;
|
|
26
|
+
private readonly spec;
|
|
27
|
+
constructor(c: Canvas, spec: CourseSpec);
|
|
28
|
+
/** Point the tables at the course containing metres `ym`; returns the course index. */
|
|
29
|
+
at(ym: number): number;
|
|
30
|
+
private fill;
|
|
31
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Canvas } from './canvas.js';
|
|
2
|
+
export declare function paintBroadleaf(c: Canvas, seed: number): void;
|
|
3
|
+
export declare function paintMaple(c: Canvas, seed: number): void;
|
|
4
|
+
export declare function paintMapleAutumn(c: Canvas, seed: number): void;
|
|
5
|
+
export declare function paintBirch(c: Canvas, seed: number): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Rng } from '../../core/index.js';
|
|
2
|
+
import type { Foliage, Rgb } from './foliage-raster.js';
|
|
3
|
+
/** A quadratic Bézier from p0 via p1 to p2, metres in the cell (anchor usually 0.5, 0.02). */
|
|
4
|
+
export interface Curve {
|
|
5
|
+
readonly x: readonly number[];
|
|
6
|
+
readonly y: readonly number[];
|
|
7
|
+
/** Tangent angle per sample (0 = +V, + toward +U), the convention `Foliage.leaf` takes. */
|
|
8
|
+
readonly a: readonly number[];
|
|
9
|
+
}
|
|
10
|
+
export declare function curve(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, n?: number): Curve;
|
|
11
|
+
/** Sample index nearest parameter t ∈ [0, 1]. */
|
|
12
|
+
export declare const at: (c: Curve, t: number) => number;
|
|
13
|
+
/** Draw a curve as a tapered stem. */
|
|
14
|
+
export declare function drawStem(f: Foliage, c: Curve, w0: number, w1: number, col: Rgb): void;
|
|
15
|
+
/** Jitter a colour per leaf: brightness ±amt and a small hue drift between R and G. */
|
|
16
|
+
export declare function vary(rng: Rng, col: Rgb, amt: number): Rgb;
|
|
17
|
+
export declare const dim: (col: Rgb, k: number) => Rgb;
|
|
18
|
+
/** Leaf palettes, linear RGB (multiply by a near-white vertex colour on the card). */
|
|
19
|
+
export declare const LEAF: {
|
|
20
|
+
readonly beech: Rgb;
|
|
21
|
+
readonly maple: Rgb;
|
|
22
|
+
readonly birch: Rgb;
|
|
23
|
+
readonly acacia: Rgb;
|
|
24
|
+
readonly palm: Rgb;
|
|
25
|
+
readonly dry: Rgb;
|
|
26
|
+
readonly spruce: Rgb;
|
|
27
|
+
readonly pine: Rgb;
|
|
28
|
+
readonly willow: Rgb;
|
|
29
|
+
readonly reed: Rgb;
|
|
30
|
+
readonly snow: Rgb;
|
|
31
|
+
readonly bark: Rgb;
|
|
32
|
+
readonly twig: Rgb;
|
|
33
|
+
};
|
|
34
|
+
/** Autumn maple: each leaf picks one of these, then gets jittered. */
|
|
35
|
+
export declare const AUTUMN: readonly Rgb[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Canvas } from './canvas.js';
|
|
2
|
+
export declare const paintSpruce: (c: Canvas, seed: number) => void;
|
|
3
|
+
export declare const paintSpruceSnow: (c: Canvas, seed: number) => void;
|
|
4
|
+
export declare function paintNeedles(c: Canvas, seed: number): void;
|
|
5
|
+
export declare function paintReeds(c: Canvas, seed: number): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Canvas } from './canvas.js';
|
|
2
|
+
export type Rgb = readonly [number, number, number];
|
|
3
|
+
/** Width profile of a leaf along its length t ∈ [0, 1]; 1 = full half-width. */
|
|
4
|
+
export type LeafShape = 'ovate' | 'lance' | 'needle' | 'blade' | 'palmate';
|
|
5
|
+
export declare class Foliage {
|
|
6
|
+
private readonly r;
|
|
7
|
+
private readonly g;
|
|
8
|
+
private readonly b;
|
|
9
|
+
private readonly a;
|
|
10
|
+
private readonly c;
|
|
11
|
+
private readonly px;
|
|
12
|
+
constructor(c: Canvas);
|
|
13
|
+
/** Composite `cov` of colour (cr, cg, cb) × shade over texel i. */
|
|
14
|
+
private put;
|
|
15
|
+
/** Pixel bounds of a metre-space box, clipped to the canvas. */
|
|
16
|
+
private span;
|
|
17
|
+
/** A tapered stem / twig / rachis from (ax, ay) width w0 to (bx, by) width w1, metres. */
|
|
18
|
+
stem(ax: number, ay: number, bx: number, by: number, w0: number, w1: number, col: Rgb): void;
|
|
19
|
+
/**
|
|
20
|
+
* A leaf from its base (bx, by) along `angle` (radians, 0 = +V, positive = toward +U), `len`
|
|
21
|
+
* long and `wid` wide at its widest. `serrate` adds teeth; `lift` raises it over earlier layers.
|
|
22
|
+
*/
|
|
23
|
+
leaf(shape: LeafShape, bx: number, by: number, angle: number, len: number, wid: number, col: Rgb, serrate?: number, lift?: number): void;
|
|
24
|
+
/** Write the layers to the canvas: sRGB RGBA with bled colour, occlusion toward the twig. */
|
|
25
|
+
finish(axisX?: number, reach?: number): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Canvas } from './canvas.js';
|
|
2
|
+
import type { PaintKit } from './types.js';
|
|
3
|
+
export declare function paintKit(c: Canvas, seed: number): PaintKit;
|
|
4
|
+
/** Throw T3D_MATERIAL_INVALID if any layer holds a non-finite value. */
|
|
5
|
+
export declare function checkFinite(c: Canvas, where: string): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Integer hash of a lattice point to [0, 1). */
|
|
2
|
+
export declare function hash2(ix: number, iy: number, seed: number): number;
|
|
3
|
+
/** Value noise in [0, 1] on a unit lattice, periodic in x with an integer `period` (cells). */
|
|
4
|
+
export declare function valueNoise(x: number, y: number, period: number, seed: number): number;
|
|
5
|
+
/**
|
|
6
|
+
* Fractal Brownian motion in [-1, 1]: `octaves` layers of value noise, each at double frequency
|
|
7
|
+
* and `gain` amplitude. Doubling keeps the period an integer, so the sum stays tileable.
|
|
8
|
+
*/
|
|
9
|
+
export declare function fbm(x: number, y: number, period: number, seed: number, octaves?: number, gain?: number): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Canvas } from './canvas.js';
|
|
2
|
+
/** Neighbour column indices, precomputed so the hot loop does no modulo. */
|
|
3
|
+
export declare function neighbours(n: number, wrap: boolean): {
|
|
4
|
+
lo: Int32Array;
|
|
5
|
+
hi: Int32Array;
|
|
6
|
+
};
|
|
7
|
+
/** RGBA8 tangent-space normals for the canvas; `strength` scales the slope. */
|
|
8
|
+
export declare function sobelNormals(c: Canvas, strength?: number): Uint8Array;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Canvas } from './canvas.js';
|
|
2
|
+
/** Per-texel ambient occlusion in [1 - AO_STRENGTH, 1]. */
|
|
3
|
+
export declare function cavityOcclusion(c: Canvas): Float32Array;
|
|
4
|
+
export declare const SRGB: Uint8Array<ArrayBuffer>;
|
|
5
|
+
/** RGBA8 ORM: R = occlusion, G = roughness, B = metalness, A = 255. */
|
|
6
|
+
export declare function packOrm(c: Canvas, ao: Float32Array): Uint8Array;
|
|
7
|
+
/** RGBA8 sRGB albedo: the stamped image if any, else (colour pair by mix or grey) × tone × cavity. */
|
|
8
|
+
export declare function packAlbedo(c: Canvas, ao: Float32Array): Uint8Array;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Distance from (px, py) to the segment (ax, ay)–(bx, by). */
|
|
2
|
+
export declare function segment(px: number, py: number, ax: number, ay: number, bx: number, by: number): number;
|
|
3
|
+
/** Signed distance to an axis-aligned rectangle (negative inside). */
|
|
4
|
+
export declare function rect(px: number, py: number, x0: number, y0: number, x1: number, y1: number): number;
|
|
5
|
+
/** Dome profile in [0, 1] for a round boss of radius `r` at distance `d`. */
|
|
6
|
+
export declare const dome: (d: number, r: number) => number;
|
|
7
|
+
/** Distance to the nearest of `n` points evenly spaced on a circle of radius `ring`. */
|
|
8
|
+
export declare function boltRing(px: number, py: number, ring: number, n: number, phase?: number): number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Canvas } from './canvas.js';
|
|
2
|
+
import type { StripRecipe } from './types.js';
|
|
3
|
+
export declare function paintFlat(c: Canvas, r: StripRecipe): void;
|
|
4
|
+
export declare function paintNoise(c: Canvas, r: StripRecipe, seed: number): void;
|
|
5
|
+
export declare function paintGlass(c: Canvas, r: StripRecipe, seed: number): void;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Vec3 } from '../../core/index.js';
|
|
2
|
+
import type { TextureSource } from '../texture-source.js';
|
|
3
|
+
import type { CellId, StripId } from '../trim-sheet.js';
|
|
4
|
+
import type { Canvas } from './canvas.js';
|
|
5
|
+
export interface PaintedSheet {
|
|
6
|
+
readonly size: number;
|
|
7
|
+
/** RGBA8, sRGB. Classic strips are greyscale (vertex colour carries hue); materials carry colour. */
|
|
8
|
+
readonly albedo: Uint8Array;
|
|
9
|
+
/** RGBA8, tangent-space (glTF / OpenGL, +Y toward decreasing V). */
|
|
10
|
+
readonly normal: Uint8Array;
|
|
11
|
+
/** R = occlusion, G = roughness, B = metalness. */
|
|
12
|
+
readonly orm: Uint8Array;
|
|
13
|
+
}
|
|
14
|
+
export type StripKind = 'bond' | 'planks' | 'plates' | 'noise' | 'flat' | 'slate' | 'concrete' | 'glass' | 'metal' | 'weave' | 'leather';
|
|
15
|
+
/**
|
|
16
|
+
* The surface a painter writes, one float per texel per layer, in real metres. Row y grows with
|
|
17
|
+
* world up (+V); strips wrap along x. Layers: `height` (metres, + is out), `tone` (linear
|
|
18
|
+
* brightness multiplier), `rough` and `metal` (0–1), `mix` (0 = albedo, 1 = albedo2), `occl`.
|
|
19
|
+
*/
|
|
20
|
+
export type MaterialSurface = Canvas;
|
|
21
|
+
/** Helpers handed to a custom painter: seeded, tileable noise and smoothstep, all in metres. */
|
|
22
|
+
export interface PaintKit {
|
|
23
|
+
readonly seed: number;
|
|
24
|
+
/** Tileable fBm in [−1, 1] with feature size `sizeU` × `sizeV` metres; `salt` varies it. */
|
|
25
|
+
noise(xm: number, ym: number, sizeU: number, sizeV: number, salt?: number, octaves?: number): number;
|
|
26
|
+
/** Integer hash in [0, 1). */
|
|
27
|
+
hash(a: number, b: number, salt?: number): number;
|
|
28
|
+
smooth(e0: number, e1: number, v: number): number;
|
|
29
|
+
/** Visit every texel: index into the layers and its centre in metres. */
|
|
30
|
+
each(fn: (i: number, xm: number, ym: number) => void): void;
|
|
31
|
+
}
|
|
32
|
+
/** A project painter: runs after the base `kind`, layering its own pattern over it. */
|
|
33
|
+
export type MaterialPainter = (s: MaterialSurface, kit: PaintKit) => void;
|
|
34
|
+
export interface StripRecipe {
|
|
35
|
+
readonly kind: StripKind;
|
|
36
|
+
/**
|
|
37
|
+
* World metres the strip's V span represents (its U span is always `stripRect().metres`).
|
|
38
|
+
* Pick the typical face height the strip is stretched over; texels are anisotropic if needed.
|
|
39
|
+
*/
|
|
40
|
+
readonly scaleMetres: number;
|
|
41
|
+
readonly roughness: number;
|
|
42
|
+
readonly metalness?: number;
|
|
43
|
+
/** Brick/plank courses, rivet pitch, etc. — read per kind (see each painter's header). */
|
|
44
|
+
readonly params?: Readonly<Record<string, number>>;
|
|
45
|
+
/** Intrinsic linear albedo; omitted = white (greyscale strip, vertex colour carries hue). */
|
|
46
|
+
readonly albedo?: Vec3;
|
|
47
|
+
/** Second linear albedo the painter blends to through `mix` (latewood, rust, bare wood…). */
|
|
48
|
+
readonly albedo2?: Vec3;
|
|
49
|
+
/** Extra layer painted after `kind` (see `defineMaterial`). */
|
|
50
|
+
readonly paint?: MaterialPainter;
|
|
51
|
+
/** Paint from a cached CC0 texture set instead of `kind` (see texture-source.ts). */
|
|
52
|
+
readonly texture?: TextureSource;
|
|
53
|
+
}
|
|
54
|
+
/** A cell stamped from PNG bytes (8-bit grey/RGB/RGBA, non-interlaced), e.g. a kubeez.com decal. */
|
|
55
|
+
export interface CellImage {
|
|
56
|
+
readonly image: Uint8Array;
|
|
57
|
+
}
|
|
58
|
+
export interface SheetRecipe {
|
|
59
|
+
readonly seed: number;
|
|
60
|
+
readonly size?: 512 | 1024 | 2048;
|
|
61
|
+
/** Missing strips fall back to `DEFAULT_SHEET`'s recipe for that strip. */
|
|
62
|
+
readonly strips: Readonly<Partial<Record<StripId, StripRecipe>>>;
|
|
63
|
+
/** Cells painted from code, or stamped from a supplied image (e.g. a kubeez.com decal). */
|
|
64
|
+
readonly cells?: Readonly<Partial<Record<CellId, StripRecipe | CellImage>>>;
|
|
65
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Vec3 } from '../core/index.js';
|
|
2
|
+
export type Palette = Readonly<Record<string, Vec3>>;
|
|
3
|
+
/** sRGB hex → linear RGB, the space glTF vertex colours are in. */
|
|
4
|
+
export declare function hex(value: string): Vec3;
|
|
5
|
+
/** Vertex colour for material strips that carry their own colour (oak, brass, rubber…). */
|
|
6
|
+
export declare const NATURAL: Vec3;
|
|
7
|
+
export declare function definePalette(entries: Readonly<Record<string, string>>): Palette;
|
|
8
|
+
/** Era/region palettes ship as data; recipes extend them with object spread. */
|
|
9
|
+
export declare const palettes: {
|
|
10
|
+
readonly victorianRail: Readonly<Record<string, Vec3>>;
|
|
11
|
+
readonly artDeco: Readonly<Record<string, Vec3>>;
|
|
12
|
+
readonly modernGlass: Readonly<Record<string, Vec3>>;
|
|
13
|
+
readonly harbour: Readonly<Record<string, Vec3>>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Surface } from '../core/index.js';
|
|
2
|
+
import { type UvRect } from './trim-sheet.js';
|
|
3
|
+
export interface ShaderHints {
|
|
4
|
+
/** Vertex sway for vegetation. Weight from the `_WIND` attribute or mesh-local height. */
|
|
5
|
+
readonly wind?: {
|
|
6
|
+
readonly strength: number;
|
|
7
|
+
readonly source?: 'attribute' | 'height';
|
|
8
|
+
/** Metres of height at which sway reaches full weight (height source). Default 4. */
|
|
9
|
+
readonly height?: number;
|
|
10
|
+
readonly hz?: number;
|
|
11
|
+
};
|
|
12
|
+
/** Emissive mask on window cells at night: `ratio` of windows lit. */
|
|
13
|
+
readonly windowGlow?: {
|
|
14
|
+
readonly color: string;
|
|
15
|
+
readonly ratio: number;
|
|
16
|
+
readonly intensity?: number;
|
|
17
|
+
};
|
|
18
|
+
/** Wear/grime mask strength 0..1 and how high ground grime climbs (metres). */
|
|
19
|
+
readonly wear?: {
|
|
20
|
+
readonly amount: number;
|
|
21
|
+
readonly grimeHeight?: number;
|
|
22
|
+
};
|
|
23
|
+
/** The surface the material is for: 'cutout' adds alpha test + double-sided. */
|
|
24
|
+
readonly surface?: Surface;
|
|
25
|
+
}
|
|
26
|
+
/** Resolved, validated numbers both emitters print. */
|
|
27
|
+
export interface ShaderParams {
|
|
28
|
+
readonly windStrength: number;
|
|
29
|
+
readonly windAttribute: boolean;
|
|
30
|
+
readonly windHeight: number;
|
|
31
|
+
readonly windHz: number;
|
|
32
|
+
readonly glow: readonly [number, number, number];
|
|
33
|
+
readonly glowRatio: number;
|
|
34
|
+
readonly glowIntensity: number;
|
|
35
|
+
readonly wear: number;
|
|
36
|
+
readonly grimeHeight: number;
|
|
37
|
+
readonly cutout: boolean;
|
|
38
|
+
readonly blend: boolean;
|
|
39
|
+
readonly glowRects: readonly UvRect[];
|
|
40
|
+
readonly glassRect: UvRect;
|
|
41
|
+
}
|
|
42
|
+
export declare function resolveHints(h: ShaderHints): ShaderParams;
|
|
43
|
+
/** A three.js (r18x, WebGPU/TSL) TypeScript module: `createTrimMaterial(maps)` + `upgradeTrimMaterials(root)`. */
|
|
44
|
+
export declare function threeMaterialSource(hints?: ShaderHints): string;
|
|
45
|
+
/** A Godot 4 spatial shader (.gdshader) with the same features and uniform names. */
|
|
46
|
+
export declare function godotShaderSource(hints?: ShaderHints): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Slot index among the custom strips, or −1. */
|
|
2
|
+
export declare const customIndex: (id: string) => number;
|
|
3
|
+
export declare const customIds: () => readonly string[];
|
|
4
|
+
export declare function pushCustom(id: string): number;
|
|
5
|
+
export declare function clearCustom(): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface TextureFile {
|
|
2
|
+
/** Download URL (https) or, for `source: 'file'`, a path relative to the working directory. */
|
|
3
|
+
readonly url: string;
|
|
4
|
+
/** Lower-case hex sha256 of the file's bytes: the cache key and the integrity check. */
|
|
5
|
+
readonly sha256: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TextureSource {
|
|
8
|
+
readonly source: 'polyhaven' | 'ambientcg' | 'file';
|
|
9
|
+
/** The set's id at the source, e.g. 'wood_planks_grey'. */
|
|
10
|
+
readonly id: string;
|
|
11
|
+
/** Only public-domain sets are accepted, so a generated asset never inherits a licence duty. */
|
|
12
|
+
readonly license: 'CC0-1.0';
|
|
13
|
+
/** Human page crediting the set (goes into the GLB's XMP credits). */
|
|
14
|
+
readonly page: string;
|
|
15
|
+
readonly author?: string;
|
|
16
|
+
/** Real-world size the image covers, metres (U × V). Poly Haven lists it as `dimensions`. */
|
|
17
|
+
readonly metres: readonly [number, number];
|
|
18
|
+
readonly maps: {
|
|
19
|
+
/** sRGB base colour. */
|
|
20
|
+
readonly albedo: TextureFile;
|
|
21
|
+
/** Tangent-space normal, OpenGL convention (+Y up in the image; Poly Haven `nor_gl`). */
|
|
22
|
+
readonly normal?: TextureFile;
|
|
23
|
+
/** Packed AO / roughness / metalness (Poly Haven `arm`, glTF ORM order). */
|
|
24
|
+
readonly arm?: TextureFile;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** PNG bytes by sha256. */
|
|
28
|
+
export type TextureCache = ReadonlyMap<string, Uint8Array>;
|
|
29
|
+
/** Hand verified texture bytes to the painter (e.g. from `loadTextureCache()` in scripts). */
|
|
30
|
+
export declare function provideTextures(cache: TextureCache): void;
|
|
31
|
+
export declare function textureBytes(file: TextureFile, where: string): Uint8Array;
|
|
32
|
+
export declare function validateTexture(id: string, t: TextureSource): void;
|
|
33
|
+
/** One credit line for the GLB's XMP and the docs. */
|
|
34
|
+
export declare const creditOf: (t: TextureSource) => string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** The original eight strips: greyscale, tinted by vertex colour. */
|
|
2
|
+
export type ClassicStripId = 'plain' | 'brick' | 'stone' | 'slate' | 'iron' | 'wood' | 'glass' | 'concrete';
|
|
3
|
+
/** Material strips with measured colour: use a near-white vertex colour (`NATURAL`) for truth. */
|
|
4
|
+
export type MaterialStripId = 'oak' | 'pine' | 'wood_weathered' | 'wood_painted' | 'iron_rust' | 'iron_cast' | 'steel_painted' | 'steel_galvanised' | 'brass' | 'copper' | 'aluminium' | 'chrome' | 'rubber' | 'canvas' | 'leather' | 'plastic';
|
|
5
|
+
export type BuiltinStripId = ClassicStripId | MaterialStripId;
|
|
6
|
+
/** A project material's id, as returned by `defineMaterial` (a branded string). */
|
|
7
|
+
export type CustomStripId = string & {
|
|
8
|
+
readonly __ts23dMaterial: true;
|
|
9
|
+
};
|
|
10
|
+
export type StripId = BuiltinStripId | CustomStripId;
|
|
11
|
+
export type DecalCellId = 'window_sash' | 'door_panel' | 'clock' | 'smokebox' | 'sign' | 'porthole';
|
|
12
|
+
/** Cutout leaf cards: the anchor (twig base) is the cell's bottom-centre, growth toward +V. */
|
|
13
|
+
export type FoliageCellId = 'foliage_broadleaf' | 'foliage_maple' | 'foliage_maple_autumn' | 'foliage_birch' | 'foliage_acacia' | 'foliage_palm' | 'foliage_spruce' | 'foliage_spruce_snow' | 'foliage_willow' | 'foliage_reeds' | 'foliage_needles';
|
|
14
|
+
export type CellId = DecalCellId | FoliageCellId;
|
|
15
|
+
export interface UvRect {
|
|
16
|
+
readonly u0: number;
|
|
17
|
+
readonly v0: number;
|
|
18
|
+
readonly u1: number;
|
|
19
|
+
readonly v1: number;
|
|
20
|
+
/** Metres of world surface one full rect covers, so texel density is equal across assets. */
|
|
21
|
+
readonly metres: number;
|
|
22
|
+
}
|
|
23
|
+
/** Strip rows in the atlas: built-ins first, then `CUSTOM_STRIP_SLOTS` project materials. */
|
|
24
|
+
export declare const STRIP_ROWS = 28;
|
|
25
|
+
export declare const CUSTOM_STRIP_SLOTS: number;
|
|
26
|
+
export declare const TRIM_SHEET_SIZE = 2048;
|
|
27
|
+
/** Atlas row of a strip id, or −1 when it is neither built in nor defined. */
|
|
28
|
+
export declare function stripRow(id: string): number;
|
|
29
|
+
export declare function stripRect(id: StripId): UvRect;
|
|
30
|
+
export declare function cellRect(id: CellId): UvRect;
|
|
31
|
+
/** Every built-in strip, classic first. */
|
|
32
|
+
export declare const STRIPS: readonly BuiltinStripId[];
|
|
33
|
+
export declare const CLASSIC_STRIPS: readonly ClassicStripId[];
|
|
34
|
+
export declare const MATERIAL_STRIPS: readonly MaterialStripId[];
|
|
35
|
+
export declare const CELLS: readonly CellId[];
|
|
36
|
+
export declare const DECAL_CELLS: readonly DecalCellId[];
|
|
37
|
+
export declare const FOLIAGE_CELLS: readonly FoliageCellId[];
|
|
38
|
+
export declare const isFoliage: (id: CellId) => id is FoliageCellId;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Mesh, type Vec3 } from '../core/index.js';
|
|
2
|
+
export interface GenerateRequest {
|
|
3
|
+
readonly prompt?: string;
|
|
4
|
+
/** PNG/JPEG bytes of a reference or concept image. */
|
|
5
|
+
readonly image?: Uint8Array;
|
|
6
|
+
readonly seed: number;
|
|
7
|
+
/** Fit the result into this box (metres), Z up, base on the ground. */
|
|
8
|
+
readonly fit: Vec3;
|
|
9
|
+
readonly targetTriangles: number;
|
|
10
|
+
}
|
|
11
|
+
export interface MeshGenerator {
|
|
12
|
+
/** e.g. 'trellis-2', 'hunyuan3d-2.1', 'sf3d'. Part of the cache key. */
|
|
13
|
+
readonly model: string;
|
|
14
|
+
generate(request: GenerateRequest): Promise<Mesh>;
|
|
15
|
+
}
|
|
16
|
+
/** Talks to a local server (e.g. a ComfyUI / gradio wrapper) at `endpoint`. Planned: M5. */
|
|
17
|
+
export declare function localGenerator(_o: {
|
|
18
|
+
model: string;
|
|
19
|
+
endpoint: string;
|
|
20
|
+
}): MeshGenerator;
|
|
21
|
+
/** Import an existing GLB (a CC0 base mesh, a sculpt, a generator's output) as a part. Planned: M5. */
|
|
22
|
+
export declare function importGlb(_bytes: Uint8Array, _o: {
|
|
23
|
+
fit: Vec3;
|
|
24
|
+
recolor?: Vec3;
|
|
25
|
+
}): Mesh;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ImageRequest {
|
|
2
|
+
readonly prompt: string;
|
|
3
|
+
readonly seed: number;
|
|
4
|
+
readonly width: number;
|
|
5
|
+
readonly height: number;
|
|
6
|
+
/** e.g. 'decal', 'tileable', 'reference', 'concept'. */
|
|
7
|
+
readonly purpose: 'decal' | 'tileable' | 'reference' | 'concept';
|
|
8
|
+
}
|
|
9
|
+
export interface ImageSource {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
generate(request: ImageRequest): Promise<Uint8Array>;
|
|
12
|
+
}
|
|
13
|
+
/** kubeez.com image generation. Reads the key from the caller, never from ambient env. */
|
|
14
|
+
export declare function kubeezImages(_o: {
|
|
15
|
+
apiKey: string;
|
|
16
|
+
model?: string;
|
|
17
|
+
}): ImageSource;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
localGenerator2,
|
|
3
|
+
importGlb2,
|
|
4
|
+
kubeezImages2
|
|
5
|
+
} from "../chunk-6b05mnmx.js";
|
|
6
|
+
import"../chunk-hg7pf34j.js";
|
|
7
|
+
export {
|
|
8
|
+
importGlb2 as importGlb,
|
|
9
|
+
kubeezImages2 as kubeezImages,
|
|
10
|
+
localGenerator2 as localGenerator
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//# debugId=12BB55DFBFF53CDF64756E2164756E21
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CompiledAsset, type Mesh } from '../core/index.js';
|
|
2
|
+
export interface AoOptions {
|
|
3
|
+
/** Rays per vertex. Default 24. */
|
|
4
|
+
readonly samples?: number;
|
|
5
|
+
/** Occluders farther than this (metres) don't count. Default 1. */
|
|
6
|
+
readonly radius?: number;
|
|
7
|
+
/** 0 = no change, 1 = fully occluded vertices go black. Default 0.6. */
|
|
8
|
+
readonly strength?: number;
|
|
9
|
+
/** Treat z = 0 as a ground plane (contact shadow under the asset). Default true. */
|
|
10
|
+
readonly ground?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function bakeAo(mesh: Mesh, o?: AoOptions, occluder?: Mesh): Mesh;
|
|
13
|
+
/**
|
|
14
|
+
* Bake AO across a whole compiled asset: every part is occluded by every other (a wheel darkens
|
|
15
|
+
* the hull behind it). Colours only change, so parts keep their local meshes and pivots.
|
|
16
|
+
*/
|
|
17
|
+
export declare function bakeAoAsset(asset: CompiledAsset, o?: AoOptions): CompiledAsset;
|