Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FragmentGroup.uuid should not be tied to projectGuid #209

Closed
5 tasks done
vulevukusej opened this issue Dec 11, 2023 · 7 comments
Closed
5 tasks done

FragmentGroup.uuid should not be tied to projectGuid #209

vulevukusej opened this issue Dec 11, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@vulevukusej
Copy link

Describe the bug 📝

It's common in larger projects to split up a project into smaller, seperate files. These file all have the same IfcProject and thus the same projectGuid. This causes an issue in components, since it seems the fragmentGroup uuid is taken from the project guid.

Reproduction ▶️

No response

Steps to reproduce 🔢

No response

System Info 💻

openbim-components

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • Check that this is a concrete bug. For Q&A join our Community.
  • The provided reproduction is a minimal reproducible example of the bug.
@vulevukusej vulevukusej added the bug Something isn't working label Dec 11, 2023
@HoyosJuan
Copy link
Member

HoyosJuan commented Dec 13, 2023

Hey @vulevukusej,

You're totally right! It was a decision we made at the time to set the IfcProject GUID as the FragmentsGroup.uuid without taking into account the splitting of one authoring model into several IFC files (in fact, I do it quite often).

Sadly, at the time being the IFC schema doesn't come with a GUID to identify the model as seen in buildingSMART/NextGen-IFC#67 (quite old issue but apparently still unresolved?). We basically had two options:

  1. Generate a GUID completely decoupled from the IFC file.
  2. Use the GUID from some root level entity. We choose IfcProject.

Being that said, you think we should stick to the first option? It will surely help avoid issues in many of the library tools that identify the model using FragmentsGroup.uuid. Also, do you have any other suggestion for this? If you don't, then we would go back to the autogenerated GUID decoupled from the IFC file. At least, if you export the Fragments their ID would remain the same.

Thank you so much!

@vulevukusej
Copy link
Author

vulevukusej commented Dec 14, 2023

Hey @HoyosJuan - I'm not sure what the purpose of the FragmentsGroup.uuid is other than to uniquely it identify amongst other FragmentGroups? In that case, why do we need more complexity than the filename itself? I modified the code to make the uuid = filename and I've found it to work perfectly. If a user tries to import a model with the same filename this is rejected and the user is appropriately informed. An IfcProject refers to the project conceptually and not the file which is why a guid there makes much more sense to me. In any case, just my 2 cents :)

@NiklasPor
Copy link

NiklasPor commented Dec 19, 2023

I think it'd be nice if the UUID of the fragment group would stay stable, when the same ifc file is opened again later. Currently we're using expressId + fragmentGroup.uuid to uniquely identify elements inside models. (For example to save selections and restore them later when the model is opened again). How could one achieve that, when the fragment group id would be dynamically generated?

@vulevukusej
Copy link
Author

vulevukusej commented Dec 19, 2023

@NiklasPor why not just use the object guid from IFC for that? It's guaranteed to be unique across projects

@NiklasPor
Copy link

NiklasPor commented Dec 19, 2023

Actually a good idea. I'd just have to build up a Map when a new model is loaded, which maps the element guids to the data we currently fetch with expressId + fragmentGroup.uuid 👍

(or search through all fragment groups with IfcPropertiesUtils.findItemByGuid(group.properties, guid) and cache the result. (Just checked the implementation, it also just iterates over all properties 😄 )`

@vulevukusej
Copy link
Author

vulevukusej commented Dec 19, 2023

Yup that's what I did 👍

@agviegas
Copy link
Contributor

In the latest versions we have decoupled the FragmentsGroup uuid from the project guid, so I'm closing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants