UV Projections
On a Mesh
mesh.computeUVs() // box projection (default)
mesh.computeUVs('planar') // Y-down onto XZ plane
mesh.computeUVs('cylindrical')
mesh.computeUVs('spherical')
Standalone
Operates on a THREE.BufferGeometry directly (mutates in place):
import { projectUVs } from 'shapecraft'
projectUVs(geometry, 'box')
Projection modes
| Mode | Description |
|---|---|
box | Tri-planar — picks projection axis per vertex based on normal |
planar | Projects from Y axis down. u = x, v = z (normalized to bounding box) |
cylindrical | u = atan2(z, x), v = y (normalized) |
spherical | u = atan2(z, x), v = acos(y/r) |