This file tells coding agents how to work on three-iges-loader safely and consistently.
Parse IGES 5.3 CAD files into a typed model (iges-core) and tessellate wireframe geometry to Three.js (three-iges-loader). Surfaces and B-rep are out of scope unless the user explicitly requests a roadmap phase.
packages/iges-core/ ← Parser + geometry (NO three.js)
src/ ← IGESLoader + toThreeGroup()
test/fixtures/ ← Shared IGES test files
docs/ ← ARCHITECTURE.md, ROADMAP.md, ENTITY_IMPLEMENTATION.md
- Never import
threeinsidepackages/iges-core. - One entity type per decoder file under
entities/decoders/typeNNN.ts. - Register every decoder in
entities/registry.ts. - Always add tests with a fixture in
test/fixtures/when adding behavior. - Do not implement Phase C/D surface/B-rep types unless asked — add a stub that returns
unsupportedand a roadmap note. - Transforms: only
resolve/resolveReferences.tscomposes type 124; decoders emit model-space coordinates. - Z-up → Y-up: only
src/three/toThree.tsapplies root rotation. - Prefer small PR-sized changes: one entity type or one parser fix per change.
pnpm install
pnpm --filter iges-core test # core unit tests
pnpm test # core + integration
pnpm type-check
pnpm build- User-visible changes to the published package require a changeset: run
pnpm changesetand commit the file under.changeset/. - Use patch (fix), minor (new entity/API), major (breaking).
- Do not bump
package.jsonversion manually — CI uses Changesets. - See RELEASING.md and CONTRIBUTING.md.
-
pnpm testpasses -
pnpm type-checkpasses - New entity documented in
docs/ENTITY_IMPLEMENTATION.md - Roadmap table updated in
docs/ROADMAP.mdif status changed -
pnpm changesetadded if the change is user-visible (unless docs-only internal)
- Splitting parameter data with naive
split(';')on the whole P-section without Hollerith awareness — useparamTokenizer.ts. - Mapping PD to entities only by array index — use DE
parameterDataPointerwhen buildingparseParameterSection. - Drawing NURBS by connecting control points — use
sampleNurbsCurve. - Applying
rotation.x = -π/2on every mesh — use root group intoThreeGrouponly.
- docs/ARCHITECTURE.md
- docs/ENTITY_IMPLEMENTATION.md
- docs/ROADMAP.md
- CONTRIBUTING.md — human contributors
- RELEASING.md — versioning & npm (maintainers)
Standard install/test/build/run commands live in the Commands section above; nothing here overrides them.
- Node version: This repo requires Node >=24 (
engines), but the base VM's defaultnodeonPATH(/exec-daemon/node) is v22. An nvm-managed Node 24 is installed and~/.bashrcprepends it so interactive/login shells get Node 24 automatically. If you run a command and hit an engine/version error, you're in a non-login shell using v22 — fix it in that shell withexport PATH="$HOME/.nvm/versions/node/$(nvm version 24)/bin:$PATH"(or startbash -l).pnpm(10.33.4) is provided via corepack on the Node 24 install. - Services: This is a library monorepo — no backend/DB/network services. End-to-end verification =
pnpm test(Vitest:iges-coreunit + loader integration).pnpm builduses tsup. - Example viewer:
pnpm dev:exampleruns a Vite + Three.js browser demo on http://localhost:3000 (dropdown switches IGES fixtures: point/line/slot/arc). It requires WebGL. In the headless VM, Chrome must be launched with--use-angle=swiftshaderfor software WebGL, otherwise the canvas is black withWebGLRenderer: A WebGL context could not be createdin the console.