@twinfinity/core
    Preparing search index...

    Interface BimProductMesh

    An IFC product mesh that has been assigned to a merge group and is ready for rendering. Extends BimProductMeshPreMerge with merge identity and culling properties.

    interface BimProductMesh {
        centerOfParentIfcCube?: DeepImmutableObject<Vector3>;
        colorTexturePixelIndex: number;
        cullingDistance: number;
        depthWriteIgnoresVisibility: boolean;
        descriptor: BimProductMeshDescriptor;
        edges?: FlatSegment3[];
        ghostOutline: boolean;
        highlight: IfcMaterialHighlightIndex;
        ifc: BimChangeIfc;
        ifcProduct: BimIfcObject;
        ignoreClipPlanes: boolean;
        indexCount: number;
        isOnGpu: boolean;
        loaderElement: IBimIfcLoaderElement;
        mergeId: string;
        mi: number;
        outline: boolean;
        r: number;
        si: number;
        style: BimIfcStyle;
        vertexCount: number;
        vertexData: BimVertexData;
        visible: boolean;
        wt: number;
        aabb(min: Vector3, max: Vector3, noCache?: boolean): void;
        boundingInfo(bI?: BoundingInfo, noCache?: boolean): BoundingInfo;
        copyColorTo(dst: Writeable<ArrayLike<number>>, dstOffset?: number): void;
        defaultColor(): boolean;
        fastTransform(noCache?: boolean): FastTransform;
        getColorComponent(colorComponent: RgbaComponent): number;
        getEdges(): Promise<FlatSegment3[]>;
        getVertexData(): Promise<BimVertexData>;
        mesh(noCache?: boolean): BimIfcMesh;
        setColor(color: ArrayLike<number>): boolean;
        transform(noCache?: boolean): Matrix;
    }

    Hierarchy (View Summary)

    Index

    Properties

    centerOfParentIfcCube?: DeepImmutableObject<Vector3>

    Center of the cube, this mesh will be a part of, in IFC space (not worldspace)

    colorTexturePixelIndex: number

    Unique index of mesh. Not persistent and not globally unique like a GUID.

    cullingDistance: number

    Determine at what distance from the camera this mesh should be hidden. If < 0 then mesh is never hidden. If >= 0 then mesh is hidden when distance to camera is greater than this value.

    depthWriteIgnoresVisibility: boolean

    If true then mesh is written to the depth buffer even if it is not visible

    Mesh descriptor

    edges?: FlatSegment3[]

    Cached feature edges in world space, populated by getEdges.

    ghostOutline: boolean

    Enable/disable the 'ghost outline'. Alias for setting visible =false and depthWriteIgnoresVisibility = true. Requires that lineshading is enabled. Otherwise the object will simply not be visible.

    Set the different highlight indexes (or indices, both plurals are fine) of the product mesh. If any index but Empty is set then the product mesh will be colored to the corresponding highlight color. You can change the colors of the highlights by calling the API method

    Parent IFC mesh belongs to.

    ifcProduct: BimIfcObject

    Parent BimIfcObject the mesh belongs to.

    ignoreClipPlanes: boolean

    If set to true, this mesh will ignore clip plane culling, if not it will behave normally (it will be culled by clip planes)

    indexCount: number

    Number of indices in the mesh. Number of triangles can be calculated as indexCount / 3.

    isOnGpu: boolean

    If true then the mesh has been transferred to the gpu, otherwise false.

    loaderElement: IBimIfcLoaderElement

    Parent loader element.

    mergeId: string

    Determine which babylonjs mesh this ifc product mesh shall belong to.

    mi: number
    outline: boolean

    If true then mesh is displayed with an outline, otherwise false. For the outline to actually show, the postprocess effect for outlines needs to be created, which is created by calling createOutlinePipeline from PostProcessEffects

    So for example you could do like this:

    ```typescript`

    for (let product of this._api.ifc.products()) { for (let productMesh of product.productMeshes) { if (Math.random() > 0.95) { productMesh.outline = true; } } }

    api.camera.attachBehavior(PostProcessEffects.createOutlinePipeline(true)); `` Note that like any other post process, the order you attach them to the camera is the same order the post processes are rendered

    r: number
    si: number

    Ifc style used by mesh

    vertexCount: number

    Number of vertices in the mesh.

    vertexData: BimVertexData

    Vertex data.

    visible: boolean

    If true then mesh is visible, otherwise false.

    wt: number

    Methods

    • Calculate aabb min and max value of mesh.

      Parameters

      • min: Vector3

        minimum bounding vector3.

      • max: Vector3

        maximum bounding vector3

      • OptionalnoCache: boolean

        Whether to clear the transform cache after calculation or not. Set to false when calculating aabb for many meshes at the same time for better performance. Set to true for last mesh to ensure that the cache is cleared. Defaults to true.

      Returns void

    • Calculate aabb BoundingInfo of the mesh.

      Parameters

      • OptionalbI: BoundingInfo

        Optional BoundingInfo if specified it will be 'extended' with the aabb of this mesh. Makes it simple to calculate a compound aabb for many meshes. Simply use the BoundingInfo from the first call to boundingInfo in all the subsequent calls to boundingInfo the other meshes. The end result will be a compound BoundingInfo for all the meshes.

      • OptionalnoCache: boolean

        Whether to clear the transform cache after calculation or not. Set to false when calculating aabb for many meshes at the same time for better performance. Set to true for last mesh to ensure that the cache is cleared. Defaults to true.

      Returns BoundingInfo

      BoundingInfo representing the aabb. If bI was specifie as argument then that instance is returned.

    • Copy the RGBA color of the mesh into dst. Each component is 0..255. Must be at least 4 elements.

      Parameters

      • dst: Writeable<ArrayLike<number>>

        Buffer to write color to. Must have length in multiples of 4.

      • OptionaldstOffset: number

        Offset in dst. Must be specified in multiples of 4. Do not set so writes to dst end up outside length of dst.

      Returns void

    • Resets back to the default color of the mesh.

      Returns boolean

      true if colors changes needed to be made.

    • Lazy-load edges for this mesh. On first call, extracts unique edges from vertex data and caches the result. Subsequent calls return the cached edges immediately.

      Edges are returned in world space as FlatSegment3 tuples — the format consumed directly by CreateGreasedLine.

      Returns Promise<FlatSegment3[]>

    • Set mesh color.

      Parameters

      • color: ArrayLike<number>

        RGBA color. Each component is 0..255.

      Returns boolean

      true if color was changed. Otherwise false.

    • Calculate Matrix transform for mesh. Gives same wordlspace transform as fastTransform but can be used with methods that do not accept FastTransform.

      Parameters

      • OptionalnoCache: boolean

        Whether to clear the transform cache after calculation or not. Set to false when calculating matrix transform for many meshes at the same time for better performance. Set to true for last mesh to ensure that the cache is cleared. or call BimTransformsRepository.clear on loaderElement afterwards. Defaults to true.

      Returns Matrix