Io - OBJ
API reference — the OBJ doors of @huukhanhnguyen/io: readers, writers and their option / result types, all on this page.
import { readObj, writeObj } from '@huukhanhnguyen/io'Source: ./obj. See all formats or the Guide.
API reference
Signatures are generated from the live package .d.ts - not hand-written.
readObj
function
Parse OBJ content into a faceted B-Rep handle. Vertex positions come from v lines; f lines name corner indices (1-indexed, optionally vertex/uv/normal, a leading negative index counting back from the end). Polygon faces are fan-triangulated.
readObj(content: string): stringwriteObj
function
Tessellate handle and serialize it to an OBJ string. Each tessellation vertex is written as a v line with a matching vn normal, and each triangle as a 1-indexed f a//a b//b c//c line. Does not mutate the caller document.
writeObj(handle: string): string