@twinfinity/core
    Preparing search index...

    Interface BimProductMesh

    interface BimProductMesh {
        centerOfParentIfcCube?: DeepImmutableObject<Vector3>;
        colorTexturePixelIndex: number;
        cullingDistance: number;
        depthWriteIgnoresVisibility: boolean;
        descriptor: BimProductMeshDescriptor;
        edges?: [Vector3, Vector3][];
        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;
        _clearMergeId(): boolean;
        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<[Vector3, Vector3][]>;
        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
    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?: [Vector3, Vector3][]

    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
    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
    vertexData: BimVertexData

    Vertex data.

    visible: boolean

    If true then mesh is visible, otherwise false.

    wt: number

    Methods

    • Returns boolean

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

    • Get specific color component. Output is in range 0..255.

      Parameters

      Returns number

    • 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 [start, end] pairs.

      Returns Promise<[Vector3, Vector3][]>

    • Gets a BimIfcMesh instance that can be used to do intersection testing and other (computationally expensive) operations.

      Parameters

      • OptionalnoCache: boolean

        Whether to clear the transform cache after BimIfcMesh creation or not. Set to false when creating many BimIfcMesh 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 BimIfcMesh

    • 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