IFClite TypeScript API
    Preparing search index...

    Class IfcCreator

    PLACEMENT CONTRACT

    Every addIfcXxx(storeyId, …) / addElement(storeyId, …) method takes the storey as its first argument and emits an IfcRelContainedInSpatialStructure putting the product in that storey. The product's IfcLocalPlacement is therefore chained to the STOREY's placement, never to the world: the placement hierarchy has to agree with the containment hierarchy, or moving a storey leaves its own contents behind.

    Consequence for callers: coordinates passed to these methods are storey-relative. IfcBuildingStorey.Elevation is applied exactly once, by the storey's own placement ([0, 0, Elevation], the only placement in this class that is chained to the world). A wall whose floor sits on a storey at Elevation: 3 is created with Z = 0, not Z = 3.

    Before 2.0.0 only addIfcWall, addIfcSlab, addIfcColumn, addIfcBeam, addIfcStair, addIfcRoof and addIfcGableRoof behaved this way; the other 21 constructors chained to the world, so a caller mixing them on a storey with a non-zero elevation got two different datums in one model.

    Index
    • Create an arbitrary closed profile from a polyline. Points are auto-closed.

      Parameters

      Returns number

    • Create ANY IFC element type extruded along an axis (Start → End).

      The profile is placed at Start and extruded along the direction to End. The extrusion length equals the distance between Start and End.

      // Pipe segment along an axis
      creator.addAxisElement(storeyId, {
      IfcType: 'IFCPIPESEGMENT',
      Start: [0, 0, 3],
      End: [5, 0, 3],
      Profile: { ProfileType: 'AREA', Radius: 0.05 },
      Name: 'Pipe-001',
      });

      // Cable tray with rectangle profile
      creator.addAxisElement(storeyId, {
      IfcType: 'IFCCABLETRAYSEGMENT',
      Start: [0, 0, 2.5],
      End: [10, 0, 2.5],
      Profile: { ProfileType: 'AREA', XDim: 0.3, YDim: 0.1 },
      });

      Parameters

      Returns number

    • Create a hollow circle profile (pipe section).

      Parameters

      • radius: number
      • wallThickness: number

      Returns number

    • Create a circle profile.

      Parameters

      • radius: number

      Returns number

    • Create a C-shape (cold-formed channel) profile.

      Parameters

      • depth: number
      • width: number
      • wallThickness: number
      • girth: number

      Returns number

    • Create a direction entity. Returns the direction ID.

      Parameters

      Returns number

    • Create ANY IFC element type with an extruded profile at a placement.

      This is the low-level foundation that all high-level methods (addIfcWall, addIfcBeam, etc.) are built on. Use it when you need an IFC type that doesn't have a dedicated method, or when you need full control.

      // Pipe segment with circular profile
      creator.addElement(storeyId, {
      IfcType: 'IFCFLOWSEGMENT',
      Placement: { Location: [0, 0, 3] },
      Profile: { ProfileType: 'AREA', Radius: 0.05 },
      Depth: 5,
      PredefinedType: '.RIGIDSEGMENT.',
      Name: 'Pipe-001',
      });

      // Distribution element with L-profile
      creator.addElement(storeyId, {
      IfcType: 'IFCDISTRIBUTIONELEMENT',
      Placement: { Location: [2, 0, 0], Axis: [0, 0, 1], RefDirection: [1, 0, 0] },
      Profile: { ProfileType: 'AREA', Depth: 0.1, Width: 0.1, Thickness: 0.01 },
      Depth: 3,
      });

      Parameters

      Returns number

    • Create an extruded area solid from a profile.

      Parameters

      • profileId: number

        ID returned by any addXxxProfile() method

      • depth: number

        Extrusion depth

      • OptionalextrusionDir: number

        Optional direction ID (default: Z-up)

      • OptionalpositionId: number

        Optional local solid placement (default: origin, world axes)

      Returns number

    • Create a beam from Start to End. Cross-section (Width × Height) centered on the beam axis.

      Parameters

      Returns number

    • Create a proxy element (generic element for custom/unclassified objects).

      Parameters

      Returns number

    • Add a building storey. Returns the storey expressId for use with element creation.

      Parameters

      Returns number

    • Create a column with circular cross-section.

      Parameters

      Returns number

    • Create a column. Position is the base center. Cross-section centered, extruded upward by Height.

      Parameters

      Returns number

    • Build a column WITHOUT validating dimensions.

      IfcExtrudedAreaSolid.Depth is typed IfcPositiveLengthMeasure in the IFC schema, so a zero (or negative) Height is spec-invalid — exactly what addIfcColumn's guard exists to reject for ordinary callers.

      Corruption-injection tooling (tools/world-gym's degenerate-geometry defect) needs the opposite: it deliberately builds a spec-invalid, zero-height column to verify the geometry pipeline drops it (no mesh emitted) instead of crashing, and that requires a path that produces exactly the malformed entity it asks for. Routing that through the validated public constructor would make it impossible to construct the fixture it exists to test. This method is that deliberately-unvalidated seam — for adversarial test fixtures ONLY, never for application code.

      Parameters

      Returns number

    • Create an IfcCostItem (IFC4 / IFC4X3 only). Returns its expressId.

      Parameters

      Returns number

    • Create an IfcCostValue (IFC4 / IFC4X3 only). Returns its expressId.

      Parameters

      Returns number

    • Create a curtain wall. Thin panel from Start to End, extruded by Height.

      Parameters

      Returns number

    • Create a door element. Width × Height × Thickness panel.

      Parameters

      Returns number

    • Attach element quantities to an element

      Parameters

      Returns number

    • Create a footing (foundation). Position is top centre, Height extends downward.

      Parameters

      Returns number

    • Create a furnishing element (furniture/equipment bounding box).

      Parameters

      Returns number

    • Create a standard dual-pitch gable roof from a rectangular footprint. The ridge runs along the longer footprint dimension to keep the roof height reasonable.

      Parameters

      Returns number

    • Create a column or pile with hollow circular cross-section.

      Parameters

      • storeyId: number
      • params: { Height: number; Position: Point3D; Radius: number; WallThickness: number } & ElementAttributes

      Returns number

    • Create a beam with I-shape (wide-flange/H-shape) cross-section.

      Parameters

      • storeyId: number
      • params: {
            End: Point3D;
            FilletRadius?: number;
            FlangeThickness: number;
            OverallDepth: number;
            OverallWidth: number;
            Start: Point3D;
            WebThickness: number;
        } & ElementAttributes

      Returns number

    • Create a member with L-shape (angle) cross-section.

      Parameters

      • storeyId: number
      • params: {
            Depth: number;
            End: Point3D;
            FilletRadius?: number;
            Start: Point3D;
            Thickness: number;
            Width: number;
        } & ElementAttributes

      Returns number

    • Assign an IFC material to an element. Creates proper IfcMaterial entities and links them via IfcRelAssociatesMaterial during finalization.

      Simple material: { Name: 'Concrete', Category: 'Structural' } Layered material: { Name: 'Wall Assembly', Layers: [{ Name: 'Concrete', Thickness: 0.2 }, …] }

      Parameters

      Returns void

    • Create an IfcMeasureWithUnit — what a UnitBasis or entity-valued AppliedValue points at.

      Parameters

      Returns number

    • Create a structural member (brace, strut, etc.) from Start to End.

      Parameters

      Returns number

    • Create an IfcMonetaryUnit for currency. No default — omit it to leave the currency unstated.

      Parameters

      • currency: string

      Returns number

    • Create a standalone IfcPhysicalSimpleQuantity for IfcCostItem.CostQuantities.

      Parameters

      Returns number

    • Create a pile (deep foundation). Position is top, Length extends downward. Uses circular cross-section by default, rectangular if IsRectangular is set.

      Parameters

      Returns number

    • Create a plate (thin flat element, e.g. steel plate).

      Parameters

      Returns number

    • Attach a property set to an element

      Parameters

      Returns number

    • Create a railing from Start to End with given Height.

      Parameters

      Returns number

    • Create a ramp. Position is the low end. Width along +Y, Length along +X, Rise optionally inclines the ramp.

      Parameters

      Returns number

    • Create a beam/column with hollow rectangular (tube) cross-section.

      Parameters

      • storeyId: number
      • params: {
            End: Point3D;
            InnerFilletRadius?: number;
            OuterFilletRadius?: number;
            Start: Point3D;
            WallThickness: number;
            XDim: number;
            YDim: number;
        } & ElementAttributes

      Returns number

    • Emit an IfcRelAssignsToControl — binds any IfcObjectDefinition (typically IfcTasks or sub-schedules) to an IfcControl (IfcWorkSchedule / IfcWorkPlan). Returns the relationship expressId.

      Parameters

      • relatingControlId: number
      • relatedObjectIds: number[]

      Returns number

    • Emit an IfcRelAssignsToProcess — binds products (walls, slabs, ...) to an IfcProcess (usually an IfcTask). These drive the Gantt 4D animation. Returns the relationship expressId.

      Parameters

      • relatingProcessId: number
      • relatedObjectIds: number[]

      Returns number

    • Emit an IfcRelAssignsToProduct — see emitRelAssignsToProduct for the direction rule.

      Parameters

      • relatingProductId: number
      • relatedObjectIds: number[]

      Returns number

    • Emit an IfcRelNests — nests children under a parent object (used for WBS task hierarchies here). Returns the relationship expressId.

      Parameters

      • relatingObjectId: number
      • relatedObjectIds: number[]

      Returns number

    • Create an IfcRelSequence between two tasks. The predecessor is RelatingProcess and the successor is RelatedProcess. SequenceType defaults to FINISH_START.

      Parameters

      Returns number

    • Create a flat or mono-pitch roof slab. Position is the minimum corner. Width along +X, Depth along +Y, Thickness extruded normal to the slab. Optional Slope is in radians and creates a single slope along +X.

      Parameters

      Returns number

    • Create an IfcSIUnit, for use as an IfcMeasureWithUnit or quantity unit.

      Parameters

      Returns number

    • Create a slab. Position is the minimum corner. Width along +X, Depth along +Y, Thickness extruded along +Z.

      Parameters

      Returns number

    • Create a space (room volume).

      Parameters

      Returns number

    • Create a straight-run stair. Position is the nose of the first tread. Treads advance along local +X (rotated into world space by Direction). Width extends along local +Y.

      Parameters

      Returns number

    • Create an IfcTask. If any Schedule/Actual/Early/Late time field, IsCritical, or Completion attribute is present, an IfcTaskTime is created and linked. Returns the task expressId.

      Parameters

      Returns number

    • Create a member with T-shape cross-section.

      Parameters

      • storeyId: number
      • params: {
            Depth: number;
            End: Point3D;
            FilletRadius?: number;
            FlangeThickness: number;
            FlangeWidth: number;
            Start: Point3D;
            WebThickness: number;
        } & ElementAttributes

      Returns number

    • Create a member with U-shape (channel) cross-section.

      Parameters

      • storeyId: number
      • params: {
            Depth: number;
            End: Point3D;
            FilletRadius?: number;
            FlangeThickness: number;
            FlangeWidth: number;
            Start: Point3D;
            WebThickness: number;
        } & ElementAttributes

      Returns number

    • Create a wall from Start to End with given Thickness and Height.

      Geometry: placement at Start. Profile offset so the solid extends exactly from Start to End, centered on the thickness axis. Extruded upward by Height.

      Parameters

      Returns number

    • Create a door hosted in a wall opening and aligned to the host wall. Position is wall-local: [distance_along_wall, 0, base_height].

      Parameters

      Returns number

    • Create a window hosted in a wall opening and aligned to the host wall. Position is wall-local: [distance_along_wall, 0, sill_height].

      Parameters

      Returns number

    • Create a window element. Width × Height × Thickness frame.

      Parameters

      Returns number

    • Create an IfcWorkCalendar — the working / non-working time calendar an IfcTask or IfcWorkSchedule can be assigned to. WorkingTimes / ExceptionTimes entries become nested IfcWorkTime entities (with their IfcRecurrencePattern / IfcTimePeriod when the entry carries a recurrence), the same way addIfcTask emits its IfcTaskTime. Assign it with assignCalendarToTasks. Returns the calendar expressId.

      Parameters

      Returns number

    • Create an IfcWorkPlan — a container that groups multiple IfcWorkSchedules. Attach schedules to the plan with assignSchedulesToWorkPlan(planId, scheduleIds).

      Parameters

      Returns number

    • Create an IfcWorkSchedule. Returns its expressId for assigning tasks via assignTasksToWorkSchedule(scheduleId, taskIds).

      Parameters

      Returns number

    • Create an I-shape (wide-flange / H-beam) profile.

      Parameters

      • overallWidth: number
      • overallDepth: number
      • webThickness: number
      • flangeThickness: number
      • OptionalfilletRadius: number

      Returns number

    • Create a local placement relative to the world coordinate system.

      Parameters

      • relativeTo: number

        Parent placement ID (use getWorldPlacementId() for world origin)

      • placement: Placement3D

        Location and optional axis/ref directions

      Returns number

    • Create an L-shape (angle section) profile.

      Parameters

      • depth: number
      • width: number
      • thickness: number
      • OptionalfilletRadius: number

      Returns number

    • Wrap shape representations into a product definition shape.

      Parameters

      • repIds: number[]

      Returns number

    • Create a hollow rectangle (tube section) profile.

      Parameters

      • xDim: number
      • yDim: number
      • wallThickness: number
      • OptionalinnerFilletRadius: number
      • OptionalouterFilletRadius: number

      Returns number

    • Create a rectangle profile.

      Parameters

      • xDim: number

        Width of rectangle

      • yDim: number

        Height of rectangle

      • Optionalcenter: Point2D

        Optional 2D offset for the profile centre. Default [0,0] = centred at origin.

      Returns number

    • Create a shape representation from solid IDs.

      Parameters

      • repType: string

        'Body' or 'Axis'

      • itemIds: number[]

        Array of solid IDs (from addExtrudedAreaSolid, etc.)

      Returns number

    • Create a T-shape (tee section) profile.

      Parameters

      • flangeWidth: number
      • depth: number
      • webThickness: number
      • flangeThickness: number
      • OptionalfilletRadius: number

      Returns number

    • Create a U-shape (channel section) profile.

      Parameters

      • depth: number
      • flangeWidth: number
      • webThickness: number
      • flangeThickness: number
      • OptionalfilletRadius: number

      Returns number

    • Ergonomic alias — assign an IfcWorkCalendar to tasks (or work schedules; same relation either way). Delegates to addIfcRelAssignsToControl, which accepts a calendar because IfcWorkCalendar is an IfcControl.

      Parameters

      • calendarId: number
      • taskIds: number[]

      Returns number

    • Parameters

      • productId: number
      • costItemIds: number[]

      Returns number

    • Parameters

      • scheduleId: number
      • costItemIds: number[]

      Returns number

    • Ergonomic alias — delegates to addIfcRelAssignsToProcess.

      Parameters

      • taskId: number
      • productIds: number[]

      Returns number

    • Ergonomic alias — attach sub-schedules to an IfcWorkPlan. Delegates to addIfcRelAssignsToControl.

      Parameters

      • planId: number
      • scheduleIds: number[]

      Returns number

    • Parameters

      • costItemId: number
      • taskIds: number[]

      Returns number

    • Ergonomic alias — assign tasks (or sub-schedules) to a work schedule. Delegates to addIfcRelAssignsToControl.

      Parameters

      • scheduleId: number
      • taskIds: number[]

      Returns number

    • Create a profile from a ProfileDef union type. This is the high-level entry point for profile creation — it dispatches to the appropriate addXxxProfile() method based on the shape.

      const profileId = creator.createProfile({
      ProfileType: 'AREA',
      Radius: 0.15,
      }); // Creates a circle profile

      Parameters

      Returns number

    • Get the world placement ID (use as relativeTo for addLocalPlacement).

      Returns number

    • Parameters

      • parentCostItemId: number
      • childCostItemIds: number[]

      Returns number

    • Ergonomic alias — delegates to addIfcRelNests.

      Parameters

      • parentTaskId: number
      • childTaskIds: number[]

      Returns number

    • Assign a named colour to an element. Call before toIfc(). Elements without a custom colour get the default grey.

      Parameters

      • elementId: number

        The expressId returned by addWall/addSlab/…

      • name: string

        Material name shown in IFC viewers (e.g. 'Concrete')

      • rgb: [number, number, number]

        [r, g, b] each 0‒1

      Returns void

    • The terrain/survey authoring surface: TIN surfaces, survey points, their property sets and the file's georeferencing.

      One accessor rather than four methods: each needs the same creator internals and nothing else. ifc-creator-terrain.ts documents each call.

      Returns TerrainWriter