Types - Core
API reference for ./geometry/core on @huukhanhnguyen/types.
See the Guide for the package's role.
API reference
Signatures are generated from the live package .d.ts - not hand-written.
Axis
type
The infinite line through origin along the UNIT direction, oriented: reversing direction gives a different axis while the locus stays the same — which is what makes an axis able to carry a revolve's orientation.
THE infinite-line type of the math core (CLAUDE.md type law, 2026-08-11): one carrier per dimension, no separate Line type. NOT a bounded segment — two endpoints are LineCurve (curve.ts). Plane twin: Axis2d (core2d.ts).
type Axis
// = {
origin: Point;
direction: Vector;
}BoundingBox
type
Axis-aligned box in 3D (default space). Same stem as geometry BoundingBox ops namespace (type/value dual). Plane twin: BoundingBox2d (core2d.ts).
Structured form used at package boundaries (min/max points). The wasm kernel wire remains flat [minX,minY,minZ,maxX,maxY,maxZ] on op returns — convert at the door when needed.
type BoundingBox
// = {
min: Point;
max: Point;
}Color
type
RGB triple in 0..255. Channels outside the range are not clamped here — a consumer interprets as it sees fit. Not a spatial Point: it shares the layout and nothing else, which is why it is its own name.
type Color
// = [number, number, number]Plane
type
An unbounded plane through point with the given normal.
type Plane
// = {
point: Point;
normal: Vector;
}Point
type
3D point (default space). Same stem as geometry Point namespace.
type Point
// = [number, number, number]Quaternion
type
Unit rotation [x, y, z, w].
type Quaternion
// = [number, number, number, number]Transformation
type
A flat 4×4 affine matrix, 16 numbers.
Major order depends on the USE and the two are NOT interchangeable, so every field carrying this type states its own convention: placement transforms are COLUMN-major (Three.Matrix4 / SketchUp Geom::Transformation, translation at 12,13,14), while a face's uvMatrix is ROW-major (plane→world frame, origin at 3,7,11).
type Transformation
// = number[]Vector
type
Free 3D vector (direction / axis). Same layout as Point; field role differs.
type Vector
// = [number, number, number]