Hi @alex
I’m coming back for our geometry viewer.
I have a bug happening only with sketches (received from TopSolid, no problems with other objects as forms). Using the filtering extension, when I hide, it is ok, but when I show back, i have kind of an infinite loop in the console. Which prevent me to code a button.
Here is a really small example (try activate the showObjects line), let me know if you need me to build it on github.
As it happens only with sketches, I have the feeling the error may come from the three.js handling of lines objects?
Thanks!
import {
Viewer,
SpeckleLoader,
CameraController,
UrlHelper,
FilteringExtension,
} from "@speckle/viewer";
async function main() {
const speckleContainer = document.createElement("div");
speckleContainer.id = "speckle-container";
document.body.appendChild(speckleContainer);
const viewer = new Viewer(speckleContainer);
await viewer.init();
const cameraController = viewer.createExtension(CameraController);
cameraController.toggleCameras();
const filtering = viewer.createExtension(FilteringExtension);
const urls = await UrlHelper.getResourceUrls(
"https://app.speckle.systems/projects/d5b671524f/models/75e4788d3e@58fb90f03e"
);
for (const url of urls) {
const loader = new SpeckleLoader(viewer.getWorldTree(), url, "");
await viewer.loadObject(loader, true);
}
filtering.hideObjects(["7a531d10f5d8389f903582e373976dfc"]);
//filtering.showObjects(["7a531d10f5d8389f903582e373976dfc"]);
}
main();