Comparing version 0.0.11 to 0.0.12
{ | ||
"name": "web-ifc", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "ifc loading on the web", | ||
@@ -16,8 +16,8 @@ "main": "web-ifc-api.js", | ||
"gen-schema": "cd schema && node gen.js", | ||
"setup-env": "emsdk_env && npm run gen-schema", | ||
"setup-env": "emsdk_env", | ||
"init-repo": "git clone https://github.com/g-truc/glm ./wasm/deps/glm && git clone https://github.com/mapbox/earcut.hpp ./wasm/deps/earcut && npm run gen-schema", | ||
"build-wasm-debug": "em++ --bind -O3 -g4 --source-map-base http://localhost:5000/web-ifc-js/wasm-lib/ -flto -fno-exceptions wasm/web-ifc-api.cpp -s ALLOW_MEMORY_GROWTH=1 -s FORCE_FILESYSTEM=1 -s EXPORT_NAME=WebIFCWasm -s MODULARIZE=1 -O3 -o lib/web-ifc.js", | ||
"build-wasm-release": "em++ --bind -O3 -flto -fno-exceptions wasm/web-ifc-api.cpp -s ALLOW_MEMORY_GROWTH=1 -s FORCE_FILESYSTEM=1 -s EXPORT_NAME=WebIFCWasm -s MODULARIZE=1 -O3 -o lib/web-ifc.js", | ||
"build-web-ifc-api": "esbuild lib/web-ifc-api.ts --bundle --platform=node --outfile=./dist/web-ifc-api.js", | ||
"build-three-api": "esbuild lib/web-ifc-three.ts --bundle --platform=node --outfile=./dist/web-ifc-three.js --external:three", | ||
"build-ts-api": "tsc --emitDeclarationOnly && npm run build-web-ifc-api && npm run build-three-api", | ||
"build-ts-api": "tsc --emitDeclarationOnly && npm run build-web-ifc-api", | ||
"copy-to-dist": "cpy lib/*.wasm dist && cpy lib/*.map dist && cpy lib/*.js dist && cpy README.md dist && cpy package.json dist", | ||
@@ -35,5 +35,3 @@ "build-release": "npm run build-wasm-release && npm run build-ts-api && npm run copy-to-dist", | ||
"web-ifc-api.js", | ||
"web-ifc-api.d.ts", | ||
"web-ifc-three.js", | ||
"web-ifc-three.d.ts" | ||
"web-ifc-api.d.ts" | ||
], | ||
@@ -40,0 +38,0 @@ "devDependencies": { |
@@ -15,3 +15,3 @@ # web-ifc | ||
The library is header only, the files in `web-ifc-cpp` can be trivially included in any project. The library depends on [GLM](https://github.com/g-truc/glm) and [earcut](https://github.com/mapbox/earcut.hpp), which it expects in a folder `./deps` in the root of the project (pending change). | ||
The library is header only, the files in `web-ifc-cpp` can be trivially included in any project. The library depends on [GLM](https://github.com/g-truc/glm) and [earcut](https://github.com/mapbox/earcut.hpp). | ||
@@ -44,11 +44,21 @@ ## Using the library | ||
## Compiling the library | ||
## Building the library | ||
### C++ executable | ||
### Setting up emscripten | ||
Compiling the library to a standalone executable requires use of CMAKE. For visual studio code, the easiest way is by installing [cmake-tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). | ||
The WASM library is built through emscripten, please see [the emscripten installation guide](https://emscripten.org/docs/getting_started/downloads.html) for information on how to set up emscripten. Afterwards both `setup-env` and `em++` need to be in your path. | ||
### WASM library | ||
The WASM library is built through emscripten, please see [the emscripten installation guide](https://emscripten.org/docs/getting_started/downloads.html) for information on how to set up emscripten. Afterwards the library can be built by using: | ||
`.\wasm_setup_env.bat` and `.\wasm_compile.ps1`. | ||
Run `npm run init-repo` to download both dependencies of the project (glm and earcut.hpp) to the correct location. This only needs to happen once. | ||
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`. | ||
Run `npm run dev` to launch a development server with a basic ifc file viewer. | ||
### Stand alone C++ executable | ||
Compiling the library to a standalone executable requires use of CMAKE. For visual studio code, the easiest way is by installing [cmake-tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). |
Sorry, the diff of this file is not supported yet
437089
63
6
606