Skip to content
Shapemetry

Io - ObjScene

API reference — the ObjScene doors of @huukhanhnguyen/io: readers, writers and their option / result types, all on this page.

import { entitiesToObj, tessellationToObj } from '@huukhanhnguyen/io'

Source: ./objScene. See all formats or the Guide.

API reference

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

entitiesToObj

function

Pre-bake Entity → OBJ + MTL. meshEntity faces emit as n-gon f lines (design topology); a B-rep faceEntity needs triangles and therefore needs options.tessellate (see the field's note). Without it, faces are skipped.

Header keeps the historical pre-bake marker so prior model consumers stay byte-identical on the mesh path.

entitiesToObj(entities: Entity[], options?: ObjOptions): ObjResult

tessellationToObj

function

Tessellated Entity[] → OBJ + MTL. One o object per sourceKey group, usemtl per mesh, and an MTL library carrying every referenced name.

visible: false skips an entity (and, on a BlockEntity, its whole placement), matching this package's STL and IFC scene doors.

OBJ has no instancing slot, so placements are expanded through the shared meshEntitiesOf helper; and no unit or axis convention of its own, so world space is kept as-is, millimetres and Z-up (stated in the header comment).

tessellationToObj(entities: Entity[], options?: ObjOptions): ObjResult
Last updated: 📖 1 min readEdit on GitHub