Define the origin of the model as being the origin of one site
See original GitHub issueContext
-When the site origin is far far away from the world origin, some discrepancies appear in the 3D geometry (example : https://github.com/IFCjs/web-ifc-three/issues/30).
-Thanks to the COORDINATE_TO_ORIGIN:true
config, a new model’s origin is computed (let’s call it IFCjs origin), the model is loaded in Three.js with the origin positioned at (0,0,0), and the discrepancies disappeared.
- From the ifcAPI.GetCoordinationMatrix, we can access to the IFCjs origin in the world coordinates system.
Problems
Problem 1
- The discrepancies do not disappear for all the models.
- Example : station.ifc.zip
Problem 2
- Use case : I need to load several models sharing the same ifcSite in three.js.
- Problem : I have to compute one additional translation based on the ifcSite origin position for each model in order to place them correctly with respect to each other.
Possible solution to solve 1 & 2
Solving Problem 1
- When I manually modify the ifc file, taking (0,0,0) for the ifcSite position coordinates, all the discrepancies disappear.
- Here is the modified ifc. Just one line changed : (expressID: 638645) station_0.ifc.zip

Solving Problem 2
- Setting the ifcSite position to (0,0,0), the model geometry is located at the right place for models that share the same ifcSite.
=> Solution
- With one new loading option, the model would be loaded as if we would have manually reset the ifcSite origin to 0,0,0 (cf scenario 3).
- In real life, I’ve been mosty working with ifc file with only one site (export from Revit…). However, since we may have several sites in one ifc file, we could specify the site to be set at the origin.

Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Understanding "same-site" and "same-origin" - web.dev
"Origin" is a combination of a scheme (also known as the protocol, for example HTTP or HTTPS), hostname, and port (if specified). For...
Read more >Same-origin policy - Wikipedia
An origin is defined as a combination of URI scheme, host name, and port number. This policy prevents a malicious script on one...
Read more >Same-origin policy - Web security | MDN
Each origin gets its own separate storage, and JavaScript in one origin cannot read from or write to the storage belonging to another...
Read more >RFC 6454: The Web Origin Concept
It also defines an HTTP header field, named "Origin", that indicates which origins are associated with an HTTP request. Information about the current...
Read more >Prototype Definition & Meaning - Merriam-Webster
noun ; 1 · an original model on which something is patterned : archetype ; 2 · an individual that exhibits the essential...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @tomvandig, as far as I’m concerned, in the vast majority of the ifc files used in a construction project, there is only one ifcSite. So taking the first (and only one) site will definitely solve 99% of the use cases. For the edge cases were there are several ifcSites, well, it’s not really a pb : the user will be able to translate the model afterwards from the ifcSite locationPlacement.
In other words, we could have 2 options (already implemented) + 1 additional option to load the model :
Please keep in mind that I’m looking for a programmatic solution to avoid the manual settings of the ifcSite coordinates to 0,0,0 that do solve geometry discrepancies in the model I’m using.
What do you think ?
Hello, I opened this issue which seems quite close : https://github.com/tomvandig/web-ifc/issues/91