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

@cadwork/web-ifc

v0.0.44-1

Published

ifc loading on the web

Downloads

23

Readme

Build npm opencollective

web-ifc is a javascript library to read and write ifc files, at native speeds. web-ifc is part of the ifc.js project, which aims to lower the threshold for developing open BIM applications.

Status

Although it is quite stable and fast already, web-ifc is in pre-alpha status until ifc support matures. The list of currently supported ifc elements, or level of support for different ifc types, is an undocumented work in progress.

Depending on your models, web-ifc may be quick and correct, or slow and broken. If your model does not work as expected please raise an issue and attach the model if possible, or contact us and we can discuss passing the model confidentially.

Install

npm install web-ifc

Quick setup

const WebIFC = require("web-ifc/web-ifc-api.js");

// initialize the API
const ifcApi = new WebIFC.IfcAPI();

// initialize the library
await ifcApi.Init();

// open a model from data
let modelID = ifcApi.OpenModel(/* IFC data as a string or UInt8Array */, /* optional settings object */, );

// the model is now loaded! use modelID to fetch geometry or properties
// checkout examples/usage for some details on how to read/write IFC

// close the model, all memory is freed
ifcApi.CloseModel(modelID);

See examples for more details on how to use web-ifc.

Current Build

The current live build of web-ifc is avaialble here. Using this allows you to test newest fixes before we make a release. If you wish to use this version then download the zip file and place the contents of the dist folder manually into your node_modules/web-ifc folder. I.e if you are using web-ifc-three then it will be node_modules/web-ifc-three/node_modules/web-ifc. Please not you must replace the javascript and the WASM.

Requirements

These are the requirements needed to build web-ifc (only for those that wish to build their own version).

  1. Node v16 or later
  2. NPM v7 or later
  3. EMSCRIPTEN v3.1.44 or later
  4. CMAKE v3.18 or later

Building WASM module

Setting up emscripten and build system

The WASM library is built through emscripten, please see the emscripten installation guide for information on how to set up emscripten. Afterwards emsdk_env needs to be in your path.

To build the WASM you also need CMAKE see here and (on windows) MINGW see here - once installed (and in your path) run npm run setup-mingw to configure the environment for web-ifc.

WASM library

Run npm install to install all dependencies.

Run npm run setup-env whenever you open a new terminal, this will set up the required emscripten environment variables for you to compile code.

Run npm run build-release to build a release version of the wasm binary and the accompanying web-ifc api. It will be placed in ./dist.

If you wish to build the WASM with debugging enabled you can run npm run build-debug. This will enable you to inspect debugging information better when running web-ifc.

Run npm run dev to launch a development server with a basic ifc file viewer.

Stand alone C++

Although the primary focus of the library is to be used through WebAssembly in the browser/nodejs, the project can be used stand-alone as a c++ library or executable. See here for a simple entry point to get started.

Contributing

Want to help out? Great!

Please checkout our contribution suggestsions.