# 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)

- BimProductMeshPreMerge
  - BimProductMesh

##### Index

### Properties

centerOfParentIfcCube?
colorTexturePixelIndex
cullingDistance
depthWriteIgnoresVisibility
descriptor
edges?
ghostOutline
highlight
ifc
ifcProduct
ignoreClipPlanes
indexCount
isOnGpu
loaderElement
mergeId
mi
outline
r
si
style
vertexCount
vertexData
visible
wt

### Methods

aabb
boundingInfo
copyColorTo
defaultColor
fastTransform
getColorComponent
getEdges
getVertexData
mesh
setColor
transform

## Properties

### `Optional` `Readonly` centerOfParentIfcCube

centerOfParentIfcCube?: DeepImmutableObject<Vector3>

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

### `Readonly` colorTexturePixelIndex

colorTexturePixelIndex: number

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

Inherited from BimProductMeshPreMerge.colorTexturePixelIndex

### `Readonly` cullingDistance

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

depthWriteIgnoresVisibility: boolean

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

Inherited from BimProductMeshPreMerge.depthWriteIgnoresVisibility

### `Readonly` descriptor

descriptor: BimProductMeshDescriptor

Mesh descriptor

Inherited from BimProductMeshPreMerge.descriptor

### `Optional` `Readonly` edges

edges?: FlatSegment3[]

Cached feature edges in world space, populated by getEdges.

Inherited from BimProductMeshPreMerge.edges

### ghostOutline

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.

Inherited from BimProductMeshPreMerge.ghostOutline

### highlight

highlight: IfcMaterialHighlightIndex

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

Inherited from BimProductMeshPreMerge.highlight

### `Readonly` ifc

ifc: BimChangeIfc

Parent IFC mesh belongs to.

Inherited from BimProductMeshPreMerge.ifc

### `Readonly` ifcProduct

ifcProduct: BimIfcObject

Parent BimIfcObject the mesh belongs to.

Inherited from BimProductMeshPreMerge.ifcProduct

### ignoreClipPlanes

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)

Inherited from BimProductMeshPreMerge.ignoreClipPlanes

### `Readonly` indexCount

indexCount: number

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

Inherited from BimProductMeshPreMerge.indexCount

### `Readonly` isOnGpu

isOnGpu: boolean

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

Inherited from BimProductMeshPreMerge.isOnGpu

### `Readonly` loaderElement

loaderElement: IBimIfcLoaderElement

Parent loader element.

Inherited from BimProductMeshPreMerge.loaderElement

### `Readonly` mergeId

mergeId: string

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

### `Readonly` mi

mi: number

Inherited from BimProductMeshPreMerge.mi

### outline

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:

#### Example

```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

Inherited from BimProductMeshPreMerge.outline

### `Readonly` r

r: number

Inherited from BimProductMeshPreMerge.r

### `Readonly` si

si: number

Inherited from BimProductMeshPreMerge.si

### `Readonly` style

style: BimIfcStyle

Ifc style used by mesh

Inherited from BimProductMeshPreMerge.style

### `Readonly` vertexCount

vertexCount: number

Number of vertices in the mesh.

Inherited from BimProductMeshPreMerge.vertexCount

### `Readonly` vertexData

vertexData: BimVertexData

Vertex data.

Inherited from BimProductMeshPreMerge.vertexData

### visible

visible: boolean

If `true` then mesh is visible, otherwise `false`.

Inherited from BimProductMeshPreMerge.visible

### `Readonly` wt

wt: number

Inherited from BimProductMeshPreMerge.wt

## Methods

### aabb

- aabb(min: Vector3, max: Vector3, noCache?: boolean): void

  Calculate aabb min and max value of mesh.

  #### Parameters

  - min: Vector3

    minimum bounding vector3.

  - max: Vector3

    maximum bounding vector3

  - `Optional` noCache: 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

  Inherited from BimProductMeshPreMerge.aabb

### boundingInfo

- boundingInfo(bI?: BoundingInfo, noCache?: boolean): BoundingInfo

  Calculate aabb `BoundingInfo` of the mesh.

  #### Parameters

  - `Optional` bI: 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.

  - `Optional` noCache: 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.

  Inherited from BimProductMeshPreMerge.boundingInfo

### copyColorTo

- copyColorTo(dst: Writeable<ArrayLike<number>>, dstOffset?: number): void

  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.

  - `Optional` dstOffset: 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

  Inherited from BimProductMeshPreMerge.copyColorTo

### defaultColor

- defaultColor(): boolean

  Resets back to the default color of the mesh.

  #### Returns boolean

  `true` if colors changes needed to be made.

  Inherited from BimProductMeshPreMerge.defaultColor

### fastTransform

- fastTransform(noCache?: boolean): FastTransform

  Calculate FastTransform for mesh.

  #### Parameters

  - `Optional` noCache: boolean

    Whether to clear the transform cache after calculation or not. Set to `false` when calculating FastTransform 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 FastTransform

  Inherited from BimProductMeshPreMerge.fastTransform

### getColorComponent

- getColorComponent(colorComponent: RgbaComponent): number

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

  #### Parameters

  - colorComponent: RgbaComponent

    Color component.

  #### Returns number

  Inherited from BimProductMeshPreMerge.getColorComponent

### getEdges

- getEdges(): Promise<FlatSegment3[]>

  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[]>

  Inherited from BimProductMeshPreMerge.getEdges

### getVertexData

- getVertexData(): Promise<BimVertexData>

  Asynchronously get the vertex data for this mesh.

  #### Returns Promise<BimVertexData>

  Inherited from BimProductMeshPreMerge.getVertexData

### mesh

- mesh(noCache?: boolean): BimIfcMesh

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

  #### Parameters

  - `Optional` noCache: 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

  Inherited from BimProductMeshPreMerge.mesh

### setColor

- setColor(color: ArrayLike<number>): boolean

  Set mesh color.

  #### Parameters

  - color: ArrayLike<number>

    RGBA color. Each component is `0..255`.

  #### Returns boolean

  `true` if color was changed. Otherwise `false`.

  Inherited from BimProductMeshPreMerge.setColor

### transform

- transform(noCache?: boolean): Matrix

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

  #### Parameters

  - `Optional` noCache: 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

  Inherited from BimProductMeshPreMerge.transform