Types - Hatch
API reference for ./geometry/hatch 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.
ExpandHatchOptions
type
Lattice placement / trim-loop clip knobs — geometry algorithm, not a format.
type ExpandHatchOptions
// = {
/** NurbsCurve sampling tolerance in uv units for clip operations. */
tolerance: number;
/** Hard cap on lattice instances — REQUIRED from the caller. Exceeding
* throws with the computed count (no silent default / truncate). */
maxCellInstances: number;
}Hatch
type
Hatch geometry — pattern content in the UV of exactly ONE trimmed surface. All periodicity is the 2x2 lattice basis; there is no pattern enum.
type Hatch
// = {
/** Pattern content in the unit-cell frame [0,1]² (content MAY overflow).
* Only point / curve / face entities. */
cell: HatchCellEntity[];
/** Lattice basis columns (uv units). Default [[1,0],[0,1]].
* Validation: |det| > 0. All Bravais lattices are expressed here. */
basis?: [Vector2d, Vector2d];
/** Pattern origin in uv. Default [0,0]. */
origin?: [number, number];
/** Pattern rotation in **degrees** (DXF / .pat convention; scene has no
* prior angle field on entity geometry — INHERITED from interchange). */
angle?: number;
/** Uniform scale in uv. Anisotropy belongs in `basis`. Default 1;
* scale=1 with default basis ⇒ whole-face, no-repeat mode. */
scale?: number;
/** The uv domain: one trimmed face (tables with exactly one face).
* Trim loops = hatch boundary. Runtime still checks face count for io. */
face: TrimmedFace;
}HatchEvent
type
type HatchEvent
// = {
t: number;
type: "seg" | "pt";
end?: number;
}LatticeRange
type
type LatticeRange
// = {
iMin: number;
iMax: number;
jMin: number;
jMax: number;
}PatLineFamily
type
type PatLineFamily
// = {
/** Angle in degrees (DXF/.pat). */
angleDeg: number;
/** Base point of the family (uv). */
base: [number, number];
/** Offset vector between parallel lines (uv). */
offset: Vector2d;
/** Dash items: >0 draw, 0 point, <0 gap. Empty ⇒ continuous. */
dashItems: number[];
}UvFace
type
type UvFace
// = {
outer: Point2d[];
holes: Point2d[][];
}UvPolyline
type
uv-space polyline — sampled points the hatch clipper walks. Named for what it IS. It was called UvCurve until 2026-08-12, which collided with the face uv-curve CARRIER (UvCurve in brep.ts): that one is the curve's own description so a reload rebuilds the same curve.
type UvPolyline
// = {
points: Point2d[];
}