The OBJ file; text is read as bytes and only numbers must be UTF-8.
Required
options.scopestring
The importing node’s id; ids are minted under it. Default undefined (index ids, minter 0).
options.sourceUnit'mm' | 'cm' | 'm' | 'in' | 'ft'
The file’s unit. Default 'mm'. One of mm, cm, m, in, ft.
options.sourceUp'y' | 'z'
The file’s up axis. Default 'z'. One of y, z.
Returns
Ok with a FileImport, as importStl. Points are every v line, used or not; vertex uv and N (Float32) when every face gives vt and vn at every corner.
Errors
Returned when the bytes are not the format; measured.path and measured.byte name the first bad place.
The bytes are not the file format: a keyword, a missing number, a face of fewer than 3 corners, or a length that does not match a count. Check the file is the format the verb reads; measured.path and measured.byte name the first bad place.
Returned when the file is over a limit.
The file is over an import limit: 256 MiB of bytes, 10^7 triangles or 3·10^7 points, or an export over 2 GiB. Split or decimate the model before importing it, or export a smaller value.
Returned when a coordinate is not finite or past 1e18 m once the unit is applied.
A coordinate is not finite, or is past 1e18 m once the unit is applied. Check sourceUnit: a file in metres read as millimetres is a thousand times smaller, not larger; repair the value named by measured.path.
Returned when a face corner names no vertex.
A face corner names no vertex: 0, past the last one, or a relative index before the first. Repair the face named by measured.path; the file refers to vertices it does not hold.
Returned when no face is left to import.
The file holds no face to import (or every face had a zero-length edge). Check the file has faces; lines, points and curves are counted in ignored, not imported.
Returned when file names no bytes the host holds, or an argument breaks its schema.
A tool argument does not match the tool's input schema. Fix the argument named in paramPath.
Returned when kernelio is not registered.
The action is not available in the current context. Satisfy measured.requires first (e.g. create a node before editing one), or load the module measured.capability names (e.g. loadGeometryKernel() for kernel3d).
Guarantees
the faces keep the file’s corner counts and order
the same bytes and options give the same transport and ref on every target
The same result on every machine.
Example
TypeScript
const r = FileFormats.importObj(newTextEncoder().encode('v 0 0 0\nv 1 0 0\nv 0 1 0\nf 1 2 3\n'))r.ok || r.diagnostics[0].code // → 3 points and 1 face once loadKernelIo() has run