Expand description
The export-plan executor: callers speak IFC (objects by express id or
GlobalId, properties by measure type, placements by matrix), and
execute is the one place that lowers a plan into the STEP-level
primitives the rest of this crate already carries
(AttrMutation-shaped edits, CopyOnWriteMutation’s copy-then-repoint
shape, [crate::step_cow]’s id allocator role) plus the parts no STEP
option expresses: occurrence overrides, placement rewrites, body geometry
replacement, and delete with reverse-reference repair.
Disposition::Add builds a new object (placement, geometry,
containment, type, property sets, material, classifications, an opening
in a host) from an IFC-level description; see add.rs.
Disposition::AddType adds a type nothing instances yet.
§Design
Memory follows the plan, not the file. [index::FileIndex::scan] makes
one pass that keeps where each record is and little else; attributes are
parsed on demand, only for records the plan reaches; who refers to a
record is collected by [referrers] only for the records a plan asks
about, in streaming passes over the file that repeat until
[resolve::resolve] completes without asking about anything new
([referrers] explains how many passes that takes, and why).
[write::write_output] then streams the output in file order, validating
each record as it goes. A single [crate::step_ids::IdAllocator], the one
every STEP writer in this crate allocates with, is threaded through every
appender so a plan’s copy-on-write, an occurrence override, and a
synthesized owner history can never land on the same id.
§What this does not do
- It does not convert between IFC2X3/IFC4/IFC4X3 —
crate::schema_convertalready does that, as a separate concern a caller composes with this one. - A property or quantity write never edits a shared record in place. Sharing is judged at the set (how many relationships or types reach it) and at the value (how many sets list it); either one shared means a copy, or a refusal for a set shared between types.
Structs§
- Class
Spec - A class plus the enumeration value for its
PredefinedType, e.g.Some("PARTITIONING")for a wall. The value is written as given (upper-cased); a class whose schema declares noPredefinedType(IFC2X3’sIfcDoor, for one) refuses aSomerather than dropping it. - Dropped
Representation - A representation a
GeometryPatchtook off a product that was not its body: anAxis,Box,FootPrintor other representation of the old shape, which no longer describes the product once its body is replaced. - Export
Plan - The whole request: what happens to which objects, and the header provenance to stamp the output with.
- Exporting
Application - Who an export attributes its changes to, per the buildingSMART
IfcChangeActionEnumguidance: an object the exporting application adds isADDEDwith that application as itsOwningApplication; an object it modifies keeps its original owner and creation date, and getsMODIFIED, aLastModifiedDate, and the exporting user and application asLastModifyingUserandLastModifyingApplication. - Exporting
Person - The person on whose behalf the exporting application makes its changes.
- Extrusion
- A closed polygon profile swept along
directionfordepth. The profile lies in the object’s local XY plane; repeating the first point of a loop at the end is allowed but not required. - Geometry
Patch - Replace a product’s body geometry with
mesh. - Global
Id - The 128 bits of an
IfcGloballyUniqueId, supplied by the caller so the executor never has to invent an identity (no clock, no RNG: the output of a plan is a pure function of the plan and the source). - MapConversion
- An
IfcMapConversionto anIfcProjectedCRS: how the project’s engineering frame (metres) maps to map coordinates. - Mapped
Body - How an object places its type’s mapped representation:
transform(row-major, file length units) takes the map’s coordinates into the object’s local frame. A rotation and a translation, no scale. Identity puts the type’s geometry at the object’s placement, which is where most files keep it. - NewClassification
- A new
IfcClassification. IFC2X3 requiressourceandedition, and refuses a classification without them. - NewClassification
Reference - A new
IfcClassificationReferenceintosystem.identificationis written as IFC2X3’sItemReference. - NewLayer
Set - A new
IfcMaterialLayerSet, layers in the order given. - NewMaterial
- A new
IfcMaterial.categoryis IFC4 and later only; an IFC2X3 file refuses it rather than dropping it. - NewMaterial
Layer - One layer of a new
IfcMaterialLayerSet.thicknessis in the file’s length unit. - NewObject
- Everything
super::Disposition::Addbuilds. - NewOpening
- An
IfcOpeningElementcut intohost, placed atmatrix(row-major, file length units) in the NEW object’s local frame, so the profile describes the hole where the object will sit. When the new object is a door or window, it also fills the opening. Ashapewith voids cuts a ring, leaving the host’s material inside each void. - NewPlacement
- Where a new object sits:
matrix(row-major, file length units) is its transform relative torelative_to. - NewProperty
- NewProperty
Set - A property set (
kind: Property) or quantity set (kind: Quantity, every value aPropertyValue::Measurewith a quantity entity) to attach. Properties are written in the order given. - NewType
- A type object created alongside the occurrence. Types carry no placement
and no container; their sets are attached through
HasPropertySets. - Patch
- The edits
Disposition::Patchcarries. Any field left at its default (None, emptyVec) makes no change for that concern. - Placement
Patch - Rewrite a product’s placement to
matrix(row-major, file units, relative to whatever the existingIfcLocalPlacement.PlacementRelToalready names — this carries no opinion about the parent, only the local transform). - Plan
Context - Header provenance the caller supplies. There is no clock fallback:
now()is unavailable on thewasm32-unknown-unknowntarget this crate ships to. - Prop
Write - One typed property/quantity write: attach or overwrite
propinpset. - Refusal
- A disposition the executor could not carry out, and why. Every refusal here is an edit the plan asked for that is NOT in the output.
- Removal
- One record the plan removed, and why.
- Skeleton
- What
skeletonwrites. - Skeleton
Root - One spatial root: its GlobalId and optional name.
- Surface
Colour - A surface colour for body geometry. Components are 0..1.
- Triangle
Mesh - A triangle mesh. Indices are 0-based into
positions. - Validation
Finding - One thing the post-write validator found wrong with the file it just produced.
- Write
Report - What
super::executedid, and what it could not.
Enums§
- Classification
Link - One classification a new object is associated with through
IfcRelAssociatesClassification. - Classification
System - Disposition
- What one object should become in the output.
- IfcClass
- The IFC class of a new object. The listed classes are the ones common
enough to name; anything else goes through
IfcClass::Named, which is checked against the source schema (declared, not abstract, and of the right kind: anIfcProductfor an object, anIfcTypeObjectfor a type). - Layer
Material - A material for one layer of a new layer set.
- MapUnit
- The length unit of a projected CRS’s map coordinates.
- Material
Link - The material a new object is associated with through
IfcRelAssociatesMaterial. - Object
Ref - One object in the source file, named the way a caller has it: by express id when it already ran a query that produced one, by GlobalId when it does not track express ids across a load.
- Plan
Error - Failure modes of
super::executeitself, as opposed to a single disposition being refused (which is reported, not erred). - Prop
Scope - Whether a property write targets the occurrence’s own set or the type’s.
- Property
Value - A property value, typed the way IFC types it.
- Pset
Kind - A property or quantity, distinguished because they synthesize different
entities (
IfcPropertySingleValueunderIfcPropertySetvs. anIfcQuantityLength-family entity underIfcElementQuantity). - Removal
Reason - Why a record is not in the output. When the cascade reaches a removed record again for another reason, the earlier one in this order is kept.
- Representation
- Type
Link Newis much larger thanExisting; a plan holds one per Add, so the space is not worth an indirection in the public shape.- Value
Unit - The unit a property or quantity value is measured in, when it is not the project’s unit for that measure.
Constants§
- IDENTITY
- The identity 4x4, row-major: no rotation, no translation.
- SKELETON_
SCHEMA - The schema a skeleton is written in.
Functions§
- execute
- Execute
planagainstsource, writing the result toout. - skeleton
- The skeleton’s bytes. A header that doesn’t follow buildingSMART’s
agreement is not reported here;
skeleton_with_findingsreports it. - skeleton_
with_ findings skeleton, reporting rather than refusing an application it cannot attribute the skeleton to: the skeleton is then written unattributed, and a finding says why. A header that doesn’t follow buildingSMART’s agreement is a finding too.