OpenMesh binding via node-addon-napi
Node.js wrapper for OpenMesh C++ library using node-addon-api.
TriMesh-js is a Node.js addon, written in C++, that can be loaded into Node.js using the require() function, and used just as if they were an ordinary Node.js module.
The aim of the project is to provide a FFI between JavaScript running in Node.js and OpenMesh C++ library.
Before starting to use this you need to assure you have the following prerequisites:
- Node.js: see download and install Node.js Node.js 14.0 or higher is required.
- node-gyp: see node-gyp
Another Option is Cmake to use CMake.js to build the addon
- CMake: see CMake download
- A proper C/C++ compiler tool: For Mac OS, can be Clang/GCC or CMake/make
- OpenMesh C++: see guide compiling OpenMesh
or you can easily install via brew
brew install open-mesh
To view the examples, check AddonTriMeshTest.js
Plugins implementation - TriMesh:
- Init a TriMesh
- Add Vertex
- Add Face By Vertex Id
- Set Point By Vertex Id
- Add Face
- Set Point
- Get Points
- VertexVertexIter (to find neighbouring vertex)
- BFS NeighWeights (loop through the whole mesh)
- More Pending ...
There is a basic test file under /test folder using mocha with assert.