IFClite TypeScript API
    Preparing search index...

    Interface GeometryDiagnostics

    Public CSG / opening diagnostics contract for @ifc-lite/geometry. The shape mirrors the Rust GeometryDiagnostics (rust/geometry router::diagnostics), which is built once per geometry batch and serialized to a JS object. The geometry worker merges per-batch values across batches and the parallel loader merges across workers, surfacing one diagnostics object on the streaming complete event. The native ProcessingStats path reuses the same aggregator (wired: rust/processing populates geometry_diagnostics).

    Counts are best-effort observability: totalCsgFailures and the classification counts are exact, while productsWithFailures / hostsWithOpenings / silentNoOps are summed per batch and are therefore upper bounds (a product whose geometry spans batches may be counted more than once).

    interface GeometryDiagnostics {
        classification: {
            diagonal: number;
            nonRectangular: number;
            rectangular: number;
            total: number;
        };
        failuresByReason: { count: number; reason: string }[];
        hostsWithOpenings: number;
        oversizedRefDrops?: number;
        productsWithFailures: number;
        rectFast: {
            deferHostNotBox: number;
            deferNearEdge: number;
            deferNoOpenings: number;
            deferNotThrough: number;
            deferOffFace: number;
            deferTooManyOpenings?: number;
            fired: number;
            openingsCut: number;
        };
        schemaVersion: number;
        silentNoOps: number;
        totalCsgFailures: number;
        totalUnsupportedItems?: number;
        unsupportedItemsByType?: { count: number; reason: string }[];
        worstHosts: {
            bbox?: { max: [number, number, number]; min: [number, number, number] };
            csgFailures: number;
            firstFailureLabel?: string;
            ifcType: string;
            openings: number;
            productId: number;
            triangleCount?: number;
        }[];
    }
    Index
    classification: {
        diagonal: number;
        nonRectangular: number;
        rectangular: number;
        total: number;
    }

    Opening-classifier outcome counts.

    failuresByReason: { count: number; reason: string }[]

    Failure counts by stable reason label, sorted desc by count.

    hostsWithOpenings: number

    Hosts that had openings processed (batch-summed upper bound).

    oversizedRefDrops?: number

    Content-hash references the geometry pass refused because they exceeded u32::MAX (#3421 / #3752). Nonzero means some instancing was skipped, not that geometry is wrong. Optional: absent on payloads from producers predating the counter.

    productsWithFailures: number

    Distinct products with at least one failure (batch-summed upper bound).

    rectFast: {
        deferHostNotBox: number;
        deferNearEdge: number;
        deferNoOpenings: number;
        deferNotThrough: number;
        deferOffFace: number;
        deferTooManyOpenings?: number;
        fired: number;
        openingsCut: number;
    }

    rect_fast fast-path engagement (perf observability).

    Type Declaration

    • deferHostNotBox: number
    • deferNearEdge: number
    • deferNoOpenings: number
    • deferNotThrough: number
    • deferOffFace: number
    • OptionaldeferTooManyOpenings?: number

      Optional: absent on payloads produced before this counter existed (#1649).

    • fired: number
    • openingsCut: number
    schemaVersion: number

    Contract version handshake (mirrors Rust GEOMETRY_DIAGNOSTICS_SCHEMA_VERSION, currently 3 — that constant carries the per-version changelog and is the single source of truth). Bumped on field renames, field removals, and count-semantics changes; also on an additive field whose absence a consumer must tell apart from a real zero, which is why 2 (removed guardSaved) and 3 (added totalUnsupportedItems) both bumped. A purely additive optional field that no consumer gates on does not bump.

    REQUIRED, not optional: the Rust field is a plain u32 serialized unconditionally, so every producer since #1514 writes the key. A value of 0 is what Rust's #[serde(default)] yields when it READS a payload written before #1514, and is the only "pre-versioned producer" signal a consumer sees.

    silentNoOps: number

    Hosts where rectangular cutters ran, the triangle count was unchanged, and NO failure was recorded (cut attempted, geometry not modified) - the highest- signal "looks wrong but did not error" indicator. Hosts that failed are excluded (they are loud failures counted in totalCsgFailures, not silent). Batch-summed upper bound.

    totalCsgFailures: number

    Total CSG boolean failures (un-cut openings, emptied hosts, kernel fallbacks).

    totalUnsupportedItems?: number

    Representation items dropped from the output: no processor is registered for the IFC type, or the registered processor errored (degenerate/failed geometry). Excludes elements with no Body representation at all — those are correctly absent from the 3D view and never counted here. Absent on a payload produced before this counter existed (schemaVersion < 3).

    A lower bound on instances: a drop inside a RepresentationMap source is counted once per walking router, not once per IfcMappedItem occurrence that reuses the cached source. That is once model-wide on the wasm batch path, which uses one router; the native pool builds a router per element, and a source whose items ALL drop is never published to the shared cache (it meshes to nothing), so there it contributes once per owning element. Read it as "these types were dropped", never as a count of affected elements or of distinct sources.

    unsupportedItemsByType?: { count: number; reason: string }[]

    totalUnsupportedItems broken down by IFC type, sorted desc by count.

    worstHosts: {
        bbox?: { max: [number, number, number]; min: [number, number, number] };
        csgFailures: number;
        firstFailureLabel?: string;
        ifcType: string;
        openings: number;
        productId: number;
        triangleCount?: number;
    }[]

    Bounded top-N worst-failing hosts (opt-in per-product detail).

    Type Declaration

    • Optionalbbox?: { max: [number, number, number]; min: [number, number, number] }

      World-space AABB of the host mesh, when a void cut captured it. Mirrors the {min, max} shape used by MeshData.localBounds.

    • csgFailures: number
    • OptionalfirstFailureLabel?: string
    • ifcType: string
    • openings: number
    • productId: number
    • OptionaltriangleCount?: number

      Final triangle count of the host's mesh (post-cut when a void subtraction ran, otherwise the pre-cut count).