#[non_exhaustive]pub enum GeometryError {
Show 40 variants
MissingEntity {
referrer: EntityId,
missing: EntityId,
},
MissingAttribute {
entity: EntityId,
type_name: String,
attribute: &'static str,
},
WrongValueKind {
entity: EntityId,
type_name: String,
attribute: &'static str,
expected: &'static str,
found: String,
},
WrongEntityType {
entity: EntityId,
actual: String,
expected: &'static str,
},
Unsupported {
entity: EntityId,
type_name: String,
detail: &'static str,
},
CyclicChain {
entity: EntityId,
kind: &'static str,
},
UnitRecordDamaged {
entity: EntityId,
diagnostic: usize,
},
UnitsIncomplete {
diagnostics: usize,
},
ChainTooDeep {
entity: EntityId,
kind: &'static str,
limit: usize,
},
AggregateTooLarge {
entity: EntityId,
type_name: String,
what: &'static str,
requested: u128,
limit: usize,
},
CompilationRefused {
entity: EntityId,
reason: String,
},
NotASolid {
entity: EntityId,
closure: MeshClosure,
},
LayerNotSplit {
product: EntityId,
layer: usize,
cause: Box<GeometryError>,
},
OpeningNotSubtracted {
host: EntityId,
opening: EntityId,
cause: Box<GeometryError>,
},
CachedPlacementMismatch {
placement: EntityId,
cached: [f64; 3],
derived: [f64; 3],
distance: f64,
tolerance: f64,
},
SeamSideUnsupported {
placement: EntityId,
basis: EntityId,
distance: f64,
},
CurvePathUnsupported {
placement: EntityId,
basis: EntityId,
},
PathPieceLengthUnstated {
placement: EntityId,
basis: EntityId,
},
CurvePathOpenEndUnsupported {
placement: EntityId,
basis: EntityId,
},
PathPointOffCurve {
placement: EntityId,
basis: EntityId,
},
PathPointAmbiguous {
placement: EntityId,
basis: EntityId,
},
CurvePathBoundUnsupported {
placement: EntityId,
basis: EntityId,
},
PathJointDistancesUnsupported {
placement: EntityId,
basis: EntityId,
},
PlacementSeamWindowRefused {
placement: EntityId,
basis: EntityId,
distance: f64,
refusal: SeamWindowRefusal,
},
StationSeamWindowRefused {
product: EntityId,
stations: Vec<EntityId>,
refusal: SeamWindowRefusal,
},
RunSeamWindowRefused {
product: EntityId,
runs: Vec<EntityId>,
stations: Vec<EntityId>,
refusal: SeamWindowRefusal,
},
GridAxesParallel {
intersection: EntityId,
axes: [EntityId; 2],
},
GridAxesDoNotIntersect {
intersection: EntityId,
axes: [EntityId; 2],
detail: &'static str,
},
GridAxisWithoutGrid {
axis: EntityId,
},
GridAxesInDifferentGrids {
intersection: EntityId,
grids: [EntityId; 2],
},
PlacementRelToConflict {
placement: EntityId,
stated: EntityId,
implied: EntityId,
},
Degenerate {
entity: EntityId,
type_name: String,
detail: String,
},
Units(String),
LengthUnitUndeclared {
project: Option<EntityId>,
assignment: Option<EntityId>,
},
AngleUnitUndeclared {
entity: EntityId,
},
UnitUnreadable {
unit: EntityId,
unit_type: &'static str,
detail: String,
},
UnitsAmbiguous {
first: EntityId,
second: EntityId,
kind: &'static str,
},
InvalidAuthoredValue {
type_name: &'static str,
attribute: &'static str,
detail: String,
},
AuthoringSchemaUnbound {
type_name: &'static str,
detail: String,
},
AuthoringEntityNotInSchema {
type_name: &'static str,
schema: SchemaVersion,
},
}Expand description
Failures when reading or lowering IFC geometry.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingEntity
An entity referenced by an attribute is not in the model.
Fields
MissingAttribute
An attribute slot was empty but the geometry needs it.
Fields
WrongValueKind
An attribute held a value of the wrong shape.
Fields
WrongEntityType
The entity is not the type the caller assumed.
Fields
Unsupported
A recognized IFC entity whose interpretation is not implemented.
Distinct from Self::WrongEntityType: the file is valid and we simply
do not handle it yet. Never silently substituted with a wrong shape.
Fields
CyclicChain
A placement or mapped-item chain refers back to itself.
The IFC spec pushes cycle prevention to the application layer, so real files do contain them. Detecting beats overflowing the stack.
Fields
UnitRecordDamaged
The reader reported a unit record this resolution reads (#684): the file defines its id more than once, or a lenient read skipped a record with this id while another record holds it. The kept record cannot be shown to be the one the file meant.
Fields
UnitsIncomplete
The reader’s diagnostics may hide a unit record (#684): a diagnostic
of an unclassified kind, a skipped record or duplicate with no id, no
IfcProject after a skipped record, or a skip naming a held id
elsewhere.
ChainTooDeep
A chain exceeded its depth limit without closing.
Fields
AggregateTooLarge
An aggregate declared more elements than the caller’s budget allows.
IFC aggregate counts are file-controlled, so a small hostile file can declare an enormous element count and drive a large allocation before any geometric validation runs. This is that budget refusing, and it is always a refusal: nothing is truncated to fit.
Fields
CompilationRefused
A lowered product reached the mesh or polyline compiler, which refused it.
Distinct from Self::Unsupported: lowering succeeded and the neutral
DAG is valid IFC meaning. What failed is execution – a provider that
cannot evaluate this operation, or a budget that will not fund it. The
compiler’s own reason is preserved verbatim, because it names the
missing capability precisely enough for a caller to register a provider
for it. Only reachable with the compile feature.
Fields
NotASolid
A volume was asked of a product whose compiled body is not a solid.
Raised by CompiledMesh::solid_mesh for a surface model
(IfcShellBasedSurfaceModel, IfcFaceBasedSurfaceModel) and for a
backend that does not report closure. A surface has area, not
volume; reporting the divergence sum of a closed shell the file never
declared a solid would be a plausible, wrong number.
Fields
closure: MeshClosureThe closure the backend reported: Surface or Unknown.
LayerNotSplit
A backend refused to cut one layer out of a product’s Body (#455).
Raised only for a layer split, and only when the Body itself compiles:
a refusal the Body alone would raise stays as it is. layer indexes
the cut’s layers, so no part of the stack is dropped or merged into a
neighbour to hide it.
Fields
cause: Box<GeometryError>Why it was refused.
OpeningNotSubtracted
An opening that voids a host could not be subtracted from it (#44).
Raised only when a caller asked for NET geometry. Returning the gross
body instead would make every net quantity downstream silently wrong,
so the host is refused and the opening named. cause says why: the
opening’s body did not lower, it has no body, or the kernel refused the
subtraction.
Fields
cause: Box<GeometryError>Why it could not be removed.
CachedPlacementMismatch
An IfcLinearPlacement’s cached CartesianPosition disagrees with
the position its RelativePlacement derives (#354).
Raised only when the caller supplied a curve evaluator and kept the
default CachedPositionPolicy::Verify. IFC4.3 makes the cache “an
optional fallback” for the linear expression, so a cache farther than
the model’s tolerance from it is stale or wrong, and placing the
product by either would be a guess. Positions are world coordinates in
metres.
Fields
SeamSideUnsupported
An IfcLinearPlacement’s DistanceAlong lies on a tangent
discontinuity of its basis curve, and the caller’s curve evaluator
cannot read the seam’s incoming side (#409).
IFC4.3 ADD2 8.9.3.48.3: “If DistanceAlong coincides with a point of
tangential discontinuity (within precision limits), then the tangent
of the previous segment governs.” The placement is derived through
CurveEvaluator::frame_at_on with SeamSide::Incoming; an evaluator
that does not implement seam sides refuses that with
SEAM_SIDE_UNSUPPORTED, and the outgoing frame it could answer is
the wrong one, so the placement is refused rather than placed by it.
Fields
CurvePathUnsupported
An IfcLinearPlacement’s basis curve lowers to a curve relation (a
plain IfcCompositeCurve, an IfcTrimmedCurve, a composite of
segments placed at stations), and the caller’s curve evaluator reads
single curves only (#418).
The placement is derived through CurveEvaluator::path_frame_at_on
on the basis as a CurvePath; an evaluator that does not implement
curve paths refuses that with CURVE_PATH_UNSUPPORTED, and the
placement is refused rather than derived from one piece of the
basis.
PathPieceLengthUnstated
A curve evaluator cannot be handed an IfcLinearPlacement’s basis
curve: it lowers to a curve relation holding a span whose ends its
data does not state in a form Axiolid’s neutral CurvePath takes.
A piece whose length is a quadrature is handed over open (#427,
axiolid/kernel#298), and a trim of an ellipse or a B-spline at an
interior parameter, a point or a forward arc length is bounded there
(#436, axiolid/kernel#304), the evaluator resolving each. What
remains has neither form: a span between distances along a relation
(a trim of it by parameters, an offset by distances along it) that
reaches a piece whose length is a quadrature other than its last, or
that reaches the last from an end that is not stated, since which
piece the span ends in is itself a quadrature; an arc-length trim of
an ellipse or a B-spline against its sense, or of a B-spline whose
parameters do not start at 0, which is a quadrature from the
curve’s start; a varying offset of such a piece; and a trim of a
relation by a Cartesian point. Only an execution provider computes
these, which this crate links none of (ADR 0004). The placement is
refused rather than derived from an estimated path. The same basis
lowers as a station, which the kernel resolves itself.
CurvePathOpenEndUnsupported
An IfcLinearPlacement’s basis curve lowers to a curve relation
holding a piece whose length is a quadrature (an offset beside a
gradient curve, a spiral, an ellipse or a B-spline, an ellipse or a
B-spline piece), handed to the evaluator as an open-ended path piece
(#427), and the caller’s curve evaluator reads stated spans only.
Such an evaluator refuses the path with OPEN_PATH_END_UNSUPPORTED
(axiolid/kernel#298); the placement is refused rather than derived
from a length this crate would have to estimate.
PathPointOffCurve
An IfcLinearPlacement’s basis curve is trimmed at a point of an
ellipse or a B-spline (#436) that does not lie on the curve.
The point reaches the evaluator as a PathBound::Point
(axiolid/kernel#304), which refuses it with PATH_POINT_OFF_CURVE
when no parameter of the curve names it within Axiolid’s joint
tolerance: it is never projected onto the curve.
PathPointAmbiguous
An IfcLinearPlacement’s basis curve is trimmed at a point of an
ellipse or a B-spline (#436) that several of its parameters name:
the curve passes through it more than once, or it is the seam of a
closed B-spline.
The evaluator refuses the PathBound::Point with
PATH_POINT_AMBIGUOUS (axiolid/kernel#304) rather than pick one.
CurvePathBoundUnsupported
An IfcLinearPlacement’s basis curve holds a trim of an ellipse or
a B-spline at an interior parameter or a point (#436), handed to the
evaluator as a bounded path piece, and the caller’s curve evaluator
reads spans stated as distances only.
Such an evaluator refuses the path with
PATH_PIECE_BOUND_UNSUPPORTED (axiolid/kernel#304); the placement
is refused rather than derived from a distance this crate would
have to estimate.
PathJointDistancesUnsupported
An IfcLinearPlacement’s basis curve has joints after a piece whose
length is a quadrature (#427), and the caller’s curve evaluator
does not certify where they lie.
Whether DistanceAlong lies on such a joint within the model’s
precision, where IFC4.3 ADD2 (8.9.3.48.3) takes the previous
segment, is told from CurveEvaluator::path_joint_distances_within
(axiolid/kernel#294, #305), the joints near it; an evaluator that
refuses it with PATH_JOINT_DISTANCES_UNSUPPORTED cannot tell, and
the placement is refused rather than read on an estimate.
PlacementSeamWindowRefused
A derived IfcLinearPlacement on a basis with joints after a piece
whose length is a quadrature (#427): the model’s precision does not
name one place along it, or the evaluator cannot certify a joint.
The placement (or a segment of its basis placed at a station) is
read as the kernel reads the same basis’s station (#423,
axiolid/kernel#294): ON the one seam whose certified distance lies
within the model’s precision of DistanceAlong. refusal is
Ambiguous for two
seams within it, Straddled
for a seam whose certified position straddles its edge, and
UncertifiedLength
for a joint the evaluator cannot certify to a thousandth of it: a
piece before the window, or one reaching it, whose length it cannot
bound (#436); CertificationBudgetExceeded
where it can only within more panels than its budget (#443).
Fields
distance: f64The distance read, in metres: the placement’s, or the station a segment of its basis is placed at.
refusal: SeamWindowRefusalWhat failed.
StationSeamWindowRefused
The kernel refused the seam-snapping window of a station lowered on a basis whose seams lie at arc-length integrals (#423).
Such a station carries the model’s precision as a window, and the
kernel reads it on a seam within that window, from the incoming
side (IFC4.3 ADD2 8.9.3.48.3), when it resolves it
(axiolid/kernel#294). stations are the stations of the product’s
graph lowered with a window (ProvenanceMap::seam_windows), each
an IfcPointByDistanceExpression or IfcAxis2PlacementLinear; the
kernel does not say which one it refused, so with several, each is
a candidate.
Fields
refusal: SeamWindowRefusalWhat the kernel refused.
RunSeamWindowRefused
The kernel refused a run whose stations carry its seam-snapping window, lowered along a basis whose seams lie at arc-length integrals (#429).
Each section of such an IfcSectionedSolidHorizontal or
IfcSectionedSurface carries the model’s precision as a window,
and the kernel snaps it onto a seam within it when it reads the run
(axiolid/kernel#301). runs are the runs of the product’s graph
lowered with windows (ProvenanceMap::seam_window_runs), and
stations any single stations of the same graph lowered with one
(ProvenanceMap::seam_windows); the kernel does not say which it
refused, so with several, each is a candidate. Besides the window’s
own refusals, refusal may be
SeamWindowRefusal::NotIncreasing:
two positions snapped onto one seam, or one past its neighbour; and,
for an IfcOffsetCurveByDistances continued to a basis end the
kernel measures (#433),
SeamWindowRefusal::PastBasisEnd:
a stated station at or past that end.
Fields
refusal: SeamWindowRefusalWhat the kernel refused.
GridAxesParallel
The two straight axes of an IfcVirtualGridIntersection are parallel,
so they have no intersection to place anything at (#362).
IFC4.3 ADD2 IfcGrid, informal proposition: “Grid axes, which are
referenced in different lists of axes (UAxes, VAxes, WAxes) shall not
be parallel.” Their offset curves are parallel too, whatever the
OffsetDistances.
Fields
GridAxesDoNotIntersect
The curved axes of an IfcVirtualGridIntersection meet nowhere
within their extent, or more than once (#362).
IfcVirtualGridIntersection.IntersectingAxes are “two grid axes which
intersects at exactly one intersection”; picking one of two crossings,
or the nearest miss, would be a guess.
Fields
GridAxisWithoutGrid
An IfcGridAxis that no IfcGrid lists, so it has no grid frame to
be placed in (#362).
IfcGridAxis WR2: the axis is used by exactly one of UAxes,
VAxes, WAxes of one IfcGrid, whose ObjectPlacement positions
it (“The grid axis is positioned within the XY plane of the position
coordinate system defined by the IfcGrid”).
GridAxesInDifferentGrids
The axes one IfcGridPlacement names belong to different grids
(#362).
IfcVirtualGridIntersection, informal proposition: both
IntersectingAxes “shall be two IfcGridAxis defined by the same
IfcGrid”; the same holds for the PlacementRefDirection
intersection. Two grids are two frames, and choosing one is a guess.
Fields
PlacementRelToConflict
A placement’s stated PlacementRelTo disagrees with the frame IFC4.3
ADD2 says it references (#357, #362).
An IfcLinearPlacement “references the IfcObjectPlacement of the
IfcLinearPositioningElement through IfcLinearPlacement.PlacementRelTo”
(concept Product Linear Placement), and an IfcGridPlacement
references “the ObjectPlacement of the IfcGrid by means of
IfcObjectPlacement.PlacementRelTo”. When the stated frame and the one
the basis curve’s alignment (or the axes’ grid) is placed in resolve
to different transforms, either answer would be a guess.
Fields
Degenerate
The geometry is structurally impossible.
A degenerate direction, a zero-radius circle, a self-referencing boolean. The file parses; the geometry does not exist.
Fields
Units(String)
Units could not be resolved, so coordinates have no defined scale.
LengthUnitUndeclared
The model declares no length unit, so no coordinate has a scale (#585).
Fields
AngleUnitUndeclared
A plane angle was read, and the project declares no PLANEANGLEUNIT
(#585).
UnitUnreadable
A declared project unit cannot be read as an exact factor (#585).
Fields
UnitsAmbiguous
Two candidates for one project unit (#585).
Fields
InvalidAuthoredValue
An authored value was rejected before anything was staged (ADR 0011).
Distinct from Self::Degenerate, which describes an entity that
already exists in a file. Here there is no entity yet and therefore no
id to report: the caller passed a value that could not be written.
Fields
AuthoringSchemaUnbound
A release-aware writer could not bind one known IFC release from the
model’s FILE_SCHEMA: it names an unrecognised release, or several.
A model with no FILE_SCHEMA binds IFC4, like the other authoring
crates. Nothing is staged.
Fields
AuthoringEntityNotInSchema
The model’s declared release does not declare the entity a release-aware writer was asked to author. Nothing is staged.
Implementations§
Source§impl GeometryError
impl GeometryError
Sourcepub fn entity(&self) -> Option<EntityId>
pub fn entity(&self) -> Option<EntityId>
The entity this error is about, when there is one.
Lets a caller collect failures per element rather than aborting a whole file for one bad wall.
Sourcepub fn is_unsupported(&self) -> bool
pub fn is_unsupported(&self) -> bool
Is this “valid IFC we do not handle yet” rather than a broken file?
Callers building a viewer usually want to skip and count these, while treating genuine corruption differently.
Trait Implementations§
Source§impl Clone for GeometryError
impl Clone for GeometryError
Source§fn clone(&self) -> GeometryError
fn clone(&self) -> GeometryError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GeometryError
impl Debug for GeometryError
Source§impl Display for GeometryError
impl Display for GeometryError
Source§impl Error for GeometryError
impl Error for GeometryError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()