question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Define the origin of the model as being the origin of one site

See original GitHub issue

Context

-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. Capture d’écran 2021-09-20 à 11 31 02

Problems

Problem 1

  • The discrepancies do not disappear for all the models.
  • Example : station.ifc.zip Capture d’écran 2021-09-20 à 11 41 17

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
Capture d’écran 2021-09-20 à 11 54 59

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.
Capture d’écran 2021-09-20 à 12 01 26

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
favreau84commented, Sep 29, 2021

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 :

  • coordinate_to_origin = false
  • coordinate_to_origin = true And
  • first_site_as_origin = true (or something like that 😃 )

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 ?

0reactions
loicroyboncommented, Oct 18, 2021

Hello, I opened this issue which seems quite close : https://github.com/tomvandig/web-ifc/issues/91

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found