Repository navigation
Conversation
IfcFileReader.decompose() and SpaceBoundaryReader.decompose() rounded the x direction to 3 decimals while the y direction and position kept 5. For a placement rotated by a non-round angle this skews the basis, so the far end of a 10 m element moves by about 2 mm. Round x with the same precision as y. Adds a rotated-placement.ifc fixture and a test that compares the imported world vertices with their analytic positions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Description
Fixes #355.
IfcFileReader.decompose()andSpaceBoundaryReader.decompose()rounded the x direction of each transform to 3 decimals while the y direction and position kept 5. For placements rotated by a non-round angle this skews the basis, so elements drift up to ~0.5 mm per metre. This rounds x with the same precision as y (ap).Side effect: local-transform dedup hashes now keep x at 5 decimals, like y, so a model can get slightly more distinct local transforms.
FragmentsModels/src/edit/element.tsalso hasconst p = 1000, but there it is only a change-detection check, so it is left alone.How it was tested
resources/ifc/rotated-placement.ifc: one 10 m extruded box placed at 10° about Z.ifc-file-reader.test.tsimports it and compares every world vertex (transformapplied,getCoordinates()subtracted) with the analytic corners, tolerance 0.1 mm.yarn install/ vitest in my environment, so the suite was not run locally. Instead I applied the same edit to a copy of the published 3.6.1dist/index.cjsand ran the same check with Node and web-ifc 0.0.78 on the fixture: max vertex error 2.0 mm before, 0.022 mm after.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following:
🤖 Generated with Claude Code