Skip to main content

IfcImporter

An objet to convert IFC files into fragments.

Properties​

attributesToExclude​

attributesToExclude: Set<string>

A set of attribute names to exclude from serialization.


classes​

classes: object

Summary​

A map containing sets of IFC classes, categorized into 'elements' and 'abstract'.

Remarks​

The 'elements' category contains a set of IFC classes representing physical elements. The 'abstract' category contains a set of abstract IFC classes, including materials, properties, classifications, etc.

abstract​

abstract: DataSet<number>

elements​

elements: DataSet<number>


distanceThreshold​

distanceThreshold: null | number = 100000

If set, ignores the items that are further away to the origin than this value. Keep in mind that if your IFC is correctly georreferenced, this value should never be too high. If it's too high, it's either because your file uses absolute coordinates, (which is a very bad idea, and usually due to a poor IFC export) or because there are objects that are very, very far away (very unlikely).


doubleSidedMaterials​

doubleSidedMaterials: boolean = false

Whether the generated materials should render both faces (double-sided) instead of just the front face.

Remarks​

Some exporters (e.g. certain Revit pipelines) produce geometry whose winding is not consistent, so front-face-only rendering can hide those faces. Enable this to render both sides. Defaults to false (front-face only) to match the previous behavior.


includeMaterialProperties​

includeMaterialProperties: boolean = false

Whether to import each material's own property sets (IfcMaterialProperties in IFC4, IfcExtendedMaterialProperties in IFC2X3).

Remarks​

Off by default to keep the output lean. These entities link to their material through a direct Material attribute rather than an IfcRel*, so when enabled the importer also synthesizes the inverse HasProperties relation on the material, making the properties reachable as element -> material -> material properties. See issue #249.


includeRelationNames​

includeRelationNames: boolean = false

Whether to include relation names from the imported IFC data.


includeUniqueAttributes​

includeUniqueAttributes: boolean = false

Whether to include unique attributes from the imported IFC data.


relations​

relations: Map<number, object>

Summary​

Defines the relationships between IFC entities.

Description​

This map defines the relationships between IFC entities, specifying the relationship type, and the properties that define the relationship in both directions.

The keys of the map are IFC relationship types (e.g., IFCRELDEFINESBYPROPERTIES). The values are objects that define the properties for relating and related entities.

  • forRelating: The property name on the relating entity.
  • forRelated: The property name on the related entity.

replaceSiteElevation​

replaceSiteElevation: boolean = true

Whether to replace the IfcSite.RefElevation with the absolute site elevation.

Remarks​

The value is calculated taking into consideration the relative positions between entities and it is always given in meters.


replaceStoreyElevation​

replaceStoreyElevation: boolean = true

Whether to replace the IfcBuildingStorey.Elevation with the absolute storey elevation.

Remarks​

The value is calculated taking into consideration the relative positions between entities and it is always given in meters.


wasm​

wasm: object

Configuration for the web-ifc WASM module

absolute​

absolute: boolean = false

path​

path: string = "/node_modules/web-ifc/"

Methods​

addAllAttributes()​

addAllAttributes(): void

Adds all attributes to the classes. Use this with precaution because it can increase the size of the output fragments.

Returns​

void


addAllRelations()​

addAllRelations(): void

Adds all relations to the relations map. Use this with precaution because it can increase the size of the output fragments.

Returns​

void


process()​

process(data): Promise<Uint8Array>

Processes IFC data and converts it into a fragments format.

Parameters​

ParameterTypeDescription
dataProcessDataConfiguration object for processing.

Returns​

Promise<Uint8Array>