Creates a instance of BimIfcLoader class. Responsible for managing a collection of IFC files and loading data from them.
Optional_twinInputResolver: TwinInputResolverOptional_renderControl: GeometryBuilderRenderControlGets all the IFC classes used by IFC products in the currently loaded IFC files.
An array of BimIfcClass objects representing the available classes.
Gets the floors (IfcBuildingStorey) available in the currently loaded IFC files.
An array of BimIfcBuildingStorey objects representing the available floors (storey levels).
Gets the array of BimChangeIfc objects representing the IFC files that are loaded.
An array of BimChangeIfc objects.
Gets the count of IFC products with geometry.
The number of IFC products with geometry.
Gets the IBimIfcLoaderElement for the loaded IFC files.
An array of IBimIfcLoaderElement objects.
Gets the IfcProject root nodes from each loaded IFC file.
An array of BimIfcObject representing the projects.
These can then be used to traverse the IFC file structure by calling BimIfcObject.foreach, or BimIfcObject.entries on each project.
Get the bounding info for loaded IFC files based on the most populated regions of each IFC file, excluding outliers and anomalous regions.
The bounding info is derived from the regions with the highest IFC product count in each IFC file. Regions distant from the majority are excluded.
The regionBoundingInfo is critical for camera positioning to ensure the entire regionBoundingInfo is within the camera's frustum.
Overly large regionBoundingInfo can result in the camera being too distant, causing visibility issues.
This can occur if anomalies are undetectable, e.g., when 50% of regions are proximate while the remaining 50% are outliers but also proximate to each other.
This is common when IFC files are modeled in different coordinate systems, leading to disparate global positions for files intended to be co-located.
There have been cases where IFC files, that should been co-located, are actually
located in widely different places on the globe.
Whenever add is called (before clear) this property is updated.
Gets the spaces (IfcSpace) available in the currently loaded IFC files..
An array of BimIfcSpace objects.
Calculates the min and max coordinate of the axis-aligned bounding box (AABB)
encompassing a collection of BimIfcObject's.
The AABB is defined by the minimum and maximum coordinates in each axis.
The result is written to the provided min and max vectors.
The minimum coordinates of the AABB will be stored in this vector.
The maximum coordinates of the AABB will be stored in this vector.
The collection of BimIfcObject to calculate the AABB for.
The predicate function to filter the BimIfcObject. Defaults to DefaultBimIfcObjectForEachPredicate.
Adds the specified IFC files or twins to the loader.
An array of IfcAddInput (either IfcWithOptions or TwinInput).
A promise that resolves to an array of IBimIfcLoaderElement or failure instances. Use isFailure to check if a returned instance is a failure or not. Its not required to check for failures but it can be useful to know why a file failed to load.
When files are added, the loader will load the IFC files and create IBimIfcLoaderElement instances for each file. See loaderElements for the created instances. To read the IFC products, present the loaded files, use foreach or products.
Twin inputs (TwinInput) are resolved into IfcWithOptions via the configured TwinInputResolver.
Adds or retrieves the cached set of BimIfcObject instances based on the provided key and predicate. Cache is cleared when clear is called.
The type of BimIfcObject to be stored in the cache.
The key used to identify the cache entry.
The predicate function used to filter BimIfcObject instances. If it returns truthy then object is added to cache. Otherwise not
The cached set of BimIfcObject instances.
Clears the state of the BimIfcLoader instance. If geometryBuilder has been called, and if it has been used to create Geometry3d instances that have been added to TwinfinityViewer then those instances are NOT removed from the viewer. Call BimCoreApi.clear to remove all geometry from the viewer as well.
Deletes a cache created by addOrGetIfcProductCache-
Cache to delete
true if a cache was deleted, otherwise false.
Iterate all IFC objects with a callback. Its also possible to call products to get an iterator.
Visitor callback. Called for every IFC object.
Creates an IfcGeometryBuilder containing the BimIfcObject instances matched by the provided predicate. If no predicate is provided, all objects will be included.
Optionaloptions: GeometryBuilderOptions | ((ifcProduct: BimIfcObject) => unknown)Optional predicate function to filter the objects.
A promise that resolves to an instance of IfcGeometryBuilder.
The IfcGeometryBuilder can be used to create Geometry3d instances for the matched objects. In order to visualize them use TwinfinityViewer.addOrReplaceMesh.
Calculate the bounding info for the currently loaded IFC files based on the most populated regions of each IFC file, excluding outliers and anomalous regions.
Indicates whether to include only the most populated regions.
Indicates whether to use world space coordinates. Default is true
The bounding information for the regions.
The bounding info is derived from the regions with the highest IFC product count in each IFC file. Regions distant from the majority are excluded.
The regionBoundingInfo is critical for camera positioning to ensure the entire regionBoundingInfo is within the camera's frustum.
Overly large regionBoundingInfo can result in the camera being too distant, causing visibility issues.
This can occur if anomalies are undetectable, e.g., when 50% of regions are proximate while the remaining 50% are outliers but also proximate to each other.
This is common when IFC files are modeled in different coordinate systems, leading to disparate global positions for files intended to be co-located.
There have been cases where IFC files, that should been co-located, are actually
located in widely different places on the globe.
Loads the property sets for currently loaded IFC files add. If property sets are already loaded then this method does nothing.
A promise that resolves when all property sets have been loaded.
Gets a iterator for all Ifc products currently loaded.
Represents a BIM IFC Loader. Responsible for managing a collection of IFC files and loading data from them.