Create a new IFC server client.
Client configuration
Fetch the data model for a previously parsed file.
The data model is processed in the background after geometry is returned. This method polls until the data model is ready (with exponential backoff).
The cache key from the geometry parse response
Optionaloptions: Maximum number of retries (default: 10), or an options
object with maxRetries and dataModelEntities. Pass the same
dataModelEntities the parse call used (#6034): the full and the
rooted-only data model are separate entries, and each is served only to
a request that names it. The parse call's own options object works here.
Data model Parquet buffer, or null if not available after retries
const geometryResult = await client.parseParquet(file);
// Start rendering geometry immediately...
// Then fetch data model in background
const dataModelBuffer = await client.fetchDataModel(geometryResult.cache_key);
if (dataModelBuffer) {
const dataModel = await decodeDataModel(dataModelBuffer);
}
// Objects only (#6034): same option on the parse and on the fetch.
const options = { dataModelEntities: 'rooted' } as const;
const optimized = await client.parseParquetOptimized(file, options);
const rootedBuffer = await client.fetchDataModel(optimized.cache_key, options);
Fetch the 2D symbol stream (IfcAnnotation + IfcGrid) for a previously
parsed file.
The JSON endpoints (parse, parseStream) and the streaming Parquet path
already deliver symbolic_data inline. This helper is for the binary
Parquet transports (parseParquet, parseParquetOptimized) whose payloads
can't carry it inline — fetch it by the cache_key returned in their
result, mirroring fetchDataModel.
Symbolic data is cached synchronously by the non-streaming endpoints, so this typically returns on the first attempt; the streaming endpoint caches it in the background, hence the bounded retry.
The cache_key from a parse response
OptionalmaxRetries: number
Maximum number of retries (default: 10)
Decoded symbol data, or null if unavailable after retries
Retrieve a cached parse result by key.
The request cache_key a parse returned (result.cache_key):
the file's SHA-256 plus its opening-filter suffix, and a -q{level}
suffix for a non-default tessellation quality. Not the bare hash.
Cached parse result, or null if the server has not cached one
Get quick metadata about an IFC file without processing geometry.
This is much faster than a full parse and is useful for showing file information before processing.
File or ArrayBuffer containing IFC data
Metadata about the file
Check if Parquet parsing is available.
true if parquet-wasm is available for parseParquet()
Parse IFC file and return all geometry.
For large files (>10MB), consider using parseStream() instead
to receive progressive updates.
File or ArrayBuffer containing IFC data
Optionaloptions: ParseRequestOptionsParse result with all meshes
Parse IFC file and return geometry in Parquet format.
This method provides ~15x smaller payload size compared to JSON, which is critical for large IFC files over network connections.
Cache-aware: Computes file hash client-side and checks cache before uploading. If cached, skips upload entirely for much faster response.
Requirements: This method requires parquet-wasm and apache-arrow
to be installed as peer dependencies.
File or ArrayBuffer containing IFC data
Optionaloptions: ParseRequestOptionsParse result with all meshes (decoded from Parquet)
Parse IFC file using the ara3d BOS-optimized Parquet format.
This is the most efficient transfer format, providing:
Requirements: Requires parquet-wasm and apache-arrow.
File or ArrayBuffer containing IFC data
Optionaloptions: ParseRequestOptionsParse result with all meshes (decoded from optimized Parquet)
Parse IFC file with streaming Parquet response for progressive rendering.
Calls onBatch with each geometry batch as it is decoded. Use this for
large files (>50MB) to show geometry progressively.
After streaming completes, fetch the data model via fetchDataModel(cacheKey).
Cache-aware, without paying the upload. The file is hashed locally and
the hash is presented to /parse/parquet-stream on its own, with no body
(issue #3901). A warm server replays the cached stream immediately; a cold
one answers 404 and this method uploads. Either way the SSE events are
read by the same code, so a hit and a miss render identically.
The probe replaced a two-request cache/check + cache/geometry dance
that fetched the whole model as ONE batch on a hit, i.e. no progressive
rendering exactly when the data was already there. Set
skipCacheProbe: true to go straight to the upload.
IFC file to parse (File or ArrayBuffer)
Callback for each geometry batch (for immediate rendering)
Optionaloptions: ParseStreamOptionsFinal result with cache_key, stats, and metadata
const result = await client.parseParquetStream(file, (batch) => {
// Render each batch immediately
for (const mesh of batch.meshes) {
scene.add(createMesh(mesh));
}
});
// After geometry is complete, fetch data model for properties panel
const dataModel = await client.fetchDataModel(result.cache_key);
Parse IFC file with streaming response.
Yields events as geometry is processed, allowing for progressive rendering of large models.
File or ArrayBuffer containing IFC data
Optionaloptions: ParseRequestOptionsIf the stream ends without a complete or error event — a
dropped connection or a server-side failure mid-parse. Breaking out
of the loop early does not trigger this.
for await (const event of client.parseStream(file)) {
switch (event.type) {
case 'start':
console.log(`Processing ~${event.total_estimate} entities`);
break;
case 'progress':
updateProgressBar(event.processed / event.total);
break;
case 'batch':
for (const mesh of event.meshes) {
scene.add(createMesh(mesh));
}
break;
case 'complete':
console.log(`Done in ${event.stats.total_time_ms}ms`);
break;
case 'error':
console.error(event.message);
break;
}
}
Build the query string shared by the parse endpoints.