feat(mesh): add tile mesh generation package

Add @tts/mesh, a package for generating extruded tile meshes from 2D
shapes. It provides shape generators (rect, hex, circle, rounded rect,
frame), earcut-based tessellation of top/bottom faces with UVs, and
outward-normal wall generation, combined into raw BufferGeometry-ready
typed arrays.
This commit is contained in:
2026-08-08 13:42:32 +08:00
parent 3b86a641aa
commit 14f83f476c
13 changed files with 782 additions and 0 deletions
+29
View File
@@ -123,6 +123,25 @@ importers:
specifier: ^5.7.2
version: 5.9.3
packages/mesh:
dependencies:
earcut:
specifier: ^3.2.3
version: 3.2.3
three:
specifier: ^0.185.1
version: 0.185.1
devDependencies:
'@types/earcut':
specifier: ^3.0.0
version: 3.0.0
'@types/three':
specifier: ^0.185.4
version: 0.185.4
typescript:
specifier: ^5.7.2
version: 5.9.3
packages/shared:
dependencies:
zod:
@@ -606,6 +625,9 @@ packages:
'@types/draco3d@1.4.10':
resolution: {integrity: sha512-AX22jp8Y7wwaBgAixaSvkoG4M/+PlAcm3Qs4OW8yT9DM4xUpWKeFhLueTAyZF39pviAdcDdeJoACapiAceqNcw==}
'@types/earcut@3.0.0':
resolution: {integrity: sha512-k/9fOUGO39yd2sCjrbAJvGDEQvRwRnQIZlBz43roGwUZo5SHAmyVvSFyaVVZkicRVCaDXPKlbxrUcBuJoSWunQ==}
'@types/estree@1.0.9':
resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==}
@@ -743,6 +765,9 @@ packages:
draco3d@1.5.7:
resolution: {integrity: sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==}
earcut@3.2.3:
resolution: {integrity: sha512-vnS4AVwp1KHAF13i1vp1/2D5evWy3k5u/iW/B81QVsUZtV8cv2tU0b2VNFlqvh4kYwrFMDdjPCfAmfyJW9y14Q==}
enhanced-resolve@5.24.5:
resolution: {integrity: sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==}
engines: {node: '>=10.13.0'}
@@ -1661,6 +1686,8 @@ snapshots:
'@types/draco3d@1.4.10': {}
'@types/earcut@3.0.0': {}
'@types/estree@1.0.9': {}
'@types/node@22.20.1':
@@ -1792,6 +1819,8 @@ snapshots:
draco3d@1.5.7: {}
earcut@3.2.3: {}
enhanced-resolve@5.24.5:
dependencies:
graceful-fs: 4.2.11