three-iges-loader

Agent instructions (AI & automation)

This file tells coding agents how to work on three-iges-loader safely and consistently.

Project goal

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.

Monorepo layout

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

Rules

  1. Never import three inside packages/iges-core.
  2. One entity type per decoder file under entities/decoders/typeNNN.ts.
  3. Register every decoder in entities/registry.ts.
  4. Always add tests with a fixture in test/fixtures/ when adding behavior.
  5. Do not implement Phase C/D surface/B-rep types unless asked — add a stub that returns unsupported and a roadmap note.
  6. Transforms: only resolve/resolveReferences.ts composes type 124; decoders emit model-space coordinates.
  7. Z-up → Y-up: only src/three/toThree.ts applies root rotation.
  8. Prefer small PR-sized changes: one entity type or one parser fix per change.

Commands

pnpm install
pnpm --filter iges-core test    # core unit tests
pnpm test                       # core + integration
pnpm type-check
pnpm build

Releases & changesets

Before finishing a task

Common mistakes to avoid

Entry documents

  1. docs/ARCHITECTURE.md
  2. docs/ENTITY_IMPLEMENTATION.md
  3. docs/ROADMAP.md
  4. CONTRIBUTING.md — human contributors
  5. RELEASING.md — versioning & npm (maintainers)

Cursor Cloud specific instructions

Standard install/test/build/run commands live in the Commands section above; nothing here overrides them.