npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qaecy-obc-1.5.0

v0.0.3

Published

This is a library that implements [That Open Company](https://thatopen.com/)'s IFC viewing capabilities (Open BIM Components) in one web component.

Downloads

6

Readme

QAECY OBC

This is a library that implements That Open Company's IFC viewing capabilities (Open BIM Components) in one web component.

There web component supports several ways to load a model, which from slowest to fastest covers 1) raw IFC, 2) IFC converted to Fragments and 3) IFC converted to QAECY's customized Tiles implementation.

Use

npm i qaecy-obc-1.5.0

<qaecy-tile-streamer id="viewer" bucketURL="https://my-bucket/"></qaecy-tile-streamer>

NB! This is a rather large build of approximately 4.3 MB (844 KB gzipped)

Loading model data

Loading an IFC

The simplest and least performant way to load a file is from an IFC. This processes the file using the web-ifc wasm module and converts it to a ThreeJS compliant Fragments file.

The optional parameters modelUUID and idMap are necessary to fetch server data about model entities. QAECY derives the modelUUID from the IFC file content which makes it unique for every IFC and important for history tracking. The idMap maps expressIDs used internally by OBC to element UUIDs used by qaecy.

const viewer = document.getElementById("viewer");
const modelUUID = "9481b101-5a11-4d36-b8bf-710559ab64b2";
const idMap = {
   "1": "29b3e491-76b9-535d-a699-af6ddc5e6d16",
   "5": "ac377c7c-0e1c-5cf4-b29d-b71f9f15ed25",
   "35": "761cfe32-9f76-5a7d-8c65-1e31f047caf4",
   ...
}
await viewer.loadIFC(new Uint8Array(ifcArrayBuffer), modelUUID, idMap);

Loading a Fragments file

This approach skips the IFC-Fragments conversion and loads the Fragments file directly.

Viewer, modelUUID and idMap are the same as when loading an IFC.

await viewer.loadFragments(new Uint8Array(fragmentsArrayBuffer), modelUUID, idMap);

Loading Tiles

The Tiles loading is the most efficient way as it only loads the parts of the model that are visible in the current view. In this approach the model data is located on a server and only the instructions on how to access them are given to the loader. The GeometryData interface describes what these instructions contain and in QAECY's setup it's usually generated from a query on the triplestore.

await viewer.loadStream(geometryData);

Functionality

Highlighter/Selection

The default behavior is that multi selection is enabled, but highlighter can be configured, styled and disabled through settings.

When clicking an element or the canvas, the "selection-changed" event will be emitted. To listen to this event, simply use a standard JavaScript event listener:

const viewer = document.getElementById("viewer");
viewer.addEventListener('selection-change', (event) => {
   console.log('Selection changed:', event.detail);
});

The data emitted reflects both the element and model UUID which means that it is possible to have multiple (historical) representations of the same element in the same viewer.

alt text