@holtjs/craft 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.
@@ -0,0 +1,70 @@
1
+ import { A as ProjectedSocket2D, C as RigDecorPropSpec, Dt as RigBodySpec, Et as RigBodyKey, Mt as RigClip, Nt as RigCosmeticSpec, X as RigPoseState, Z as RigSocketName, m as RigLookColors, x as RigCustomBodySpec } from "./rig-render-DoPVKQAF.js";
2
+ declare const BUILTIN_ANIM_FRAMES: Readonly<Record<string, {
3
+ readonly frames: number;
4
+ readonly dirs: number;
5
+ }>>;
6
+ /** Evaluate any built-in Deck animation at `(bodyOrKey, anim, frame, dir16)` to get exact 3D bone transforms & sockets. */
7
+ declare function evaluateBuiltinPose(bodyOrKey: RigBodyKey | RigBodySpec, anim: string, frame?: number, dir16?: number): RigPoseState;
8
+ interface DirectionalSheetRowSpec {
9
+ /** Clip name (`'idle'`, `'walk'`, `'run'`, etc.) or a custom declarative `RigClip`. */
10
+ readonly clip: string | RigClip;
11
+ /** Row identifier in output metadata (defaults to clip string or `clip.id`). */
12
+ readonly name?: string;
13
+ }
14
+ interface BakeCharacterSheetOptions {
15
+ readonly cellSize?: number;
16
+ readonly ss?: number;
17
+ /** Directions to bake: `4` = `[S(0), E(4), N(8), W(12)]`, `8` = `0,2,4,6,8,10,12,14`. Default `4`. */
18
+ readonly dirs?: 4 | 8;
19
+ readonly rows?: readonly DirectionalSheetRowSpec[];
20
+ readonly colors?: RigLookColors;
21
+ readonly cosmetics?: readonly RigCosmeticSpec[];
22
+ readonly bakeNormals?: boolean;
23
+ }
24
+ interface CharacterFrameMeta {
25
+ readonly key: string;
26
+ readonly clip: string;
27
+ readonly dirIndex: number;
28
+ readonly dir16: number;
29
+ readonly frame: number;
30
+ readonly x: number;
31
+ readonly y: number;
32
+ readonly w: number;
33
+ readonly h: number;
34
+ readonly sockets: Readonly<Record<RigSocketName, ProjectedSocket2D>>;
35
+ }
36
+ interface BakedCharacterSheet {
37
+ readonly width: number;
38
+ readonly height: number;
39
+ readonly cellSize: number;
40
+ readonly columns: number;
41
+ readonly rowCount: number;
42
+ readonly rgba: Uint8ClampedArray;
43
+ readonly normalRgba?: Uint8ClampedArray;
44
+ readonly frames: readonly CharacterFrameMeta[];
45
+ }
46
+ /**
47
+ * Bake a complete multi-direction (`4-dir` S/E/N/W or `8-dir`) × multi-animation pixel-art character spritesheet
48
+ * with per-frame projected 2D socket coordinates (`handR`, `handL`, `headTop`, `back`, ...) and optional Sobel normal map.
49
+ */
50
+ declare function bakeDirectionalCharacterSheet(bodyOrCustom: RigBodyKey | RigBodySpec | RigCustomBodySpec, opts?: BakeCharacterSheetOptions): BakedCharacterSheet;
51
+ declare const GRAVEYARD_PRESETS: {
52
+ readonly keeperBody: RigCustomBodySpec;
53
+ readonly zombieBody: RigCustomBodySpec;
54
+ readonly cosmetics: {
55
+ readonly ironAxe: RigCosmeticSpec;
56
+ readonly blazingTorch: RigCosmeticSpec;
57
+ };
58
+ readonly clips: {
59
+ readonly chop: RigClip;
60
+ readonly shamble: RigClip;
61
+ };
62
+ readonly props: {
63
+ readonly tombstone: RigDecorPropSpec;
64
+ readonly woodenChest: RigDecorPropSpec;
65
+ readonly stoneFurnace: RigDecorPropSpec;
66
+ readonly arrowTower: RigDecorPropSpec;
67
+ readonly ancientPine: RigDecorPropSpec;
68
+ };
69
+ };
70
+ export { GRAVEYARD_PRESETS as a, evaluateBuiltinPose as c, DirectionalSheetRowSpec as i, BakedCharacterSheet as n, bakeDirectionalCharacterSheet as o, CharacterFrameMeta as r, BUILTIN_ANIM_FRAMES as s, BakeCharacterSheetOptions as t };
package/dist/rig3d.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- import { $ as RigBoneName, A as RigDecorGroup, At as RigBodyAttachBone, B as RIG_BONE_NAMES, Bt as RigClip, C as BUILTIN_ANIM_FRAMES, Ct as reachArm, D as RigBodyCategory, Dt as RIG_BODY_EYE_STYLES, E as RIG_DECOR_GROUPS, Et as RIG_BODY_ATTACH_BONES, F as Mat4, Ft as RigBodySpec, G as RIG_COS_E, Gt as RigPrimitiveSpec, H as RIG_CAMERA_GROUND_Y, Ht as RigKeyframe, I as MutVec3, It as RigBodyTailStyle, J as RIG_EYE_MODES, Jt as rigClipFrameCount, K as RIG_DUO_VIEW, Kt as RigPropInstance, L as ProjectedPoint2D, Lt as rigBodyKeyFromIndex, M as compileCustomBodySpec, Mt as RigBodyCustomColors, N as validateRigCustomBody, Nt as RigBodyEyeStyle, O as RigCustomBodyDefaultColors, Ot as RIG_BODY_KEYS, P as validateRigDecorProp, Pt as RigBodyKey, Q as RIG_SOCKET_NAMES, Qt as validateRigPrimitiveList, R as ProjectedSocket2D, Rt as RIG_PRIMITIVE_SHAPES, S as parseHexRgb, St as quatMul, T as RIG_BODY_CATEGORIES, Tt as RIG_BODIES, U as RIG_CELL_SIZE, Ut as RigPixelSpriteSpec, V as RIG_CAMERA_ELEV_DEG, Vt as RigCosmeticSpec, W as RIG_COSMETIC_SLOTS, Wt as RigPrimitiveShape, X as RIG_MODEL_SCALE, Xt as validateRigCosmetic, Y as RIG_LIMITS, Yt as validateRigClip, Z as RIG_SIN_E, Zt as validateRigPixelSprite, _ as renderRigPose, _t as projectWorldPoint2D, a as GRAVEYARD_PRESETS, at as RigSocketName, b as RigLookColors, bt as quatFromUnitVectors, c as DEFAULT_RIG_COLORS, ct as createRigState, d as renderBodyAnimStrip, dt as mat4Invert, et as RigBoneTransform, f as renderBodyRestPreview, ft as mat4Mul, g as renderRigClipStrip, gt as projectSocket2D, h as renderDecorPropSprite, ht as projectAllSockets2D, i as DirectionalSheetRowSpec, it as RigPoseState, j as RigDecorPropSpec, jt as RigBodyAttachment, k as RigCustomBodySpec, kt as RIG_BODY_TAIL_STYLES, l as RenderedRigCell, lt as getBodySockets, m as renderDecorPropSheet, mt as mat4TransformPoint, n as BakedCharacterSheet, nt as RigEaseMode, o as bakeDirectionalCharacterSheet, ot as SocketDefinition, p as renderCosmeticSprite, pt as mat4TransformDir, q as RIG_EASE_MODES, qt as evaluateRigClip, r as CharacterFrameMeta, rt as RigEyeMode, s as CompiledRigStrip, st as Vec3, t as BakeCharacterSheetOptions, tt as RigCosmeticSlot, u as compositeSpriteRgba, ut as mat4Compose, v as Ramp4, vt as quatFromAxisAngle, w as evaluateBuiltinPose, wt as updateRigMatrices, x as derivePixelRamp, xt as quatIdentity, y as Rgb, yt as quatFromEuler, z as Quat, zt as RigBonePoseOverride } from "./rig3d-DhTgbTbX.js";
1
+ import { $ as Vec3, A as ProjectedSocket2D, At as RIG_PRIMITIVE_SHAPES, B as RIG_EYE_MODES, Bt as rigClipFrameCount, C as RigDecorPropSpec, Ct as RigBodyAttachment, D as Mat4, Dt as RigBodySpec, E as validateRigDecorProp, Et as RigBodyKey, F as RIG_CELL_SIZE, Ft as RigPixelSpriteSpec, G as RigBoneName, H as RIG_MODEL_SCALE, Ht as validateRigCosmetic, I as RIG_COSMETIC_SLOTS, It as RigPrimitiveShape, J as RigEaseMode, K as RigBoneTransform, L as RIG_COS_E, Lt as RigPrimitiveSpec, M as RIG_BONE_NAMES, Mt as RigClip, N as RIG_CAMERA_ELEV_DEG, Nt as RigCosmeticSpec, O as MutVec3, Ot as RigBodyTailStyle, P as RIG_CAMERA_GROUND_Y, Pt as RigKeyframe, Q as SocketDefinition, R as RIG_DUO_VIEW, Rt as RigPropInstance, S as RigDecorGroup, St as RigBodyAttachBone, T as validateRigCustomBody, Tt as RigBodyEyeStyle, U as RIG_SIN_E, Ut as validateRigPixelSprite, V as RIG_LIMITS, Vt as validateRigClip, W as RIG_SOCKET_NAMES, Wt as validateRigPrimitiveList, X as RigPoseState, Y as RigEyeMode, Z as RigSocketName, _ as RIG_BODY_CATEGORIES, _t as RIG_BODIES, a as renderBodyAnimStrip, at as mat4TransformDir, b as RigCustomBodyDefaultColors, bt as RIG_BODY_KEYS, c as renderDecorPropSheet, ct as projectSocket2D, d as renderRigPose, dt as quatFromEuler, et as createRigState, f as Ramp4, ft as quatFromUnitVectors, g as parseHexRgb, gt as updateRigMatrices, h as derivePixelRamp, ht as reachArm, i as compositeSpriteRgba, it as mat4Mul, j as Quat, jt as RigBonePoseOverride, k as ProjectedPoint2D, kt as rigBodyKeyFromIndex, l as renderDecorPropSprite, lt as projectWorldPoint2D, m as RigLookColors, mt as quatMul, n as DEFAULT_RIG_COLORS, nt as mat4Compose, o as renderBodyRestPreview, ot as mat4TransformPoint, p as Rgb, pt as quatIdentity, q as RigCosmeticSlot, r as RenderedRigCell, rt as mat4Invert, s as renderCosmeticSprite, st as projectAllSockets2D, t as CompiledRigStrip, tt as getBodySockets, u as renderRigClipStrip, ut as quatFromAxisAngle, v as RIG_DECOR_GROUPS, vt as RIG_BODY_ATTACH_BONES, w as compileCustomBodySpec, wt as RigBodyCustomColors, x as RigCustomBodySpec, xt as RIG_BODY_TAIL_STYLES, y as RigBodyCategory, yt as RIG_BODY_EYE_STYLES, z as RIG_EASE_MODES, zt as evaluateRigClip } from "./rig-render-DoPVKQAF.js";
2
+ import { a as GRAVEYARD_PRESETS, c as evaluateBuiltinPose, i as DirectionalSheetRowSpec, n as BakedCharacterSheet, o as bakeDirectionalCharacterSheet, r as CharacterFrameMeta, s as BUILTIN_ANIM_FRAMES, t as BakeCharacterSheetOptions } from "./rig3d-DeeG_PJj.js";
2
3
  export { BUILTIN_ANIM_FRAMES, BakeCharacterSheetOptions, BakedCharacterSheet, CharacterFrameMeta, CompiledRigStrip, DEFAULT_RIG_COLORS, DirectionalSheetRowSpec, GRAVEYARD_PRESETS, type Mat4, type MutVec3, type ProjectedPoint2D, type ProjectedSocket2D, type Quat, RIG_BODIES, RIG_BODY_ATTACH_BONES, RIG_BODY_CATEGORIES, RIG_BODY_EYE_STYLES, RIG_BODY_KEYS, RIG_BODY_TAIL_STYLES, RIG_BONE_NAMES, RIG_CAMERA_ELEV_DEG, RIG_CAMERA_GROUND_Y, RIG_CELL_SIZE, RIG_COSMETIC_SLOTS, RIG_COS_E, RIG_DECOR_GROUPS, RIG_DUO_VIEW, RIG_EASE_MODES, RIG_EYE_MODES, RIG_LIMITS, RIG_MODEL_SCALE, RIG_PRIMITIVE_SHAPES, RIG_SIN_E, RIG_SOCKET_NAMES, type Ramp4, RenderedRigCell, type Rgb, type RigBodyAttachBone, type RigBodyAttachment, type RigBodyCategory, type RigBodyCustomColors, type RigBodyEyeStyle, type RigBodyKey, type RigBodySpec, type RigBodyTailStyle, type RigBoneName, type RigBonePoseOverride, type RigBoneTransform, type RigClip, type RigCosmeticSlot, type RigCosmeticSpec, type RigCustomBodyDefaultColors, type RigCustomBodySpec, type RigDecorGroup, type RigDecorPropSpec, type RigEaseMode, type RigEyeMode, type RigKeyframe, type RigLookColors, type RigPixelSpriteSpec, type RigPoseState, type RigPrimitiveShape, type RigPrimitiveSpec, type RigPropInstance, type RigSocketName, type SocketDefinition, type Vec3, bakeDirectionalCharacterSheet, compileCustomBodySpec, compositeSpriteRgba, createRigState, derivePixelRamp, evaluateBuiltinPose, evaluateRigClip, getBodySockets, mat4Compose, mat4Invert, mat4Mul, mat4TransformDir, mat4TransformPoint, parseHexRgb, projectAllSockets2D, projectSocket2D, projectWorldPoint2D, quatFromAxisAngle, quatFromEuler, quatFromUnitVectors, quatIdentity, quatMul, reachArm, renderBodyAnimStrip, renderBodyRestPreview, renderCosmeticSprite, renderDecorPropSheet, renderDecorPropSprite, renderRigClipStrip, renderRigPose, rigBodyKeyFromIndex, rigClipFrameCount, updateRigMatrices, validateRigClip, validateRigCosmetic, validateRigCustomBody, validateRigDecorProp, validateRigPixelSprite, validateRigPrimitiveList };
