GithubHelp home page GithubHelp logo

brianrspears / web-ifc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thatopen/engine_web-ifc

0.0 0.0 0.0 45.24 MB

Reading and writing IFC files with Javascript, at native speeds.

Home Page: https://ifcjs.github.io/web-ifc/examples/viewer/index.html

License: Mozilla Public License 2.0

JavaScript 31.32% C++ 28.72% C 0.77% TypeScript 39.07% HTML 0.03% CMake 0.09% Dockerfile 0.01%

web-ifc's Introduction

ifc.js | documentation | demo | discord | usage examples | npm package | contributing

web-ifc

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, please share any problematic models so I can take a look :)

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.

Building WASM module

Setting up emscripten

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.

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-all to build a release version of the wasm binary and the accompanying web-ifc api. It will be placed in ./dist.

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.

web-ifc's People

Contributors

tomvandig avatar agviegas avatar quimmoya avatar kovacsv avatar makc avatar vegarringdal avatar harrycollin avatar pablo-mayrgundter avatar deadman2000 avatar xceno avatar awmartin avatar ajaxjiang96 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.