Expand description
Mesh compilation: run the lowered DAG through a geometry backend.
Gated behind the opt-in compile feature. ADR 0004 keeps this crate a
bridge, and compilation is the one narrow exception: it selects an
execution provider and a memory budget, which are application policy
rather than properties of the file. Nothing here is reachable in a
default build.
The bridge still implements no geometry. It calls a compiler that already exists and translates the refusal into IFC terms.
§Bringing your own kernel
Every entry point is generic over [MeshCompiler], so a caller may bring
CGAL, OCCT, a GPU tessellator, or a research prototype without forking
this crate. Two granularities are supported:
- Whole-kernel. Implement [
MeshCompiler] over your own engine and pass it tocompile_product_mesh_with. Enablecompilealone and none of the reference execution path is even linked. - Per-area. Keep the reference compiler’s traversal and swap only the
area a kernel does well, e.g.
ReferenceMeshCompiler::new(MyBoolean)to replace boolean evaluation while retaining everything else. That needs thecompile-reference-backendfeature for the traversal.
Selection is the application’s, never the file’s: two backends given the same model must agree on what the file means, so choosing between them is a question of speed, robustness, or licence – which is why this module refuses to pick for you beyond the documented default.
§Comparing backends
Because the backend is a parameter, comparing two kernels over one corpus
is a loop. The backend_compare example (source, #31)
is that loop, written as a caller would: it compiles a fixed corpus of
committed fixtures through the reference backend and through a small
[MeshCompiler] defined in the example itself, prints wall time and mesh
size per fixture keyed by BackendId, and checks that the two agree on
volume, area and bounding box, listing every divergence and every
refusal. Its own backend builds under compile alone. The timings carry
their method and are not a cross-kernel performance claim.
cargo run --release -p ifc-geometry --features compile-reference-backend \
--example backend_compareStructs§
- Chord
Deviation - How far the exact curve may lie from its polyline, reported the way a compiled mesh’s deviation is: the chord budget asked for, and a certified upper bound on the distance from every point of the exact curve to the nearest point of the polyline, both in world units.
- Compiled
Mesh - A compiled mesh and whether it bounds a solid.
- Compiled
Polyline - One curve of a representation as a 3D polyline.
- Item
Mesh - One leaf item of a product’s Body, meshed on its own (#656).
- Layer
Mesh - One layer of a split Body, meshed.
- Layer
Meshes - A product’s Body split by a
LayerCut, one mesh per layer. - NetMesh
- A product’s NET mesh and the openings removed to produce it.
- Product
Bounds - A product’s axis-aligned bounds in world coordinates, in metres.
- Product
Polylines - The curves of one product’s representation, and the items with no curve to give that were left out.
- Sampled
Arc - Where one sampled
IfcArcIndexsegment sits in its ring. - Sampled
Profile Outline - An arbitrary profile’s boundaries, arcs sampled.
- Sampled
Ring - One boundary curve as a ring of vertices.
- Skipped
Item - A representation item the curves reader did not lower.
- Tolerance
- The tolerance every entry point takes and the mesh it returns,
re-exported so a caller that names no
axiolid-*crate – theopenbim-ifcfacade and the language bindings above it (ADR 0004, #328) – can call them and read the result. Linear and angular tolerance carried with an operation. - TriMesh
- Indexed triangle mesh in local coordinates.
Enums§
- Bounds
Source - How a product’s bounds were obtained.
- Mesh
Closure - Whether a compiled mesh bounds a solid (#161).
- NonCurve
Item - A representation item with no curve to give, which the curves reader leaves to its own reader (#512).
- Seam
Window Refusal - Why the kernel refused a station’s seam-snapping window (#423), or a run’s (#429).
Traits§
- Polyline
Compiler - Backend that compiles a curve node of a graph to a 3D polyline.
Functions§
- compile_
product_ curves - The curves of one product’s representation for
purpose, leaving its text literals and fill areas to their readers, withdefault_backend. - compile_
product_ curves_ with - The curves of one product’s representation for
purposeas polylines, leaving its text literals and fill areas to their readers (#512), with a caller-supplied backend. - compile_
product_ item_ meshes - Mesh each leaf item of a product’s Body on its own, gross (#656).
- compile_
product_ item_ meshes_ with - Mesh each leaf item of a product’s Body with a caller-supplied backend.
- compile_
product_ layer_ meshes - Mesh each layer of a product’s Body, split by
cut(#455). - compile_
product_ layer_ meshes_ with - Mesh each layer of a product’s Body with a caller-supplied backend.
- compile_
product_ mesh - Compile one product’s body representation into triangles.
- compile_
product_ mesh_ for - The surfaces and solids of one product’s representation for
purposeas one mesh, withdefault_backend. - compile_
product_ mesh_ for_ with - The surfaces and solids of one product’s representation for
purposeas one mesh, reporting its closure, with a caller-supplied backend. - compile_
product_ mesh_ net - Compile one product’s Body with every voiding opening subtracted (#44).
- compile_
product_ mesh_ net_ with - Compile one product’s net Body with a caller-supplied backend.
- compile_
product_ mesh_ reported - Compile one product’s body and report whether it bounds a solid.
- compile_
product_ mesh_ reported_ with - Compile one product’s body with a caller-supplied backend and report whether it bounds a solid.
- compile_
product_ mesh_ with - Compile one product’s body representation with a caller-supplied backend.
- compile_
product_ polylines - The curves of one product’s representation for
purposeas polylines, withdefault_backend. - compile_
product_ polylines_ with - The curves of one product’s representation for
purposeas polylines, one per curve in authored order, with a caller-supplied backend. - compile_
profile_ outline compile_profile_outline_withwithdefault_backend.- compile_
profile_ outline_ with - Read an arbitrary profile’s outline in metres, sampling each arc with
backendwithintolerance. - compile_
sweep_ directrix compile_sweep_directrix_withwithdefault_backend.- compile_
sweep_ directrix_ with sweep’s directrix as a polyline inframe, sampled bybackendwithintolerance.- default_
backend - The backend used when a caller expresses no preference.
- product_
bounds - The world-space axis-aligned bounding box of one product’s body.
- product_
bounds_ with - The world-space axis-aligned bounding box of one product’s body.
Type Aliases§
- Point3
- A semantic alias used when a value is a three-dimensional position.