package/dist/rig3d.js CHANGED
@@ -1,2 +1,3 @@
1
- export { h as BUILTIN_ANIM_FRAMES, i as DEFAULT_RIG_COLORS, t as GRAVEYARD_PRESETS, at as RIG_BODIES, ot as RIG_BODY_ATTACH_BONES, _ as RIG_BODY_CATEGORIES, st as RIG_BODY_EYE_STYLES, ct as RIG_BODY_KEYS, lt as RIG_BODY_TAIL_STYLES, k as RIG_BONE_NAMES, A as RIG_CAMERA_ELEV_DEG, j as RIG_CAMERA_GROUND_Y, M as RIG_CELL_SIZE, N as RIG_COSMETIC_SLOTS, P as RIG_COS_E, v as RIG_DECOR_GROUPS, F as RIG_DUO_VIEW, I as RIG_EASE_MODES, L as RIG_EYE_MODES, R as RIG_LIMITS, z as RIG_MODEL_SCALE, S as RIG_PRIMITIVE_SHAPES, B as RIG_SIN_E, V as RIG_SOCKET_NAMES, n as bakeDirectionalCharacterSheet, y as compileCustomBodySpec, a as compositeSpriteRgba, H as createRigState, p as derivePixelRamp, g as evaluateBuiltinPose, C as evaluateRigClip, U as getBodySockets, W as mat4Compose, G as mat4Invert, K as mat4Mul, q as mat4TransformDir, J as mat4TransformPoint, m as parseHexRgb, Y as projectAllSockets2D, X as projectSocket2D, Z as projectWorldPoint2D, Q as quatFromAxisAngle, $ as quatFromEuler, et as quatFromUnitVectors, tt as quatIdentity, nt as quatMul, rt as reachArm, o as renderBodyAnimStrip, s as renderBodyRestPreview, c as renderCosmeticSprite, l as renderDecorPropSheet, u as renderDecorPropSprite, d as renderRigClipStrip, f as renderRigPose, ut as rigBodyKeyFromIndex, w as rigClipFrameCount, it as updateRigMatrices, T as validateRigClip, E as validateRigCosmetic, b as validateRigCustomBody, x as validateRigDecorProp, D as validateRigPixelSprite, O as validateRigPrimitiveList } from "./rig3d-C3i7UL88.js";
2
- import "./tilemap-BFH4_JLe.js";
1
+ import { $ as projectSocket2D, A as validateRigPixelSprite, B as RIG_EYE_MODES, C as validateRigCustomBody, D as rigClipFrameCount, E as evaluateRigClip, F as RIG_CELL_SIZE, G as createRigState, H as RIG_MODEL_SCALE, I as RIG_COSMETIC_SLOTS, J as mat4Invert, K as getBodySockets, L as RIG_COS_E, M as RIG_BONE_NAMES, N as RIG_CAMERA_ELEV_DEG, O as validateRigClip, P as RIG_CAMERA_GROUND_Y, Q as projectAllSockets2D, R as RIG_DUO_VIEW, S as compileCustomBodySpec, T as RIG_PRIMITIVE_SHAPES, U as RIG_SIN_E, V as RIG_LIMITS, W as RIG_SOCKET_NAMES, X as mat4TransformDir, Y as mat4Mul, Z as mat4TransformPoint, _ as parseHexRgb, a as renderCosmeticSprite, at as quatMul, b as RIG_BODY_CATEGORIES, c as renderRigClipStrip, ct as RIG_BODIES, dt as RIG_BODY_KEYS, et as projectWorldPoint2D, ft as RIG_BODY_TAIL_STYLES, i as renderBodyRestPreview, it as quatIdentity, j as validateRigPrimitiveList, k as validateRigCosmetic, l as renderRigPose, lt as RIG_BODY_ATTACH_BONES, n as compositeSpriteRgba, nt as quatFromEuler, o as renderDecorPropSheet, ot as reachArm, p as derivePixelRamp, pt as rigBodyKeyFromIndex, q as mat4Compose, r as renderBodyAnimStrip, rt as quatFromUnitVectors, s as renderDecorPropSprite, st as updateRigMatrices, t as DEFAULT_RIG_COLORS, tt as quatFromAxisAngle, ut as RIG_BODY_EYE_STYLES, v as BUILTIN_ANIM_FRAMES, w as validateRigDecorProp, x as RIG_DECOR_GROUPS, y as evaluateBuiltinPose, z as RIG_EASE_MODES } from "./rig-render-DZBV9u2H.js";
2
+ import { n as bakeDirectionalCharacterSheet, t as GRAVEYARD_PRESETS } from "./rig3d-CPw8F6V2.js";
3
+ export { BUILTIN_ANIM_FRAMES, DEFAULT_RIG_COLORS, GRAVEYARD_PRESETS, RIG_BODIES, RIG_BODY_ATTACH_BONES, RIG_BODY_CATEGORIES, RIG_BODY_EYE_STYLES, RIG_BODY_KEYS, RIG_BODY_TAIL_STYLES, RIG_BONE_NAMES, RIG_CAMERA_ELEV_DEG, RIG_CAMERA_GROUND_Y, RIG_CELL_SIZE, RIG_COSMETIC_SLOTS, RIG_COS_E, RIG_DECOR_GROUPS, RIG_DUO_VIEW, RIG_EASE_MODES, RIG_EYE_MODES, RIG_LIMITS, RIG_MODEL_SCALE, RIG_PRIMITIVE_SHAPES, RIG_SIN_E, RIG_SOCKET_NAMES, bakeDirectionalCharacterSheet, compileCustomBodySpec, compositeSpriteRgba, createRigState, derivePixelRamp, evaluateBuiltinPose, evaluateRigClip, getBodySockets, mat4Compose, mat4Invert, mat4Mul, mat4TransformDir, mat4TransformPoint, parseHexRgb, projectAllSockets2D, projectSocket2D, projectWorldPoint2D, quatFromAxisAngle, quatFromEuler, quatFromUnitVectors, quatIdentity, quatMul, reachArm, renderBodyAnimStrip, renderBodyRestPreview, renderCosmeticSprite, renderDecorPropSheet, renderDecorPropSprite, renderRigClipStrip, renderRigPose, rigBodyKeyFromIndex, rigClipFrameCount, updateRigMatrices, validateRigClip, validateRigCosmetic, validateRigCustomBody, validateRigDecorProp, validateRigPixelSprite, validateRigPrimitiveList };
package/llms.txt CHANGED
@@ -1,16 +1,18 @@
1
1
  # Holt Craft (`@holtjs/craft`)
