IFClite TypeScript API
    Preparing search index...

    Build the query string shared by the parse endpoints.

    Index
    • 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).

      Parameters

      • cacheKey: string

        The cache key from the geometry parse response

      • Optionaloptions:
            | number
            | Pick<ParseRequestOptions, "dataModelEntities"> & { maxRetries?: number }

        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.

      Returns Promise<ArrayBuffer | null>

      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.

      Parameters

      • cacheKey: string

        The cache_key from a parse response

      • OptionalmaxRetries: number

        Maximum number of retries (default: 10)

      Returns Promise<SymbolicData | null>

      Decoded symbol data, or null if unavailable after retries

      const result = await client.parseParquet(file);
      const symbols = await client.fetchSymbolic(result.cache_key);
      if (symbols) {
      console.log(`${symbols.grid_axes.length} grid axes, ${symbols.texts.length} labels`);
      }
    • Retrieve a cached parse result by key.

      Parameters

      • key: string

        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.

      Returns Promise<ParseResponse | null>

      Cached parse result, or null if the server has not cached one

      BAD_REQUEST when key is not a request cache key

      // Store the cache key from a previous parse
      const result = await client.parse(file);
      const cacheKey = result.cache_key;

      // Later, retrieve from cache
      const cached = await client.getCached(cacheKey);
      if (cached) {
      console.log('Loaded from cache!');
      }
    • 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.

      Parameters

      • file: ArrayBuffer | File

        File or ArrayBuffer containing IFC data

      Returns Promise<MetadataResponse>

      Metadata about the file

      const meta = await client.getMetadata(file);
      console.log(`${meta.entity_count} entities, ${meta.geometry_count} with geometry`);
      console.log(`Schema: ${meta.schema_version}`);
    • Check if Parquet parsing is available.

      Returns Promise<boolean>

      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.

      Parameters

      • file: ArrayBuffer | File

        File or ArrayBuffer containing IFC data

      • Optionaloptions: ParseRequestOptions

      Returns Promise<ParseResponse>

      Parse result with all meshes

      const result = await client.parse(file);
      for (const mesh of result.meshes) {
      scene.add(createMesh(mesh.positions, mesh.indices, mesh.color));
      }
    • 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.

      Parameters

      • file: ArrayBuffer | File

        File or ArrayBuffer containing IFC data

      • Optionaloptions: ParseRequestOptions

      Returns Promise<ParquetParseResponse>

      Parse result with all meshes (decoded from Parquet)

      const result = await client.parseParquet(file);
      console.log(`Payload: ${result.parquet_stats.payload_size} bytes`);
      console.log(`Decode time: ${result.parquet_stats.decode_time_ms}ms`);
      for (const mesh of result.meshes) {
      scene.add(createMesh(mesh.positions, mesh.indices, mesh.color));
      }
    • Parse IFC file using the ara3d BOS-optimized Parquet format.

      This is the most efficient transfer format, providing:

      • ~50x smaller payloads compared to JSON
      • Integer quantized vertices (0.1mm precision)
      • Mesh deduplication (instancing)
      • Byte colors instead of floats
      • Optional normals (computed on client if not included)

      Requirements: Requires parquet-wasm and apache-arrow.

      Parameters

      • file: ArrayBuffer | File

        File or ArrayBuffer containing IFC data

      • Optionaloptions: ParseRequestOptions

      Returns Promise<OptimizedParquetParseResponse>

      Parse result with all meshes (decoded from optimized Parquet)

      const result = await client.parseParquetOptimized(file);
      console.log(`Unique meshes: ${result.optimization_stats.unique_meshes}`);
      console.log(`Mesh reuse ratio: ${result.optimization_stats.mesh_reuse_ratio}x`);
      console.log(`Payload: ${result.parquet_stats.payload_size} bytes`);
    • 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.

      Parameters

      • file: ArrayBuffer | File

        IFC file to parse (File or ArrayBuffer)

      • onBatch: (batch: ParquetBatch) => void

        Callback for each geometry batch (for immediate rendering)

      • Optionaloptions: ParseStreamOptions

      Returns Promise<ParquetStreamResult>

      Final 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.

      Parameters

      • file: ArrayBuffer | File

        File or ArrayBuffer containing IFC data

      • Optionaloptions: ParseRequestOptions

      Returns AsyncGenerator<StreamEvent>

      Stream events (start, progress, batch, complete, error)

      If 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;
      }
      }