@twinfinity/core
    Preparing search index...

    Class IfcGeometryBuilder

    Represents a builder for creating geometries from IFC product meshes.

    Index

    Properties

    geometryBuildId: number

    The ID of the geometry build.

    loaderElements: IBimIfcLoaderElement[]

    The loader elements to build geometries from.

    Options to control for how long the geometry builder behavior.

    Accessors

    • get geometryCount(): number

      The number of geometries that will be built when build is called.

      Returns number

      The number of geometries.

    • get ifcProductMeshCount(): number

      The number of IFC product meshes this builder will build geometries for.

      Returns number

      The number of meshes.

    • get indiceCount(): number

      Gets the number of indices in the geometry. The number of triangles in the geometry is this number divided by 3.

      Returns number

      The total number of indices.

    Methods

    • Creates an instance of IfcGeometryBuilder.

      Parameters

      Returns Promise<IfcGeometryBuilder>

      A promise that resolves to an instance of IfcGeometryBuilder.

      The create method will traverse all BimProduct instances provided by o.loaderElements.entries(). Each BimProduct that has geometry, not all products do, has N BimProductMesh instances. The create method will visit each such instance and assign a mergeId to each of them. This mergeId will be identical for BimProductMesh instances that shall be merged into the same Geometry3d instance when build is called. BimProductMesh instances that alredy have a mergeId will be ignored as it is assumed that has already been processed by another IfcGeometryBuilder instance. It is also possible to ignore certain BimProduct instances by providing a predicate function in o.predicate. This will allow the caller to filter out products that should not be included in the geometry creation. For example, one might want to only include IFC products that are of a certain type or have a certain property set. Specifying a predicate function allows for this.

      When a IfcGeometryBuilder instance has been created, the caller can call build to start the geometry creation process. This is a very CPU intensive process.

      One should always attempt to use as few IfcGeometryBuilder instances, to create Geometry3d instances, as possible. The more Geometry3d instances that we add to TwinfinityViewer, by calling TwinfinityViewer.addOrReplaceMesh, the worse rendering performance we will get. This is because the more geometries we have the more draw calls we will have. The more draw calls we have the worse performance we will get. There is no fixed number of geometries that is the limit. It depends on the hardware and the complexity of the geometries.