Skip to content

tilesetHexGeometry

tilesetHexGeometry(manifest, grid?): object

Defined in: packages/declarative-hex-worlds/src/asset-source/tileset.ts:68

Derive the board PLACEMENT geometry a tileset needs for seamless quad tessellation, from the manifest’s cell aspect. Pass the result to <HexWorld geometry> (or projectWorldToGameboardPlan({ geometry })).

Why row spacing must change: a full-cell quad’s Z-extent is height = width · cellHeight/cellWidth (the baked cell aspect). For pointy-top quads to interlock, adjacent ROWS must be height/2 apart. rowSpacingForGeometry computes 1.5·(depth/2), so we invert: depth = (height/2)/0.75 = (2/3)·height. The default regular-hex depth (≈2.3094) spreads rows ~3× too far in Z, leaving the blue gaps between tiles. Width + elevationStep stay at the board defaults.

Uses the first sheet’s grid for the aspect (all sheets in a coherent pack share a cell size); pass a specific grid to override.

Record<string, { select: "first" | "hash"; sheet: string; }> = ...

"tileset" = ...

string = ...

Record<string, { edgeCells?: Record<string, number>; grid: { cellHeight: number; cellWidth: number; cols: number; rows: number; }; role: "transition" | "fill"; url: string; variants?: number[]; }> = ...

number = ...

number = ...

number = ...

number = ...

object

depth: number

elevationStep: number

width: number