Repository navigation
Conversation
IfcFileReader reported the coordination matrix only from the mesh callback, but GridReader always premultiplies every grid placement by it. A model that has no meshes (e.g. a grids-only IFC) kept identity coordinates while its grids were shifted, so FragmentsModels placed them off by the whole shift. Move the reporting into one helper and also call it before reading the grids, so the coordinates always match the shift the grids were given. Adds a grids-only-georeferenced.ifc fixture and a test that checks a grid's origin minus the model coordinates equals its IFC world placement. 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 #356.
IfcFileReaderreported the coordination matrix as the model's coordinates only from theStreamMeshescallback, butGridReaderalways premultiplies every grid placement by that matrix. A model with no meshes (e.g. a grids-only IFC) kept identity coordinates while its grids were shifted, soFragmentsModelsplaced them off by the whole shift.This moves the reporting into one helper,
loadCoordinates(), called from the mesh callback as before and once more right beforeGridReaderruns. It is a no-op once coordinates were reported, so models with meshes are unchanged.How it was tested
resources/ifc/grids-only-georeferenced.ifc: a site at (500 km, 200 km, 12 m), one grid 10 m / 20 m / 3 m from it with aFootPrintcurve representation, and no other elements.grid-reader.test.tschecks that the coordinates are non-zero and that the grid's transform origin minus the coordinates equals its IFC world placement in three.js axes,(500010, 15, -200020).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:(0, 0, 0)and an error of 500 km before;(-500010, -15, 200020)and an error of 1e-11 m after.grids-baseline.ifc,just_wall.ifc,school_str.ifc,dedup_repro.ifc: same coordinates before and after.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following:
🤖 Generated with Claude Code