Skip to main content

BimIfcLoader

Represents a BIM IFC Loader. Responsible for managing a collection of IFC files and loading data from them.

Implements

Index

Constructors

publicconstructor

  • Creates a instance of BimIfcLoader class. Responsible for managing a collection of IFC files and loading data from them.


    Parameters

    • _bimApi: BimCoreApiClient
    • _propertySetRepository: BimPropertySetRepository
    • vertexDataRepository: BimVertexDataRepository
    • _materials: Materials

    Returns BimIfcLoader

Properties

publicreadonlyvertexDataRepository

vertexDataRepository: BimVertexDataRepository

Accessors

publicclasses

  • Gets all the IFC classes used by IFC products in the currently loaded IFC files.


    Returns BimIfcClass[]

    An array of BimIfcClass objects representing the available classes.

publicdisciplines

  • Gets the available disciplines.


    Returns Discipline[]

    An array of Discipline objects.

publicfloors

  • Gets the floors (IfcBuildingStorey) available in the currently loaded IFC files.


    Returns BimIfcBuildingStorey[]

    An array of BimIfcBuildingStorey objects representing the available floors (storey levels).

publicifcHttpResources

publicifcProductsWithGeometryCount

  • get ifcProductsWithGeometryCount(): number
  • Gets the count of IFC products with geometry.


    Returns number

    The number of IFC products with geometry.

publicloaderElements

publicprojects

  • Gets the IfcProject root nodes from each loaded IFC file.

    @remarks

    These can then be used to traverse the IFC file structure by calling foreach, or entries on each project.


    Returns BimIfcObject[]

    An array of BimIfcObject representing the projects.

publicregionBoundingInfo

  • get regionBoundingInfo(): BoundingInfo
  • 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.


    Returns BoundingInfo

publicspaces

  • Gets the spaces (IfcSpace) available in the currently loaded IFC files..


    Returns BimIfcSpace[]

    An array of BimIfcSpace objects.

Methods

publicaabb

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


    Parameters

    Returns void

publicadd

publicaddOrGetIfcProductCache

  • Adds or retrieves the cached set of BimIfcObject instances based on the provided key and predicate. Cache is cleared when clear is called.


    Type parameters

    Parameters

    • key: string

      The key used to identify the cache entry.

    • predicate: BimIfcObjectForEachPredicate

      The predicate function used to filter BimIfcObject instances. If it returns truthy then object is added to cache. Otherwise not

    Returns DeepImmutableObject<Set<T>>

    The cached set of BimIfcObject instances.

publicapplyAndResetTrackedVisualChanges

  • applyAndResetTrackedVisualChanges(): undefined | ReadonlySet<BimIfcObject>
  • @deprecated
    • No longer does anything.

    Returns undefined | ReadonlySet<BimIfcObject>

publicapplyColor

  • applyColor(): void
  • @deprecated

    No longer does anything


    Returns void

publicclear

  • clear(): void
  • 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 Twinfinity.clear to remove all geometry from the viewer as well.


    Returns void

publicdeleteIfcProductCache

  • deleteIfcProductCache(key: string): boolean
  • Deletes a cache created by addOrGetIfcProductCache-


    Parameters

    • key: string

      Cache to delete

    Returns boolean

    true if a cache was deleted, otherwise false.

publicforeach

  • Iterate all IFC objects with a callback. Its also possible to call products to get an iterator.


    Parameters

    Returns void

publicgeometryBuilder

publicgetRegionBoundingInfo

  • getRegionBoundingInfo(onlyMostPopulatedRegions: boolean, useWorldSpace?: boolean): BoundingInfo
  • 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.

    @remarks

    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.


    Parameters

    • onlyMostPopulatedRegions: boolean

      Indicates whether to include only the most populated regions.

    • useWorldSpace: boolean = true

      Indicates whether to use world space coordinates. Default is true

    Returns BoundingInfo

    The bounding information for the regions.

publicloadPropertySets

  • loadPropertySets(): Promise<void>
  • Loads the property sets for currently loaded IFC files add. If property sets are already loaded then this method does nothing.


    Returns Promise<void>

    A promise that resolves when all property sets have been loaded.

publicproducts

  • Gets a iterator for all Ifc products currently loaded.


    Returns IterableIterator<BimIfcObject>