ThatOpen / engine_components

MIT License
350 stars 134 forks source link

Fragment Highlighter stops working when isolating elements with Fragment Hider #332

Closed RASRC closed 5 months ago

RASRC commented 8 months ago

Describe the bug πŸ“

When I use the FragmentHider to isolate elements, some of them can’t be highlighted in the viewer, even when they are selected or hovered.

Thanks for the support!

Reproduction ▢️

No response

Steps to reproduce πŸ”’

1) Defining a FragmentIdMap with certain elements 2) Isolating those elements with the hider.isolate(FragmentIdMap) method 3) Then some of the elements isolated cannot be selected, hovered or change their appearance with the highlighter

System Info πŸ’»

Windows 11
Google Chrome
npm
openbim-components

Used Package Manager πŸ“¦

npm

Error Trace/Logs πŸ“ƒ

N/A

Validations βœ…

agviegas commented 5 months ago

Hey, this should be solved from @thatopen/components@2.0.17. See:

https://github.com/ThatOpen/engine_components/assets/56475338/fb926834-c81e-47fb-a4e7-a0593de36026

Let us know if you have any issues. Cheers!

agonzalezesteve commented 2 months ago

I'm using @thatopen/components@2.1.18 and I can't select an isolated model.

agviegas commented 2 months ago

@agonzalezesteve using the latest version, and adding the following code to the end of the highlighter tutorial:

const hider = components.get(OBC.Hider);
const classifier = components.get(OBC.Classifier);
classifier.byEntity(model);
const walls = classifier.find({ entities: ["IFCWALLSTANDARDCASE"] });

window.addEventListener("keydown", () => {
  hider.isolate(walls);
});

This is the result:

https://github.com/user-attachments/assets/af4f7b93-c77d-4a8c-abea-f30f9c2a49e4

If this doesn't work for you, or you are doing something else that doesn't work, please let us know and we'll take a look. Keep in mind that you also need to have the corresponding fragments version installed for this to work.