2
2
 
3
- > Zero-dependency procedural pixel-art, analytical 3D->2D character/prop/socket baker, Dual-Grid/Blob tileset & normal-map generator, atlas packer, and 4x AI visual contact-sheet inspector in pure zero-DOM TypeScript.
3
+ > Zero-dependency smooth 2:1 isometric HD 3D sprite baker (3x3 SSAA + dark ink outlines + true 3D normal maps), procedural pixel-art engine, analytical 3D->2D socket baker, Dual-Grid/Blob tileset generator, atlas packer, and AI visual contact-sheet inspector in pure zero-DOM TypeScript.
4
4
 
5
5
  ## Subpaths
6
- - `@holtjs/craft`: Full barrel (`Craft` namespace + all subpaths).
7
- - `@holtjs/craft/pixel`: `PixelCanvas`, `derivePixelRamp`, `derivePaletteVariants`, `compilePixelGrid`, pure-TS `encodePngRgba`.
8
- - `@holtjs/craft/rig3d`: Analytical 3D->2D character/humanoid/monster/prop baker (`bakeDirectionalCharacterSheet`, `renderDecorPropSheet`, `projectAllSockets2D`, `GRAVEYARD_PRESETS`).
9
- - `@holtjs/craft/tilemap`: Textured 16-tile Dual-Grid (`bakePixelDualGridSheet`), 47-tile Blob (`bakePixelBlob47Sheet`), 3x3 Sobel `bakeNormalMapRgba`.
6
+ - `@holtjs/craft`: Full barrel (`Craft` namespace + all 7 subpaths).
7
+ - `@holtjs/craft/hd3d`: Smooth 2:1 isometric (`45°/30°`) 3x3 SSAA pre-rendered 3D character, prop & painted Dual-Grid terrain baker (`renderHdCharacterCell`, `bakeHdCharacterSheet`, `renderHdPropSheet`, `bakeHdDualGridSheet`, `KRAFTEERS_PRESETS`).
8
+ - `@holtjs/craft/pixel`: `PixelCanvas`, `derivePixelRamp`, `derivePaletteVariants`, `compilePixelGrid`, pure-TS compressed `encodePngRgba`.
9
+ - `@holtjs/craft/rig3d`: Crisp pixel 3D->2D character/humanoid/monster/prop & 9-socket baker (`bakeDirectionalCharacterSheet`, `renderDecorPropSheet`, `projectAllSockets2D`, `GRAVEYARD_PRESETS`).
10
+ - `@holtjs/craft/tilemap`: Textured pixel 16-tile Dual-Grid (`bakePixelDualGridSheet`), 47-tile Blob (`bakePixelBlob47Sheet`), 3x3 Sobel `bakeNormalMapRgba`.
10
11
  - `@holtjs/craft/atlas`: Shelf sprite & normal-map atlas packer (`packSpriteAtlas`, `registerAtlasOnStage`).
