Skip to content
Shapemetry

Model - Face

API reference for src/schema/domains/face, src/nodeMethods/face on @huukhanhnguyen/model, reachable from ., ./compute.

See the Guide for the ModelJSON / evaluate pipeline.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

asPaths

function

asPaths(input: unknown): CurveEntity[]

coplanarGroups

function

Partition regions into coplanar groups (first member = the group's plane representative). A plane-aware boolean runs per group — regions on different planes never silently merge or drop.

coplanarGroups(regions: ShellEntity[]): ShellEntity[][]

faceOffset

function

faceOffset(face: ShellEntity, distance: number): ShellEntity

faceTrim

function

faceTrim(face: unknown, tool: unknown, side?: boolean): ShellEntity

fill

function

fill(curve: CurveEntity | CurveEntity[]): ShellEntity

Frame

type

An orthonormal plane frame: world = origin + u·uAxis + v·vAxis.

type Frame
// = {
    origin: Point;
    uAxis: Point;
    vAxis: Point;
    normal: Point;
}

fromPath2d

function

Sample the region's boundary to polygon VERTICES (any arc segment is tessellated at a sane chord tolerance), unproject 2D→3D via the frame, producing 3D world loops.

fromPath2d(regionJson: FacePath, uvMatrix?: Transformation$1): Shell

groupedThickenPaths

function

groupedThickenPaths(input: unknown, distance: number, joinType: OffsetJoinType, endType: OffsetEndType): ShellEntity[]

newellNormal

function

Unit normal of a CLOSED loop by Newell's method. [0, 0, 1] when the loop encloses no area — the single spelling for solid.ts, planarize.ts, section.ts and importFaces.ts, which each carried an identical copy.

newellNormal(loop: Point$1[]): Point$1

Path3D

type

type Path3D
// = {
    points: Point[];
    closed: boolean;
}

PinPredicate

type

type PinPredicate
// = (point: Point) => unknown

planarIntersect

function

planarIntersect(a: ShellEntity, other: unknown): ShellEntity

planarOffsetAll

function

planarOffsetAll(faces: ShellEntity[], distance: number): ShellEntity

planarSubtract

function

planarSubtract(a: ShellEntity, other: unknown): ShellEntity

planarUnion

function

planarUnion(a: ShellEntity, other: unknown): ShellEntity

planarUnionAll

function

planarUnionAll(faces: ShellEntity[]): ShellEntity

planarUnionRegions

function

planarUnionRegions(faces: ShellEntity[]): ShellEntity[]

reverseShape

function

reverseShape(e: ShellEntity): ShellEntity

thickenPaths

function

Stroke a coplanar group of paths into ONE filled face. Each path keeps its own open/closed flag, so an open path strokes with end caps instead of becoming a thin closed ring.

thickenPaths(paths: Path3D[], distance: number, joinType: OffsetJoinType, endType: OffsetEndType): ShellEntity

toPath2d

function

Build a Path2d from a face: project each 3D loop to 2D via the face frame (drop z). Closed polygon rings for boolean / offset / triangulation.

toPath2d(face: ShellEntity): FacePath

toPolylines3D

function

toPolylines3D(s: ShellEntity): Path3D[]
Last updated: 📖 1 min readEdit on GitHub