You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I added a highlighter with an outline on click. I would expect that the outline closely matches the BIM element, but the outline in some cases is way off the actual element.
This seems to be apparent only when you are streaming 2+ IFC files one on top of another. For a single streamed IFC file it seems to be working fine.
Screen.Recording.2024-09-23.at.17.29.44.mov
Reproduction ▶️
No response
Steps to reproduce 🔢
Here's a react component I used to show the problem.
import{useEffect,useRef}from"react";importStatsfrom"stats.js";import*asOBCfrom"@thatopen/components";import*asOBCFfrom"@thatopen/components-front";import*asTHREEfrom"three";constBIMStreamingComponent=()=>{constcontainerRef=useRef(null);useEffect(()=>{constcomponents=newOBC.Components();constworlds=components.get(OBC.Worlds);constworld=worlds.create<OBC.SimpleScene,OBC.SimpleCamera,OBCF.PostproductionRenderer>();world.scene=newOBC.SimpleScene(components);if(containerRef.current)world.renderer=newOBCF.PostproductionRenderer(components,containerRef.current);world.camera=newOBC.SimpleCamera(components);components.init();if(world.renderer)world.renderer.postproduction.enabled=true;world.scene.setup();world.camera.controls.setLookAt(12,6,8,0,0,-10);constgrids=components.get(OBC.Grids);grids.create(world);// Make the background of the scene transparentworld.scene.three.background=null;consthighlighter=newOBCF.Highlighter(components);highlighter.setup({ world });constoutliner=components.get(OBCF.Outliner);outliner.world=world;outliner.enabled=true;outliner.create("hightlightOutline",newTHREE.MeshBasicMaterial({color: 0xbcf124,transparent: true,opacity: 0.5,}));highlighter.events.select.onHighlight.add((fragIdMap)=>{outliner.clear("hightlightOutline");outliner.add("hightlightOutline",fragIdMap);});// Get the IFC streamerconstloader=components.get(OBCF.IfcStreamer);loader.world=world;// Set the base URL for the streamerloader.url="https://wbuploadsdev.blob.core.windows.net/wb-uploads-dev/38/";constuuids: string[]=[];// Function to stream the given modelconstloadModel=async(geometryURL: string,propertiesURL: string|undefined)=>{constrawGeometryData=awaitfetch(geometryURL);constgeometryData=awaitrawGeometryData.json();letpropertiesData;if(propertiesURL){constrawPropertiesData=awaitfetch(propertiesURL);propertiesData=awaitrawPropertiesData.json();}constmodel=awaitloader.load(geometryData,true,propertiesData);console.log(model);model.items;uuids.push(model.uuid);};constmodels=[["https://wbuploadsdev.blob.core.windows.net/wb-uploads-dev/38/fgpaj1-420pohistvoifc-geometries-streaming.json","https://wbuploadsdev.blob.core.windows.net/wb-uploads-dev/38/fgpaj1-420pohistvoifc.ifc-processed-properties.json",],["https://wbuploadsdev.blob.core.windows.net/wb-uploads-dev/38/fgpaj1-420gradbena-delaifc-geometries-streaming.json","https://wbuploadsdev.blob.core.windows.net/wb-uploads-dev/38/fgpaj1-420gradbena-delaifc.ifc-processed-properties.json",],];models.forEach((model)=>{// Start streaming the modelloadModel(model[0],model[1]);});// Update the scene each time the user stops the cameraworld.camera.controls.addEventListener("sleep",()=>{loader.culler.needsUpdate=true;});// Enable caching for the loaderloader.useCache=true;// Customize the loaderloader.culler.threshold=0.00000001;loader.culler.maxHiddenTime=100000000;loader.culler.maxLostTime=300000000;},[]);return(<divid="container"ref={containerRef}style={{width: "100%",height: "100vh"}}></div>);};exportdefaultBIMStreamingComponent;
System Info 💻
Using latest:
"@thatopen/fragments": "^2.2.0",
"@thatopen/components": "^2.2.11",
"@thatopen/components-front": "^2.2.2",
### Used Package Manager 📦
npm
### Error Trace/Logs 📃
_No response_
### Validations ✅
- [X] Read the [docs](https://docs.thatopen.com/intro).
- [X] Check that there isn't [already an issue](https://github.com/ThatOpen/engine_components/issues) that reports the same bug to avoid creating a duplicate.
- [X] 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](https://github.com/mrdoob/three.js) instead.
- [X] Check that this is a concrete bug. For Q&A join our [Community](https://people.thatopen.com/).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
The text was updated successfully, but these errors were encountered:
This issue is same for me, it happens when we use multiple models and it happens for non-first models. Hightlight is ok but Outliner draws at wrong place.
Describe the bug 📝
So, I added a highlighter with an outline on click. I would expect that the outline closely matches the BIM element, but the outline in some cases is way off the actual element.
This seems to be apparent only when you are streaming 2+ IFC files one on top of another. For a single streamed IFC file it seems to be working fine.
Screen.Recording.2024-09-23.at.17.29.44.mov
Reproduction▶️
No response
Steps to reproduce 🔢
Here's a react component I used to show the problem.
System Info 💻
The text was updated successfully, but these errors were encountered: