Skip to main content

Crate ifc_lite_processing

Crate ifc_lite_processing 

Source
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::ExportedElement;
pub use geometry_export::GeometryDataExport;
pub use pipeline_diagnostics::PipelineDiagnostics;
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§

determinism
Mesh-output determinism manifest - the pipeline-level companion to the kernel’s predicate sign manifest (ifc_lite_geometry::kernel::manifest).
element
Canonical per-element mesh production — THE single decision tree that turns one IFC product (or type-product RepresentationMap) into renderable meshes.
geometry_export
Analysis-ready geometry-data export.
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.
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§

CoordinateInfo
Coordinate system information.
Georeferencing
Georeferencing metadata (IfcMapConversion + IfcProjectedCRS).
InstanceRecord
#1623 Phase 2: one resolved occurrence of a shared template geometry, emitted in crate::ProcessingResult::instances instead of a full materialized mesh when StreamingOptions.enable_instancing is set. The consumer uploads the template MeshData (template_express_id, still in meshes) once and draws this occurrence by applying transform to the template’s baked world geometry. Purely in-memory, like MeshData::instance — recomputed fresh each load, never round-trips a cache.
MeshData
Individual mesh data with geometry and metadata.
ModelMetadata
Model metadata extracted from the IFC file.
ParseResponse
Full parse response with all meshes.
ProcessingResult
Result of processing an IFC file.
ProcessingStats
Processing statistics.
QuickMetadataBootstrap
QuickMetadataEntitySummary
QuickMetadataSpatialNode
RawInstanceOccurrence
#1623 Phase 2 “don’t-bake”: a non-template occurrence of a shared IfcRepresentationMap that skipped the per-occurrence vertex materialize. The router emits an instance-only placeholder (empty geometry carrying InstanceMeta); [crate::element::emit_sub_meshes] turns it into one of these, and the streaming finalize resolves it against the template MeshData into an InstanceRecord. Purely in-memory (recomputed each load), never serialized.
StreamingOptions
Controls the tradeoff between first-frame latency and richer upfront metadata.
SymbolicCircle
A single 2D circle / arc for symbolic representations.
SymbolicData
Server-friendly summary of the IFC’s 2D symbol data.
SymbolicFillArea
A 2D filled region (IfcAnnotationFillArea).
SymbolicGridAxis
A single IfcGridAxis tag + axis curve (server-friendly endpoint-pair representation; the wasm pipeline emits the same data via SymbolicPolyline axis lines and SymbolicText bubbles, both of which are also populated below).
SymbolicPolyline
A single 2D polyline for symbolic representations.
SymbolicText
A 2D text annotation (IfcTextLiteral / IfcTextLiteralWithExtent).

Enums§

OpeningFilterMode
Controls how IfcWindow / IfcDoor openings are exported.
TessellationQuality
Re-exported so the server can name the quality level without a direct ifc-lite-geometry dependency edge for one enum. Detail level for geometry tessellation, selectable by consumers.

Constants§

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 with PREPASS_CLASS_FLAG_TYPE_CANDIDATE.
PREPASS_CLASS_FLAG_TYPE_CANDIDATE
FLAG bit: IfcTypeProduct subtype 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.

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_local coordinate-space tier; translation alignment happens upstream via the router’s RTC subtraction.
extract_georeferencing
Extract georeferencing from an IFC file, returning None when the model carries no IfcMapConversion / ePSet_MapConversion data.
extract_georeferencing_with_index
extract_georeferencing, reusing an index the caller already holds.
extract_symbolic_data
Scan an IFC file for IfcGrid and any product carrying a Plan / Annotation / FootPrint / Axis representation, and return the full symbolic primitive collection. Pure-Rust (no wasm_bindgen), so it works inside the HTTP server.
flat_styles_rgba8_from_geometry_columns
crate::prepass::flat_styles_rgba8 with the (dominant) geometry-style source supplied as PRE-MERGED columns instead of a map — the sharded finalize path. geom_ids are unique (the host merged shard results first-wins) with geom_colors as rgba f32 quads; resolved carries the support resolution (indexed colours, materials, element colours) and MUST have an empty geometry_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.
process_geometry
Process IFC content with parallel geometry extraction (default opening filter).
process_geometry_filtered
Process IFC content with parallel geometry extraction and a configurable opening filter.
process_geometry_filtered_with_quality
Like process_geometry_filtered with a consumer-selected tessellation detail level (#976) — the server half of the quality knob the wasm path exposes via setTessellationQuality.
process_geometry_streaming
Process IFC content with parallel geometry extraction and emit batches as they complete.
process_geometry_streaming_filtered
Process IFC content with parallel geometry extraction and a configurable streaming batch size.
process_geometry_streaming_filtered_with_options
Process IFC content with parallel geometry extraction and configurable streaming behavior.
process_geometry_streaming_with_options
Process IFC content with parallel geometry extraction and configurable streaming behavior.
process_geometry_streaming_with_options_and_bootstrap
Process IFC content with parallel geometry extraction and emit a quick metadata bootstrap once the scan phase completes.
process_geometry_with_index
Like process_geometry but reuses a pre-built entity index instead of scanning content for 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 with ifc_lite_core::build_entity_index and share it across both, skipping the duplicate scan. index MUST be built from the same content. Output is identical to process_geometry(content).
scan_shard
scan_shard_classified
[scan_shard] plus a parallel per-record class column (see the PREPASS_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.

Type Aliases§

ShardRecords
One shard’s speculative scan over [range_start, range_end).