11
- - `@holtjs/craft/inspect`: 4x nearest-neighbor visual QA contact sheet (`renderContactSheet`).
12
+ - `@holtjs/craft/inspect`: Native `1x` HD or `4x` pixel visual QA contact sheet (`renderContactSheet`).
12
13
 
13
14
  ## Links
15
+ - [Official Docs](https://holt.js.org/craft/)
14
16
  - [README](https://github.com/botiverse-play/craft/blob/main/README.md)
15
17
  - [Craft Agent Skill](https://github.com/botiverse-play/craft/blob/main/skills/craft/SKILL.md)
16
18
  - [Subpath API Reference](https://github.com/botiverse-play/craft/blob/main/skills/craft/references/subpaths.md)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@holtjs/craft",
3
- "version": "0.1.0",
4
- "description": "Zero-dependency procedural pixel-art, analytical 3D-to-2D sprite/socket baker, Dual-Grid/Blob tileset & normal-map generator, atlas packer, and 4x AI visual contact-sheet inspector for @holtjs/stage.",
3
+ "version": "0.2.0",
4
+ "description": "Zero-dependency smooth 2:1 isometric HD 3D sprite baker (3x3 SSAA + dark ink outlines), procedural pixel-art, analytical 3D-to-2D socket baker, Dual-Grid/Blob tileset & normal-map generator, atlas packer, and AI visual contact-sheet inspector for @holtjs/stage.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Botiverse, Inc.",
7
7
  "homepage": "https://holt.js.org",
@@ -15,6 +15,8 @@
15
15
  "keywords": [
16
16
  "holt",
17
17
  "craft",
18
+ "isometric",
19
+ "pre-rendered-3d",
18
20
  "pixel-art",
19
21
  "procedural-generation",
20
22
  "spritesheet",
@@ -40,6 +42,10 @@
40
42
  "types": "./dist/index.d.ts",
41
43
  "default": "./dist/index.js"
42
44
  },
45
+ "./hd3d": {
46
+ "types": "./dist/hd3d.d.ts",
47
+ "default": "./dist/hd3d.js"
48
+ },
43
49
  "./pixel": {
44
50
  "types": "./dist/pixel.d.ts",
45
51
  "default": "./dist/pixel.js"
@@ -1,13 +1,15 @@
1
1
  ---
2
2
  name: craft
3
- description: Procedurally bake crisp Graveyard Keeper / RPG pixel-art characters, monsters, 26-degree oblique props, 9-socket equipment anchors, textured 16-tile Dual-Grid & 47-tile Blob autotiles, tangent-space normal maps, packed sprite atlases, and 4x AI visual inspection contact sheets in pure zero-DOM TypeScript with @holtjs/craft.
3
+ description: Procedurally bake smooth 2:1 isometric HD 3D sprites (Krafteers / Clash style with 3x3 SSAA, dark ink outlines & true 3D normal maps) OR crisp Graveyard Keeper pixel-art characters, 9-socket equipment anchors, Dual-Grid & 47-tile Blob autotiles, packed sprite atlases, and visual QA contact sheets in pure zero-DOM TypeScript with @holtjs/craft.
4
4
  ---
5
5
 
6
- # Procedural Pixel Characters, Props, Autotiles & 4× Contact Sheets with `@holtjs/craft`
6
+ # Smooth 2:1 Isometric HD 3D & Pixel Asset Baking with `@holtjs/craft`
7
7
 
8
- Use `@holtjs/craft` whenever an AI coding agent or developer needs **crisp, consistent, frame-coherent pixel-art assets** (multi-direction animated characters, zombies/creatures, stone/wood world props, Dual-Grid/Blob terrain sheets, normal maps, and packed atlases) with **zero runtime dependencies, zero Blender/Three.js, and zero browser/DOM required**.
8
+ Use `@holtjs/craft` whenever an AI coding agent or developer needs **frame-coherent game art** with **zero runtime dependencies, zero Blender/Three.js, and zero browser/DOM required**:
9
+ - **Smooth 2:1 Isometric HD 3D (`@holtjs/craft/hd3d`)**: Vibrant, saturated *Krafteers: Tomb Defenders* / *Clash*-style `96×96` characters, `4-dir` turrets/walls/obelisks, smooth painted `64×64` Dual-Grid terrain, anti-aliased dark ink outlines, and exact 3D camera-space normal maps.
10
+ - **Crisp Low-Res Pixel Art (`@holtjs/craft/rig3d` + `/tilemap` + `/pixel`)**: *Graveyard Keeper* / *Eastward*-style `32×32` characters, `26°` oblique props, 4-shade crescent lighting, colored 1px outlines, and textured Dual-Grid / Blob47 tiles.
9
11
 
10
- For the complete exported symbol list across all 6 subpaths, see [references/subpaths.md](references/subpaths.md).
12
+ For the complete exported symbol list across all 7 subpaths, see [references/subpaths.md](references/subpaths.md).
11
13
 
12
14
  ## 1. Install & Subpath Overview
13
15
 
@@ -18,63 +20,66 @@ pnpm add @holtjs/craft
18
20
  | Subpath | Responsibility | Zero DOM / Zero Native Deps? |
19
21
  |---|---|---|
20
22
  | `@holtjs/craft` | Full barrel (`Craft` namespace + all subpaths) | Yes |
21
- | `@holtjs/craft/pixel` | `PixelCanvas`, `derivePixelRamp`, `derivePaletteVariants`, `compilePixelGrid`, pure-TS `encodePngRgba` | Yes |
22
- | `@holtjs/craft/rig3d` | Analytical 3D→2D character/humanoid/monster/prop raycaster (~0.4ms/frame), 9 projected sockets, `GRAVEYARD_PRESETS` | Yes |
23
- | `@holtjs/craft/tilemap` | Textured 16-tile Dual-Grid (`bakePixelDualGridSheet`), 47-tile Blob (`bakePixelBlob47Sheet`), 3×3 Sobel `bakeNormalMapRgba` | Yes |
23
+ | `@holtjs/craft/hd3d` | Smooth `45°/30°` 2:1 isometric 3×3 SSAA HD 3D characters, props, painted Dual-Grid terrain, true 3D normal maps & `KRAFTEERS_PRESETS` | Yes |
24
+ | `@holtjs/craft/pixel` | `PixelCanvas`, `derivePixelRamp`, `derivePaletteVariants`, `compilePixelGrid`, pure-TS compressed `encodePngRgba` | Yes |
25
+ | `@holtjs/craft/rig3d` | Crisp pixel 3D→2D character/humanoid/monster/prop raycaster (~0.4ms/frame), 9 projected sockets, `GRAVEYARD_PRESETS` | Yes |
26
+ | `@holtjs/craft/tilemap` | Textured pixel 16-tile Dual-Grid (`bakePixelDualGridSheet`), 47-tile Blob (`bakePixelBlob47Sheet`), 3×3 Sobel `bakeNormalMapRgba` | Yes |
24
27
  | `@holtjs/craft/atlas` | Shelf `packSpriteAtlas` (RGBA + synchronized normal-map atlas) & one-line `registerAtlasOnStage` | Yes |
25
- | `@holtjs/craft/inspect` | `renderContactSheet` — 4× nearest-neighbor checkerboard + `3×5` bitmap labels + socket/baseline visual QA PNG | Yes |
28
+ | `@holtjs/craft/inspect` | `renderContactSheet` — `1×` native HD or `4×` pixel checkerboard + `3×5` bitmap labels + socket/baseline visual QA PNG | Yes |
26
29
 
27
- ## 2. Bake Multi-Direction Pixel Characters & Props (`@holtjs/craft/rig3d`)
30
+ ## 2. Bake Smooth 2:1 Isometric HD 3D Assets (`@holtjs/craft/hd3d`)
28
31
 
29
32
  ```ts
30
33
  import {
31
- GRAVEYARD_PRESETS,
32
- bakeDirectionalCharacterSheet,
33
- renderDecorPropSheet,
34
- } from '@holtjs/craft/rig3d';
35
-
36
- // 1. Bake 4-direction (S/E/N/W) walk + axe-chop spritesheet + normal map + 9-socket table
37
- const keeper = bakeDirectionalCharacterSheet(GRAVEYARD_PRESETS.keeperBody, {
34
+ KRAFTEERS_PRESETS,
35
+ bakeHdCharacterSheet,
36
+ bakeHdDualGridSheet,
37
+ renderHdPropSheet,
38
+ } from '@holtjs/craft/hd3d';
39
+
40
+ // 1. 4-dir (45°/135°/225°/315°) smooth 96x96 Explorer + exact 3D camera-space normal map!
41
+ const explorer = bakeHdCharacterSheet(KRAFTEERS_PRESETS.explorerBody, {
42
+ cellSize: 96,
43
+ ss: 3,
38
44
  dirs: 4,
39
- rows: [
40
- { clip: 'walk', name: 'walk' },
41
- { clip: GRAVEYARD_PRESETS.clips.chop, name: 'chop' },
42
- ],
45
+ rows: [{ clip: 'walk' }, { clip: KRAFTEERS_PRESETS.clips.swing, name: 'swing' }],
43
46
  cosmetics: [
44
- GRAVEYARD_PRESETS.cosmetics.ironAxe,
45
- GRAVEYARD_PRESETS.cosmetics.blazingTorch,
47
+ KRAFTEERS_PRESETS.cosmetics.goldenPickaxe,
48
+ KRAFTEERS_PRESETS.cosmetics.expeditionTorch,
46
49
  ],
50
+ bakeNormals: true,
47
51
  });
48
52
 
49
- // 2. Bake 26-degree oblique pixel-art world props (1-dir or 4-dir)
50
- const tombstone = renderDecorPropSheet(GRAVEYARD_PRESETS.props.tombstone);
51
- const furnace = renderDecorPropSheet(GRAVEYARD_PRESETS.props.stoneFurnace);
52
- const arrowTower = renderDecorPropSheet(GRAVEYARD_PRESETS.props.arrowTower);
53
+ // 2. Smooth 2:1 isometric 4-dir defense turret & painted 64x64 Dual-Grid turf
54
+ const ballista = renderHdPropSheet(KRAFTEERS_PRESETS.props.ballistaTurret, { resolutionScale: 2.25, ss: 3 });
55
+ const turf = bakeHdDualGridSheet({
56
+ id: 'lush_turf',
57
+ tileSize: 64,
58
+ baseColor: '#22c55e',
59
+ accentColor: '#86efac',
60
+ style: 'grass',
61
+ });
53
62
  ```
54
63
 
55
- ## 3. Bake Textured Dual-Grid & Blob47 Tilesets + Normal Maps (`@holtjs/craft/tilemap`)
64
+ ## 3. Bake Crisp Pixel Characters, Props & Autotiles (`@holtjs/craft/rig3d` + `/tilemap`)
56
65
 
57
66
  ```ts
67
+ import { GRAVEYARD_PRESETS, bakeDirectionalCharacterSheet, renderDecorPropSheet } from '@holtjs/craft/rig3d';
58
68
  import { bakePixelDualGridSheet, bakePixelBlob47Sheet } from '@holtjs/craft/tilemap';
59
69
 
60
- const cobble = bakePixelDualGridSheet({
61
- id: 'graveyard_cobble',
62
- tileSize: 32,
63
- baseColor: '#64748b',
64
- style: 'cobble', // 'cobble' | 'stone_brick' | 'grass' | 'dirt' | 'water' | 'sand'
65
- });
66
-
67
- const fence = bakePixelBlob47Sheet({
68
- id: 'wrought_iron_fence',
69
- tileSize: 32,
70
- capColor: '#475569',
71
- style: 'iron_fence', // 'stone_wall' | 'iron_fence' | 'wood_fence'
70
+ const keeper = bakeDirectionalCharacterSheet(GRAVEYARD_PRESETS.keeperBody, {
71
+ dirs: 4,
72
+ rows: [{ clip: 'walk' }, { clip: GRAVEYARD_PRESETS.clips.chop, name: 'chop' }],
73
+ cosmetics: [GRAVEYARD_PRESETS.cosmetics.ironAxe, GRAVEYARD_PRESETS.cosmetics.blazingTorch],
72
74
  });
75
+ const tombstone = renderDecorPropSheet(GRAVEYARD_PRESETS.props.tombstone);
76
+ const cobble = bakePixelDualGridSheet({ id: 'cobble', tileSize: 32, baseColor: '#64748b', style: 'cobble' });
77
+ const fence = bakePixelBlob47Sheet({ id: 'fence', tileSize: 32, capColor: '#475569', style: 'iron_fence' });
73
78
  ```
74
79
 
75
- ## 4. Pack into `@holtjs/stage` & Visually Inspect at 4× (`@holtjs/craft/atlas` + `/inspect`)
80
+ ## 4. Pack into `@holtjs/stage` & Visually Inspect (`@holtjs/craft/atlas` + `/inspect`)
76
81
 
77
- **Golden Rule for AI Agents**: Always render a 3× or 4× `renderContactSheet()` PNG and inspect it visually before shipping new custom bodies, props, or tiles!
82
+ **Golden Rule for AI Agents**: Always render a `renderContactSheet()` PNG (`scale: 1` for `/hd3d`, `scale: 3` or `4` for `/rig3d` pixel art) and inspect it visually before shipping new custom bodies, props, or tiles!
78
83
 
79
84
  ```ts
80
85
  import fs from 'node:fs';
@@ -83,11 +88,11 @@ import { renderContactSheet } from '@holtjs/craft/inspect';
83
88
 
84
89
  const sheet = renderContactSheet(
85
90
  [
86
- { label: 'KEEPER 4-DIR', sprite: keeper, cellW: 32, cellH: 32 },
87
- { label: 'TOMBSTONE', sprite: tombstone, cellW: 32, baseY: 36 },
88
- { label: 'COBBLE DG', sprite: cobble, cellW: 32, cellH: 32 },
91
+ { label: 'EXPLORER HD 4-DIR', sprite: explorer, cellW: 96, cellH: 96 },
92
+ { label: 'BALLISTA 4-DIR', sprite: ballista, cellW: ballista.frameW },
93
+ { label: 'DUAL-GRID TURF', sprite: turf, cellW: 64, cellH: 64 },
89
94
  ],
90
- { scale: 4, columns: 3, title: 'ASSET QA' },
95
+ { scale: 1, columns: 3, title: 'HD ASSET QA' },
91
96
  );
92
- fs.writeFileSync('asset-qa.png', sheet.png); // pure zero-dep PNG encoder!
97
+ fs.writeFileSync('asset-qa.png', sheet.png);
93
98
  ```
@@ -1,17 +1,24 @@
1
1
  # `@holtjs/craft` Subpath API Reference
2
2
 
3
- All symbols verified against `src/*.ts` (`@holtjs/craft@0.1.0`, 6 subpaths, 0 runtime dependencies, 0 DOM globals).
3
+ All symbols verified against `src/*.ts` (`@holtjs/craft@0.2.0`, 7 subpaths, 0 runtime dependencies, 0 DOM globals).
4
4
 
5
5
  ## `@holtjs/craft` (Barrel)
6
- - Default & named `Craft` namespace + all exports from `./pixel`, `./rig3d`, `./tilemap`, `./atlas`, and `./inspect`.
6
+ - Default & named `Craft` namespace + all exports from `./hd3d`, `./pixel`, `./rig3d`, `./tilemap`, `./atlas`, and `./inspect`.
7
+
8
+ ## `@holtjs/craft/hd3d` (Smooth 2:1 Isometric HD 3D Baker)
9
+ - Character Bakers: `renderHdCharacterCell(bodyOrCustom, animOrClip, frame?, yawRad?, opts?)` -> `HdRenderedCell` (`{ width, height, rgba, normalRgba }`), `bakeHdCharacterSheet(bodyOrCustom, opts?)` -> `HdBakedCharacterSheet`
10
+ - Prop Bakers: `renderHdPropSprite(spec, dir4?, opts?)` -> `HdRenderedCell`, `renderHdPropSheet(spec, opts?)`
11
+ - Smooth Painted Terrain Baker: `bakeHdDualGridSheet(spec)` -> `HdBakedTileset` (`64x64` default seamless 16-tile Dual-Grid + normal map)
12
+ - Presets: `KRAFTEERS_PRESETS` (`explorerBody`, `tombMummyBody`, `cosmetics.{goldenPickaxe,expeditionTorch}`, `clips.{swing,shamble}`, `props.{pharaohObelisk,ballistaTurret,fortressWall,stylizedTree}`)
13
+ - Types: `HdCameraOptions`, `HdBakeCharacterOptions`, `HdBakedCharacterSheet`, `HdRenderedCell`, `HdPropRenderOptions`, `HdDualGridSpec`, `HdBakedTileset`
7
14
 
8
15
  ## `@holtjs/craft/pixel`
9
16
  - Color & Ramps: `parseHexRgb(hex)`, `rgbToHex(rgb)`, `mixRgb(a, b, t)`, `derivePixelRamp(hexOrRgb)` (`[light, base, shade, outline]`), `derivePaletteVariants(baseHex, count?)`
10
17
  - `PixelCanvas`: `.clear()`, `.setPixel()`, `.getPixel()`, `.fillRect()`, `.strokeRect()`, `.fillEllipse()`, `.drawLine()`, `.blit()`, `.flipX()`, `.applyOrderedDither()`, `.addSelectiveOutline()`, `.addContactShadow()`, `.clone()`, `.toPng()`
11
- - Declarative Grid & PNG: `compilePixelGrid(spec, opts?)`, `encodePngRgba(width, height, rgba)` (pure-TS RFC-2083 PNG encoder)
18
+ - Declarative Grid & PNG: `compilePixelGrid(spec, opts?)`, `encodePngRgba(width, height, rgba)` (pure-TS Fixed-Huffman LZ77 RFC-2083 PNG encoder)
12
19
  - Types: `Rgb`, `Rgba`, `Ramp4`, `PixelSpriteLike`, `AsciiPixelGridSpec`, `CompilePixelGridOptions`
13
20
 
14
- ## `@holtjs/craft/rig3d`
21
+ ## `@holtjs/craft/rig3d` (Crisp Pixel 3D→2D & Socket Baker)
15
22
  - Multi-Direction Character Baker & Presets: `bakeDirectionalCharacterSheet(bodyOrCustom, opts?)`, `GRAVEYARD_PRESETS` (`keeperBody`, `zombieBody`, `cosmetics.{ironAxe,blazingTorch}`, `clips.{chop,shamble}`, `props.{tombstone,woodenChest,stoneFurnace,arrowTower,ancientPine}`)
16
23
  - 3D Skeleton, Kinematics & 9-Socket Projection: `RIG_BODIES`, `RIG_BONE_NAMES`, `RIG_SOCKET_NAMES`, `BUILTIN_ANIM_FRAMES`, `createRigState`, `updateRigMatrices`, `reachArm`, `getBodySockets`, `projectWorldPoint2D`, `projectSocket2D`, `projectAllSockets2D`, `evaluateBuiltinPose`, `evaluateRigClip`, `rigClipFrameCount`, `compileCustomBodySpec`
17
24
  - Analytical 3D->2D Rasterizers: `renderRigPose`, `renderRigClipStrip`, `renderBodyAnimStrip`, `renderCosmeticSprite`, `compositeSpriteRgba`, `renderDecorPropSprite`, `renderDecorPropSheet`, `renderBodyRestPreview`