Comments (2)
Sorry for late reply. I can confirm that the problem seems to be solved in the latest version.
And thanks for the hint on the setVisibility method. This solved another issue I had with elements behind a hidden element not being loaded from the culler.
I am looking forward to the staticFragments property of the streamer since this will solve many problems I'm facing when trying to control styling of the streamed scene! This is also needed when isolating objects in the scene. I tried to achieve that with the setVisibility (1. use hider to hide all, 2. use setVisibility to make specific elements visible) but it only works until you pan the scene and new elements become visible..
from components.
Hey @MadsHolten this might be already solved in the latest version. The reason might be that that trying to set the visibility of a fragment passing IDs that it doesn't have returned an error before. Now it just skips them.
So I can't reproduce it anymore adding the following code to the streamer tutorial:
const highlighter = components.get(OBCF.Highlighter);
highlighter.add("example", new THREE.Color(1, 0, 0));
const hider = components.get(OBC.Hider);
loader.onFragmentsLoaded.add((frags) => {
const fragments = components.get(OBC.FragmentsManager);
const model = Array.from(fragments.groups.values())[0];
const map = model.getFragmentMap([186]);
const keys = new Set(Object.keys(map));
let found = false;
for (const frag of frags) {
if (keys.has(frag.id)) {
found = true;
}
}
if (found) {
highlighter.highlightByID("example", map);
}
hider.isolate(map);
hider.set(true);
});
This is the result:
2024-07-18.17-40-57.mp4
Now, just FYI, if you want to hide elements using streaming, there is a specific setVisibility method that makes it simpler, and also avoids streaming fragments that are fully invisible. We could add an isolate
method in the future if that's useful.
As for highlighting, I'm going to take care of this feature by adding a staticFragments
property to the streamer that are forced to be streamed and never unloaded from memory until removed from that list. That should make it easier, as you won't have to update the highlighter in the onFragmentsLoaded
event, and all highlighted elements will be forced to be visible. That will probably also help you.
Let me know if the issue persists on your end. Cheers!
from components.
Related Issues (20)
- 2D Plans problem HOT 8
- Issue using "@thatopen/components" when using watchify HOT 3
- ClipEdges is not working anymore HOT 2
- Config optional to unloadLostGeometries and toHide when using culler for IfcStreamer. HOT 4
- IfcStreamer load multiple json files
- Camera controls broken if the zoom distance is too high HOT 1
- Multiple Building Not in Center HOT 3
- Fragment loading fails with large IFC file HOT 5
- Consistency in process and language in the documentation
- Highlighter - Improving events
- Display IFCGRID in 3D view HOT 3
- Highlighter - AutoToggle is active during function highlighter.highlightByID HOT 2
- Each CullerRenderer creates a new WebGL context HOT 7
- Possible memory leak when disposing HOT 1
- some IFC mesh elements not being properly processed with ifcLoader HOT 10
- Static Errors class to throw and document all errors in the library
- Same model twice breaks the scene (with culler in place) HOT 2
- Investigate "Please ignore" messages in tree in umdasch 700MB model
- I generated tile json files using IfcGeometriyTiler, but I don't know how to use these files HOT 2
- npm i @thatopen/fragments errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from components.