Geometry values
API reference for root values that are not PascalCase namespace objects (Point, Brep, Shell, …).
B-Rep display mesh: Brep.tessellate (solid-root) / Shell.tessellate (one-shell) → TriangleMesh - see Brep and Shell.
API reference
Signatures are generated from the live package .d.ts - not hand-written.
assertBrepVersion2
function
Throw UnsupportedBrepVersion1Error when document still has wires.
assertBrepVersion2(document: unknown): voidfromKernelDocument
function
Solid-root Brep JSON (string or parsed) → one scene shell per kernel shell. Multi-shell cavity solids become multiple Shell values.
fromKernelDocument(document: unknown): Shell[]InvalidShellJsonError
class
A value that does not have Shell's four tables.
class InvalidShellJsonErrorInvalidWireError
class
A value that does not have Wire's shape.
class InvalidWireErrorisWire
function
Is this value a Wire? The PREDICATE half of parseWire — same conditions, no throw, because a type guard that throws is not a guard. One body serves both: the parser calls this.
The absent faces / loops is the whole discriminator (their declaration spells them ?: never for exactly that reason), so this is also what a call site hand-sniffing "loops" in value was reaching for.
isWire(value: unknown): value is WireparseShellJson
function
unknown → Shell, or throw InvalidShellJsonError. The door every JSON.parse(<kernel document>) should cross.
parseShellJson(value: unknown): ShellparseWire
function
unknown → Wire, or throw InvalidWireError.
parseWire(value: unknown): WiretoKernelDocument
function
Scene shell → solid-root Brep JSON string (one shell spanning all faces).
toKernelDocument(shell: Shell): stringUnsupportedBrepVersion1Error
class
Version-1 BRep documents (boundary table spelled wires) are unsupported. Call at every document entry so a v1 payload fails loud instead of reading as a document with no loops.
class UnsupportedBrepVersion1Error