Optionalparams: ProjectParamsCreate an arbitrary closed profile from a polyline. Points are auto-closed.
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 },
});
Create a hollow circle profile (pipe section).
Create a circle profile.
Create a C-shape (cold-formed channel) profile.
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,
});
Create an extruded area solid from a profile.
ID returned by any addXxxProfile() method
Extrusion depth
OptionalextrusionDir: number
Optional direction ID (default: Z-up)
OptionalpositionId: number
Optional local solid placement (default: origin, world axes)
Create a beam from Start to End. Cross-section (Width × Height) centered on the beam axis.
Create a proxy element (generic element for custom/unclassified objects).
Add a building storey. Returns the storey expressId for use with element creation.
Create a column with circular cross-section.
Create a column. Position is the base center. Cross-section centered, extruded upward by Height.
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.
Create an IfcCostItem (IFC4 / IFC4X3 only). Returns its expressId.
Create an IfcCostSchedule (IFC4 / IFC4X3 only). Returns its expressId.
Create an IfcCostValue (IFC4 / IFC4X3 only). Returns its expressId.
Create a curtain wall. Thin panel from Start to End, extruded by Height.
Create a door element. Width × Height × Thickness panel.
Attach element quantities to an element
Create a footing (foundation). Position is top centre, Height extends downward.
Create a furnishing element (furniture/equipment bounding box).
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.
Create a column or pile with hollow circular cross-section.
Create a beam with I-shape (wide-flange/H-shape) cross-section.
Create a member with L-shape (angle) cross-section.
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 }, …] }
Create an IfcMeasureWithUnit — what a UnitBasis or entity-valued AppliedValue points at.
Create a structural member (brace, strut, etc.) from Start to End.
Create an IfcMonetaryUnit for currency. No default — omit it to leave the currency unstated.
Create a standalone IfcPhysicalSimpleQuantity for IfcCostItem.CostQuantities.
Create a pile (deep foundation). Position is top, Length extends downward. Uses circular cross-section by default, rectangular if IsRectangular is set.
Create a plate (thin flat element, e.g. steel plate).
Attach a property set to an element
Create a railing from Start to End with given Height.
Create a ramp. Position is the low end. Width along +Y, Length along +X, Rise optionally inclines the ramp.
Create a beam/column with hollow rectangular (tube) cross-section.
Emit an IfcRelAssignsToControl — binds any IfcObjectDefinition (typically IfcTasks or sub-schedules) to an IfcControl (IfcWorkSchedule / IfcWorkPlan). Returns the relationship expressId.
Emit an IfcRelAssignsToProcess — binds products (walls, slabs, ...) to an IfcProcess (usually an IfcTask). These drive the Gantt 4D animation. Returns the relationship expressId.
Emit an IfcRelAssignsToProduct — see emitRelAssignsToProduct for the direction rule.
Emit an IfcRelNests — nests children under a parent object (used for WBS task hierarchies here). Returns the relationship expressId.
Create an IfcRelSequence between two tasks. The predecessor is RelatingProcess
and the successor is RelatedProcess. SequenceType defaults to FINISH_START.
Optionalparams: IfcRelSequenceParamsCreate 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.
Create an IfcSIUnit, for use as an IfcMeasureWithUnit or quantity unit.
Create a slab. Position is the minimum corner. Width along +X, Depth along +Y, Thickness extruded along +Z.
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.
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.
Create a member with T-shape cross-section.
Create a member with U-shape (channel) cross-section.
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.
Create a door hosted in a wall opening and aligned to the host wall. Position is wall-local: [distance_along_wall, 0, base_height].
Create a window hosted in a wall opening and aligned to the host wall. Position is wall-local: [distance_along_wall, 0, sill_height].
Create a window element. Width × Height × Thickness frame.
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.
Create an IfcWorkPlan — a container that groups multiple IfcWorkSchedules.
Attach schedules to the plan with assignSchedulesToWorkPlan(planId, scheduleIds).
Create an IfcWorkSchedule. Returns its expressId for assigning tasks
via assignTasksToWorkSchedule(scheduleId, taskIds).
Create an I-shape (wide-flange / H-beam) profile.
OptionalfilletRadius: numberCreate a local placement relative to the world coordinate system.
Parent placement ID (use getWorldPlacementId() for world origin)
Location and optional axis/ref directions
Create an L-shape (angle section) profile.
OptionalfilletRadius: numberWrap shape representations into a product definition shape.
Create a hollow rectangle (tube section) profile.
OptionalinnerFilletRadius: numberOptionalouterFilletRadius: numberCreate a rectangle profile.
Width of rectangle
Height of rectangle
Optionalcenter: Point2D
Optional 2D offset for the profile centre. Default [0,0] = centred at origin.
Create a shape representation from solid IDs.
'Body' or 'Axis'
Array of solid IDs (from addExtrudedAreaSolid, etc.)
Create a T-shape (tee section) profile.
OptionalfilletRadius: numberCreate a U-shape (channel section) profile.
OptionalfilletRadius: numberErgonomic 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.
Ergonomic alias — delegates to addIfcRelAssignsToProcess.
Ergonomic alias — attach sub-schedules to an IfcWorkPlan. Delegates to addIfcRelAssignsToControl.
Ergonomic alias — assign tasks (or sub-schedules) to a work schedule. Delegates to addIfcRelAssignsToControl.
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
Get the world placement ID (use as relativeTo for addLocalPlacement).
Ergonomic alias — delegates to addIfcRelNests.
Assign a named colour to an element. Call before toIfc(). Elements without a custom colour get the default grey.
The expressId returned by addWall/addSlab/…
Material name shown in IFC viewers (e.g. 'Concrete')
[r, g, b] each 0‒1
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.
Generate the complete IFC STEP file. May only be called once.
PLACEMENT CONTRACT
Every
addIfcXxx(storeyId, …)/addElement(storeyId, …)method takes the storey as its first argument and emits anIfcRelContainedInSpatialStructureputting the product in that storey. The product'sIfcLocalPlacementis 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.Elevationis 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 atElevation: 3is created withZ = 0, notZ = 3.Before 2.0.0 only
addIfcWall,addIfcSlab,addIfcColumn,addIfcBeam,addIfcStair,addIfcRoofandaddIfcGableRoofbehaved 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.