ReadonlygeometryThe ID of the geometry build.
ReadonlyloaderThe loader elements to build geometries from.
Static ReadonlyoptionsOptions to control for how long the geometry builder behavior.
The number of geometries that will be built when build is called.
The number of geometries.
The number of IFC product meshes this builder will build geometries for.
The number of meshes.
Gets the number of indices in the geometry. The number of triangles in the geometry is this number divided by 3.
The total number of indices.
Builds Geometry3d instance from all BimProduct instances that was included during the call to create. This is a very CPU intensive operation.
The action to be invoked for each built Geometry3d instance. Call TwinfinityViewer.addOrReplaceMesh to add the geometry to the viewer.
The eventData parameter contains both the current Geometry3d instance that was built and information such as the current progress of the build operation.
See GeometryBuilderBuildEventData for more information.
A promise that resolves to an array of Geometry3dHandle objects. These can be used to unload the geometries from TwinfinityViewer by calling TwinfinityViewer.removeMesh.
Only access the Geometry3d instance inside the action callback. The Geometry3d instance, and all data accessable trhoug it,
will be invalid after the action callback has been invoked.
Each Geometry3d instance will contain the geometry from all BimProductMesh instances that share the same mergeId.
StaticcreateCreates an instance of IfcGeometryBuilder.
The options for creating the geometry builder.
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.
Represents a builder for creating geometries from IFC product meshes.