Repository navigation
feat(ifc-geometry)!: refuse models without a declared length unit - #586
Merged
Merged
Conversation
Four typed refusals for a model whose units have no usable scale (#585).
IFC defines no default length or plane angle unit and UnitsInContext is optional on IfcContext in IFC4, so resolve assumed a scale the file never stated. resolve now returns a typed refusal; a missing angle unit is refused only where an angle is read. IfcMeasureWithUnit values are read in their UnitComponent; unknown SI prefixes and misnamed SI units are refused. UnitScale::default is replaced by UnitScale::SI. Refs #585.
…units Product geometry entry points carry the unit refusal on every requested product instead of placing the model in metres. Refs #585.
Models and fixtures that declare no units read in UnitScale::SI or through tests/support/assume_units.rs; the committed fixtures are unchanged. Adds the #585 repro and reworks units_on_fixtures to count resolved and refused fixtures.
error.rs crossed the 800-line limit with the unit refusals.
Inline models state a metre and a radian; a model without a length unit refuses each product's placement with invalid-model. Refs #585.
AlignmentUnits::angle_to_radians is optional. A StartDirection without a plane-angle unit refuses with AngleUnitUndeclared; length-only bridges (linear placements, seam tolerance) no longer need one. ifc-geometry maps the refusal back to GeometryError::AngleUnitUndeclared.
…eferred A Cartesian-preferred conic trim with a point needs no plane-angle unit.
…ansform world_transform resolves the project units first so a model without units reports LengthUnitUndeclared. The fixture corpus test asserts lower bounds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
units::resolve now returns GeometryResult and refuses instead of assuming metres:
Facade: a model whose units do not resolve refuses every product with that error; bindings map it to invalid-model.
Breaking: ifc-geometry 0.32.0, openbim-ifc 0.39.0 at release.
Closes #585