built/idl/oce.js
contains the js code for some of the functionalities in oce, please check build/idl/oce.idl
for exposed api.
-
oce 0.17.1
-
emscripten 1.35.0
-
Install emscripten
-
Either use
emcmake cmake
or emscripten cmake toolchain to configure oce. Note that emscripten will not look for your includes and libs installed in your system root, instead, it will search for them in the emscripten root, since emscripten is cross-compiling. So in order to let emscripten find required includes and libs, you need to locate those manually and link them with cmake. Other than the oce Model module, Data Exchange Module and Visualisation Module are also needed. -
emmake make
to build oce.
Tesselator.h
and Tesselator.cxx
provides functionality to export three.js compatible data from oce. They are based on the visualisation module of Python OCC.
A webIDL file allows to use oce functions/classes directly from javascript. The idl example in this repo only contains the interface for functionalities to generate a sphere, to measure its volume and to generate three.js compatible data for visualisation.
python path-to-emscripten/webidl_binder.py sphere.idl glue
Then run make.py
to generate the javascript file, this script is modified based on the one from ammo.js.
See a simple live demo here.
demo
folder contains the demo files.