Expand description
Shared IFC processing pipeline and types.
This crate extracts the core processing logic so it can be used by both the HTTP server and the native FFI library.
Re-exports§
pub use geometry_export::build_geometry_data_export;pub use geometry_export::build_colored_geometry_data_export;pub use geometry_export::ColoredGeometryDataExport;pub use geometry_export::ExportedElement;pub use geometry_export::GeometryDataExport;pub use analytic_export::check_swept_disk;pub use analytic_export::extract_analytic_quantity_sources;pub use analytic_export::AnalyticQuantitySources;pub use analytic_export::extract_swept_disk_definitions;pub use analytic_export::extract_swept_disk_descriptions;pub use analytic_export::extract_swept_disk_views;pub use analytic_export::extract_extrusion_definitions;pub use analytic_export::extrusion_nominal_quantities;pub use analytic_export::DirectrixMetrics;pub use analytic_export::DirectrixSegmentMetrics;pub use analytic_export::ExtrusionNominalQuantities;pub use analytic_export::SweptDiskCheckError;pub use analytic_export::SweptDiskCheckFinding;pub use analytic_export::SweptDiskCheckOptions;pub use analytic_export::SweptDiskCheckReport;pub use analytic_export::SweptDiskDefinition;pub use analytic_export::SweptDiskDefinitions;pub use analytic_export::SweptDiskDescriptions;pub use analytic_export::SweptDiskFindingCode;pub use analytic_export::SweptDiskInstance;pub use analytic_export::SweptDiskNominalQuantities;pub use analytic_export::SweptDiskOccurrence;pub use analytic_export::SweptDiskSourceContext;pub use analytic_export::SweptDiskSourceKey;pub use analytic_export::AnalyticSourceContext;pub use analytic_export::AnalyticSourceKey;pub use analytic_export::ExtrusionDefinition;pub use analytic_export::ExtrusionDefinitions;pub use analytic_export::ExtrusionInstance;pub use pipeline_diagnostics::PipelineDiagnostics;pub use pipeline_diagnostics::PipelineDiagnosticsReport;pub use pipeline_diagnostics::PipelinePhaseTimings;pub use pipeline_diagnostics::PIPELINE_DIAGNOSTICS_SCHEMA_VERSION;pub use simplify_session::simplify_element;pub use simplify_session::SimplifiedElement;pub use simplify_session::SimplifyRecordInput;pub use simplify_session::SimplifySkip;pub use style::default_color_for_type;pub use style::Rgba;pub use style::TRANSPARENCY_ALPHA_THRESHOLD;
Modules§
- analytic_
export - Optional analytic descriptions of authored geometry, keyed by product occurrence. This walks the same body-representation selection as the mesh router, but does not produce meshes. Source operands of booleans are identified as such.
- appearance
- Opt-in appearance authoring over an effective IFC snapshot. No load-time geometry changes. Plans are applied atomically by the host mutation editor.
- data_
model - Data model extraction service - extracts properties, relationships, and spatial hierarchy.
- determinism
- Mesh-output determinism manifest - the pipeline-level companion to the
kernel’s predicate sign manifest (
ifc_lite_geometry::kernel::manifest). - discovery
- Shared record discovery; native metadata and geometry-job decoration remain consumers.
- element
- Canonical per-element mesh production — THE single decision tree that turns one IFC product (or type-product RepresentationMap) into renderable meshes.
- execution
- Shared scheduler boundaries around the owned element transaction. Worker caches, batch source ownership and output encoding remain with the callers.
- geometry_
export - Analysis-ready geometry-data export.
- pdf_
vector - Bounded graphics-state preparation for the pinned PDF.js adapter, producing the convertible path subset and a page-level fidelity report. This does not authorize geometry. The explicit annotation planner separately composes qualified fills and bounded solid straight stroke outlines.
- pipeline_
diagnostics - Structured per-load pipeline diagnostics — the cross-target contract.
- prepass
- Canonical prepass resolution — the single post-scan step that turns the
entity spans a scan collected into the style / material / void context the
per-element producer (
crate::element) consumes. - result_
cache - Native warm-load cache of complete results; off unless a caller opts in. Native warm-load cache of complete processing results (phase 1).
- retained_
geometry - Explicit admission of canonical processing output into a geometry document.
- retained_
requests - Opt-in retained authored-source requests for a model.
- scan
ScanClass: the one table of STEP keywords a scan loop reacts to.- scan_
proposals - Scan-to-BIM element proposals (#6894): planes and cylinders from
scan_segmentationbecome proposed walls, slabs, columns and pipes in the IFC model frame, each with a confidence, its source detections and their fit statistics. Nothing is created here; the viewer reviews the proposals and creates the accepted ones through its modelling commands. - scan_
segmentation - Plane and cylinder detection in point clouds (#6870): scan-to-BIM groundwork.
- simplify_
session - Demesher session core: simplify already-produced element meshes and hand back BOTH a render-ready replacement mesh and the same vertices in the element’s IFC object-placement frame (file units) for tessellated IFC re-export.
- stream_
meta - Shared streaming pre-pass meta resolution.
- style
- Canonical IFC styling — the single source of truth for mesh colors, shared between the HTTP server, the native pipeline, and the browser-side WASM bindings (issue #913).
Structs§
- Batching
- How the meshing loop chunks its jobs, and in what order.
- Coordinate
Info - Coordinate system information.
- Features
- The optional phases of a pass. All on except the bootstrap and the finishes, as before.
- Frame
Event - The frame a pass bakes its vertices in (#5407).
- Georeferencing
- Georeferencing metadata (
IfcMapConversion+IfcProjectedCRS). - Instance
Record - #1623 Phase 2: one resolved occurrence of a shared template geometry, emitted in
crate::ProcessingResult::instancesinstead of a full materialized mesh whenStreamingOptions.enable_instancingis set. The consumer uploads the template MeshData (template_express_id, still inmeshes) once and draws this occurrence by applyingtransformto the template’s baked world geometry. Purely in-memory, likeMeshData::instance— recomputed fresh each load, never round-trips a cache. - Mesh
Data - Individual mesh data with geometry and metadata.
- Mesh
Presentation Provenance - Provenance of one produced mesh’s presentation channels.
- Mesh
Texture Data - A surface texture attached to a mesh (issues #961, #1781). Exactly one of
rgba/urlis set: - Model
Metadata - Model metadata extracted from the IFC file.
- OnBatch
- A sink that listens to batches only:
OnBatch::new(|meshes, processed, total| ..). - Parse
Response - Full parse response with all meshes.
- Processing
Request - One pass over one file: the input of
process. - Processing
Result - Result of processing an IFC file.
- Processing
Stats - Processing statistics.
- Product
Geometry Audit - Per-product processing receipts for consumers that cannot accept partial geometry.
No entry means NOT proven: skipped/undecodable jobs never become a clean receipt.
Okcertifies only the diagnostic checks below, not source referential integrity or shared-cache provenance. Strict consumers must check those independently. - Quick
Metadata Bootstrap - Quick
Metadata Entity Summary - Quick
Metadata Pruned Edge - A spatial child edge left out of
QuickMetadataBootstrap::spatial_tree. Each node is placed where the depth-first walk from the root first reaches it; every laterIfcRelAggregatesedge to it is recorded here, as is every child edge the walk would follow out of a node at the depth limit. A spatial element anIfcRelContainedInSpatialStructurepromotes to a child is not an aggregate edge: skipping it because the node is already placed, or because the node is settled (seeQuickMetadataPrunedEdgeKind::DepthLimit), is not recorded (#4689). - Quick
Metadata Spatial Node - RawInstance
Occurrence - #1623 Phase 2 “don’t-bake”: a non-template occurrence of a shared
IfcRepresentationMapthat skipped the per-occurrence vertex materialize. The router emits an instance-only placeholder (empty geometry carryingInstanceMeta); [crate::element::emit_sub_meshes] turns it into one of these, and the streaming finalize resolves it against the template MeshData into anInstanceRecord. Purely in-memory (recomputed each load), never serialized. - Shard
Scan - A speculative shard; diagnostics are attributed only after the handoff stitch.
- Streaming
Options - Controls the tradeoff between first-frame latency and richer upfront metadata.
- Symbolic
Circle - A single 2D circle / arc for symbolic representations.
- Symbolic
Data - Server-friendly summary of the IFC’s 2D symbol data.
- Symbolic
Data With Provenance - Canonical symbol data plus extraction-bound direct fill identities.
Private fields preserve freedom to extend this result without breaking
callers constructing the legacy
SymbolicData/SymbolicFillAreastructs. - Symbolic
Fill Area - A 2D filled region (
IfcAnnotationFillArea). - Symbolic
Grid Axis - A single
IfcGridAxistag + axis curve (server-friendly endpoint-pair representation; the wasm pipeline emits the same data viaSymbolicPolylineaxis lines andSymbolicTextbubbles, both of which are also populated below). - Symbolic
Polyline - A single 2D polyline for symbolic representations.
- Symbolic
Text - A 2D text annotation (
IfcTextLiteral/IfcTextLiteralWithExtent). - Symbolic
Truncation - What stopped an extraction early, when something did.
- Texture
Binding - Binding of a mesh’s texture coordinates to the source texture map.
Enums§
- Mesh
Coordinate Space - Which frame serialized mesh vertices are expressed in.
- Mesh
Frame - The frame a pipeline meshes into: the translation it subtracts and, in the site tier, the rotation it removes.
- Normal
Provenance - Who wrote the normals this mesh ships.
- Opening
Filter Mode - Controls how IfcWindow / IfcDoor openings are exported.
- Palette
Absence - Why a body that reached a palette carries no binding.
- Palette
Binding - Binding of a mesh’s colour to an
IfcIndexedColourMappalette entry. - Quick
Metadata Pruned Edge Kind - Why a
QuickMetadataPrunedEdgewas left out. - Symbolic
Truncation Reason - Which bound stopped an extraction early.
- Tessellation
Quality - Re-exported so the server can name the quality level without a direct
ifc-lite-geometrydependency edge for one enum. Detail level for geometry tessellation, selectable by consumers. - UvAuthority
- How far the shipped UVs are the source’s.
Constants§
- GEOMETRY_
STACK_ BYTES - Stack size for every rayon worker that runs geometry (256 MiB).
- PREPASS_
CLASS_ CODE_ MASK - Mask extracting the named-arm code from a class byte (drops the flag bits).
- PREPASS_
CLASS_ FLAG_ GEOMETRY_ JOB - FLAG bit: geometry-bearing entity (
has_geometry_by_name) — a pre-pass geometry job. Composes with the named codes’ nibble range (2..=13) and withPREPASS_CLASS_FLAG_TYPE_CANDIDATE. - PREPASS_
CLASS_ FLAG_ TYPE_ CANDIDATE - FLAG bit:
IfcTypeProductsubtype candidate (name ends TYPE/STYLE) for the #957 orphan type-geometry pass. - PREPASS_
CLASS_ INDEXED_ COLOUR_ MAP IFCINDEXEDCOLOURMAP(#663/#858).- PREPASS_
CLASS_ MAPPED_ ITEM IFCMAPPEDITEM(#957/#1623 repmap plans).- PREPASS_
CLASS_ MATERIAL_ DEF_ REPR IFCMATERIALDEFINITIONREPRESENTATION(#407).- PREPASS_
CLASS_ MATERIAL_ LAYER_ SET IFCMATERIALLAYERSET/IFCMATERIALLAYERSETUSAGE(arms the layer index).- PREPASS_
CLASS_ NONE - Per-record prepass class emitted by
scan_shard_classified. - PREPASS_
CLASS_ PROJECT IFCPROJECT.- PREPASS_
CLASS_ REL_ AGGREGATES IFCRELAGGREGATES.- PREPASS_
CLASS_ REL_ ASSOCIATES_ MATERIAL IFCRELASSOCIATESMATERIAL(#407).- PREPASS_
CLASS_ REL_ DEFINES_ BY_ TYPE IFCRELDEFINESBYTYPE(#957 instantiated-type ids).- PREPASS_
CLASS_ REL_ FILLS IFCRELFILLSELEMENT.- PREPASS_
CLASS_ REL_ VOIDS IFCRELVOIDSELEMENT.- PREPASS_
CLASS_ SITE IFCSITE(also a geometry job — the pre-pass buffers it like one).- PREPASS_
CLASS_ STYLED_ ITEM IFCSTYLEDITEM— the styled-item spans the pre-pass resolver classifies into orphan (material appearance) vs geometry-attached styles.
Traits§
- Processing
Sink - Events of one
processpass. See the module docs.
Functions§
- build_
entity_ index_ parallel - Build the entity index (expressId -> byte span) across all available cores.
- classify_
type_ name - Classify a scanned STEP keyword into the prepass class byte: a named-arm
code for the exact keywords the serial pre-pass matches, plus the
geometry-job / type-candidate FLAG bits from the same helpers it calls
(
has_geometry_by_name,IfcType::is_subtype_of). Byte-identical span collection and job discovery follow from using the identical predicates at scan time. - convert_
mesh_ to_ site_ local - Rotate a mesh into the site-local axis frame. Only runs for the
site_localcoordinate-space tier; translation alignment happens upstream via the router’s RTC subtraction. - detect_
schema_ version - The IFC schema a STEP file declares:
"IFC2X3","IFC4","IFC4X3"or"IFC5". THE detector for everyschema_versionthis workspace reports, the native pipeline’sModelMetadataand the server’s/parse/metadataalike (PROCESSING-5 / SERVER-18, #7691: the server kept a second, case-sensitive copy, and processing searched the whole file, soifc4inside a GUID reported an IFC2X3 model as IFC4). - extract_
georeferencing - Extract georeferencing from an IFC file, returning
Nonewhen the model carries noIfcMapConversion,IfcRigidOperation, declared CRS,ePSet_MapConversionorIfcSitelat/long data. - extract_
georeferencing_ with_ index extract_georeferencing, reusing an index the caller already holds.- extract_
symbolic_ data - Scan an IFC file for
IfcGridand any product carrying a Plan / Annotation / FootPrint / Axis representation, and return the full symbolic primitive collection. Pure-Rust (nowasm_bindgen), so it works inside the HTTP server. - extract_
symbolic_ data_ with_ provenance - Extract symbols with ordinal-bound direct fill provenance, preserving the legacy data shape.
- extract_
symbolic_ data_ with_ provenance_ in_ frame - Extract symbols in a frame the caller already chose: the native pipeline’s
crate::ProcessingResult::frame. - flat_
styles_ rgba8_ from_ geometry_ columns crate::prepass::flat_styles_rgba8with the (dominant) geometry-style source supplied as PRE-MERGED columns instead of a map — the sharded finalize path.geom_idsare unique (the host merged shard results first-wins) withgeom_colorsas rgba f32 quads;resolvedcarries the support resolution (indexed colours, materials, element colours) and MUST have an emptygeometry_style_index. Output is byte-identical to the serial flatten: same precedence (geometry > indexed colour > material > element material), same id-ascending wire order, same rgba8 conversion — without ever building the 4M-entry geometry hashmap.- geometry_
pool - The process-wide large-stack pool, built on first use.
- geometry_
pool_ builder - A [
ThreadPoolBuilder] whose workers haveGEOMETRY_STACK_BYTESstacks. Callers may addnum_threadsand thenbuildorbuild_global. - group_
occurrences_ by_ rep - The don’t-bake occurrence grouping, template selection and occurrence → flat
MeshDatarecovery, shared with the browser batch (rust/wasm-bindings/src/api/gpu_meshes/instancing.rs) so each has one home rather than two clones. See their doc comments. Group don’t-bake occurrences by shared-template key (rep_identity, theIfcRepresentationMapid). Groups come back in ascending rep order so the output is deterministic; each group keeps its occurrences in arrival order. - index_
templates_ by_ rep - The don’t-bake occurrence grouping, template selection and occurrence → flat
MeshDatarecovery, shared with the browser batch (rust/wasm-bindings/src/api/gpu_meshes/instancing.rs) so each has one home rather than two clones. See their doc comments. Index the template meshes a set of occurrences can be placed against, byrep_identity. A template is a non-empty mesh whose instance metadata isinstanceable; the FIRST such mesh per rep wins.infomaps the winner’s position inmeshesand the mesh itself to what the caller records: the native finalize keeps the index, the browser batch its shard eligibility. The caller decides the scopemeshescovers (the whole model natively, one batch in the browser). - is_
quick_ spatial_ type_ ci - Is this STEP keyword a node of the quick-metadata spatial tree?
- native_
to_ baked - The row-major 4x4 mapping a NATIVE-frame point (IFC Z-up, pre-RTC — the
frame
InstanceMeta.transformand every capturedlocal_to_worlddescribe) onto the BAKED point this pipeline actually writes intoMeshData, for the given coordinate-space tier. - process
- The native pipeline: scan, resolve, mesh, finalise. The one body behind
every entry point; see
ProcessingRequestfor the inputs andProcessingSinkfor the events it raises while it runs. - process_
geometry - Process IFC content with parallel geometry extraction (default opening filter).
- process_
geometry_ filtered Deprecated - Process IFC content with parallel geometry extraction and a configurable opening filter.
- process_
geometry_ filtered_ with_ quality Deprecated - Like
process_geometry_filteredwith a consumer-selected tessellation detail level (#976), exposed to the browser and server too. - process_
geometry_ filtered_ with_ quality_ and_ ids Deprecated - Like
process_geometry_filtered_with_quality, but restricts tessellation to the supplied IFC express ids.Nonepreserves the unfiltered behaviour;Some(empty)is an active filter that produces no meshes. - process_
geometry_ streaming Deprecated - Process IFC content with parallel geometry extraction and emit batches as they complete.
- process_
geometry_ streaming_ filtered Deprecated - Process IFC content with parallel geometry extraction and a configurable streaming batch size.
- process_
geometry_ streaming_ filtered_ with_ baked_ basis Deprecated process_geometry_streaming_filtered_with_options, plus:baked_basis_outreceivesnative_to_bakedfor the frame this pass bakes vertices in. It is set once, after frame selection and BEFORE the first batch is emitted, so a streaming consumer can collate each batch in the baked frame as it arrives. It equalsnative_to_bakedof the returned result’smesh_coordinate_space,site_transformandmetadata.coordinate_info.origin_shift.- process_
geometry_ streaming_ filtered_ with_ options Deprecated - Process IFC content with parallel geometry extraction and configurable streaming behavior.
- process_
geometry_ streaming_ with_ options Deprecated - Process IFC content with parallel geometry extraction and configurable streaming behavior.
- process_
geometry_ streaming_ with_ options_ and_ bootstrap Deprecated - Process IFC content with parallel geometry extraction and emit a quick metadata bootstrap once the scan phase completes.
- process_
geometry_ with_ index Deprecated - Like
process_geometrybut reuses a pre-built entity index instead of scanningcontentfor one. For a caller that also runs a second pass over the same bytes (e.g. pairing GLB export with attribute extraction): build the index once withifc_lite_core::build_entity_indexand share it across both, skipping the duplicate scan.indexMUST be built from the samecontent. Output is identical toprocess_geometry(content). - recover_
occurrences_ flat - The don’t-bake occurrence grouping, template selection and occurrence → flat
MeshDatarecovery, shared with the browser batch (rust/wasm-bindings/src/api/gpu_meshes/instancing.rs) so each has one home rather than two clones. See their doc comments. Rebuild each don’t-bake occurrence ofrepas a standalone flatMeshData, baked from the shared mapped-source registry at the occurrence’s world transform (post-RTC) — geometrically identical to the occurrence the flat path would have produced. No instancing benefit, but correct and never a silent loss. - result_
fingerprint - Lowercase hex SHA-256 over the whole result (see the module docs for the two excluded field kinds).
- run_
on_ geometry_ pool - Run
workongeometry_pool, so it and every rayon job it starts run on large-stack workers. Blocks the calling thread untilworkreturns. - scan_
shard Deprecated scan_shard_with_refusalswithout the refusal offsets.- scan_
shard_ classified Deprecated - [
scan_shard] plus a parallel per-record class column (see thePREPASS_CLASS_*codes). Same records, same handoff; the class byte lets the browser host extract pre-pass span lists (today: styled items) from the stitched shard columns WITHOUT waiting for the serial pre-pass scan. - scan_
shard_ classified_ with_ refusals Deprecated scan_shard_classifiedplus the byte offset of every record this shard refused because its instance name does not fitu32(#3395).- scan_
shard_ result - Scan one shard, optionally classifying it without making index-only callers pay for keyword classification. Preserve file order and speculative diagnostics.
- scan_
shard_ with_ diagnostics Deprecated - One shard’s speculative scan over
[range_start, range_end), plus the byte offset of every record this shard refused and, if any, the byte offset of the record that made the scan stop early (#3695’s malformed-record stop). - scan_
shard_ with_ refusals Deprecated scan_shard_with_diagnosticswithout the malformed-record offset.
Type Aliases§
- Shard
Records - One shard’s records:
(id, start, end)per entity, strictly increasing instart. - Shard
Refusals - One shard’s refusals: the
startbyte of each record the scan dropped for an instance name aboveu32::MAX(#3395), strictly increasing.