IGESLoader is a modern TypeScript-native IGES file loader for Three.js.
[!WARNING] This package is currently in active development and may not be stable. Use with caution.
[!NOTE] Wireframe entities (points, lines, arcs, paths, NURBS curves) are supported first. Surfaces and B-rep solids are planned โ see docs/ROADMAP.md.
โจ Layered architecture โ iges-core parser (no Three.js) + thin IGESLoader
๐ฆ Modern ESM/CJS โ Dual package format with tree-shaking support
๐ง Typed geometry model โ parseAndResolveIGES() for custom pipelines
โก Fast โ Optimized build with tsup and pnpm workspaces
๐งช Tested โ Unit tests + Wikipedia slot fixture
๐ค AI-friendly โ See AGENTS.md and docs/ENTITY_IMPLEMENTATION.md
iges-core/ Parse IGES โ ResolvedIGESModel (geometry[])
src/three/ toThreeGroup() โ THREE.Group
IGESLoader.ts FileLoader + parse + tessellate
Full details: docs/ARCHITECTURE.md ยท Roadmap: docs/ROADMAP.md
three is a peer dependency โ install it alongside this package (any version >=0.160.0 is supported; development targets Three.js r184).
pnpm add three-iges-loader three
Or using npm:
npm install three-iges-loader three
Or using yarn:
yarn add three-iges-loader three
import * as THREE from "three";
import { IGESLoader } from "three-iges-loader";
const loader = new IGESLoader();
const iges_file_path = "/file.iges";
loader.load(
// resource URL
iges_file_path,
// called when load is complete
function (object) {
sceneGeometry.add(object);
},
// called when loading is in progress
function (xhr) {
console.log((xhr.loaded / xhr.total) * 100 + "% loaded");
},
// called when loading has errors
function (error) {
console.log("Error: " + error);
}
);
import * as THREE from "three";
import { IGESLoader } from "three-iges-loader";
const scene = new THREE.Scene();
const loader = new IGESLoader();
loader.load(
"/path/to/file.iges",
(geometry: THREE.Group) => {
scene.add(geometry);
},
(xhr: ProgressEvent) => {
console.log(`${(xhr.loaded / xhr.total) * 100}% loaded`);
},
(error: Error | ErrorEvent) => {
console.error("Error loading IGES file:", error);
}
);
import { useLoader } from "@react-three/fiber";
import { IGESLoader } from "three-iges-loader";
function IgesModel({ url }: { url: string }) {
const group = useLoader(IGESLoader, url);
return <primitive object={group} />;
}
import { parseAndResolveIGES, toThreeGroup } from "three-iges-loader";
const text = await fetch("/model.igs").then((r) => r.text());
const model = parseAndResolveIGES(text);
const group = toThreeGroup(model, { convertZUpToYUp: true });
scene.add(group);
# Install dependencies (pnpm workspace: root + packages/iges-core)
pnpm install
# Build iges-core + three-iges-loader
pnpm build
# Run all tests (core unit + loader integration)
pnpm test
# Run tests in watch mode
pnpm test:watch
# Type check
pnpm type-check
# Lint and format
pnpm lint
pnpm format
The package includes a modern Vite-based example:
# Start the development server
pnpm dev:example
# Build the example
pnpm build:example
Then open http://localhost:3000 in your browser.
IGESLoadernew IGESLoader(manager?: THREE.LoadingManager)
load(url, onLoad, onProgress?, onError?)
Load an IGES file from a URL.
url: string - The URL or path to the IGES fileonLoad: (geometry: THREE.Group) => void - Callback when loading is completeonProgress?: (event: ProgressEvent) => void - Callback for loading progressonError?: (event: ErrorEvent | Error) => void - Callback when an error occursparse(data)
Parse IGES file content.
data: string - The IGES file content as stringTHREE.Group - A Three.js Group containing the parsed geometryimport type { ResolvedIGESModel, GeometryEntity, LineGeometry } from "three-iges-loader";
| Type | Name | Status |
|---|---|---|
| 116 | Point | โ |
| 110 | Line | โ |
| 100 | Circular arc | โ |
| 106 | Copious data / paths | โ partial forms |
| 126 | Rational B-spline curve | โ sampled |
| 124 | Transform matrix | โ resolve only |
| 102 | Composite curve | โฌ roadmap |
| 128+ | Surfaces / B-rep | โฌ deferred |
Contributions are welcome โ see CONTRIBUTING.md.
| Doc | Purpose |
|---|---|
| CONTRIBUTING.md | Setup, PR flow, changesets |
| AGENTS.md | AI coding assistants |
| RELEASING.md | Versioning & npm (maintainers) |
| docs/GITHUB_SETUP.md | One-time GitHub/npm configuration |
| SECURITY.md | Vulnerability reporting |
Releases: Semantic versioning via Changesets; merges to main open a Version Packages PR, then publish to npm automatically.
MIT ยฉ Alex Marinov
Alex Marinov - Konsept Design Limited