IFClite TypeScript API
    Preparing search index...

    Interface PickResult

    Result from GPU picking For multi-model support, includes both expressId and modelIndex

    interface PickResult {
        expressId: number;
        geometryItemId?: number;
        modelIndex?: number;
        worldXYZ?: { x: number; y: number; z: number };
    }
    Index
    expressId: number
    geometryItemId?: number

    The IfcRepresentationItem the picked surface was built from (#2985), so a host can drill from a clicked pane or frame down to its own entity instead of stopping at the owning product. Same name and same value as MeshData.geometryItemId; it is NEVER a material id — materialId carries that case upstream and the two are never both set (#3199).

    The KEY IS ABSENT, never 0, wherever the renderer has no item identity to report, and those absences do not all mean the same thing:

    • the single merged-mesh fallback and a cached IfcMappedItem genuinely have none, mirroring MeshData.geometryItemId itself;
    • a colour-merged batch holds many entities, so whatever item id it carries belongs to none of them individually and is not reported;
    • a GPU-instanced occurrence has none on the GPU route ONLY. The instanced pick shader writes the express id straight into the sample, with no per-instance item channel to look one up from. The CPU raycast never runs that shader, and since #2985 carried the id onto instanced occurrences it DOES report one: Scene.getInstancedMeshDataPieces stamps geometryItemId on each synthetic MeshData it materialises. So the two routes disagree here, and only the shader half is open. Rectangle/marquee pick returns bare express ids and never builds a PickResult at all, so it cannot report this either.
    modelIndex?: number
    worldXYZ?: { x: number; y: number; z: number }

    World-space XYZ of the picked surface point. Optional because the pick path can skip depth readback for callers that only need the entityId (e.g. selection state). Recovered by sampling the pick pass's depth texture at the click position and unprojecting.