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): ShellEntityfaceTrim
function
faceTrim(face: unknown, tool: unknown, side?: boolean): ShellEntityfill
function
fill(curve: CurveEntity | CurveEntity[]): ShellEntityFrame
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): ShellgroupedThickenPaths
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$1Path3D
type
type Path3D
// = {
points: Point[];
closed: boolean;
}PinPredicate
type
type PinPredicate
// = (point: Point) => unknownplanarIntersect
function
planarIntersect(a: ShellEntity, other: unknown): ShellEntityplanarOffsetAll
function
planarOffsetAll(faces: ShellEntity[], distance: number): ShellEntityplanarSubtract
function
planarSubtract(a: ShellEntity, other: unknown): ShellEntityplanarUnion
function
planarUnion(a: ShellEntity, other: unknown): ShellEntityplanarUnionAll
function
planarUnionAll(faces: ShellEntity[]): ShellEntityplanarUnionRegions
function
planarUnionRegions(faces: ShellEntity[]): ShellEntity[]reverseShape
function
reverseShape(e: ShellEntity): ShellEntitythickenPaths
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): ShellEntitytoPath2d
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): FacePathtoPolylines3D
function
toPolylines3D(s: ShellEntity): Path3D[]