At a high level, the framework is divided into three parts - a flexible halfedge mesh data structure, an optimized linear algebra package (based on Eigen), and code for various geometry processing algorithms. Each algorithm comes with its own viewer for rendering.
Detailed documentation and unit tests for each of these parts can be found in the docs and tests directories of this repository.
We're just getting rolling here, so stay tuned for more! :-)
// assign an index to each vertex of the mesh let vertexIndex = indexElements(geometry.mesh.vertices); // build cotan-Laplace and mass matrices let A = geometry.laplaceMatrix(vertexIndex); let M = geometry.massMatrix(vertexIndex); let rhs = M.timesDense(rho); // solve Poisson equation with a given right-hand side rhs let llt = A.chol(); let phi = llt.solvePositiveDefinite(rhs);
Read the online docs here to get a sense of how geometry-processing-js works. (A list of modules and classes can be found in the menu at top). The quickest way to start playing around is to modify one of the existing examples (in the projects subdirectory); small usage examples for individual classes can be found throughout the documentation.
Here are some slides from a short tutorial at the AMS Short Course on Discrete Differential Geometry.
git clone https://github.com/geometrycollective/geometry-processing-js.git cd geometry-processing-js/projects
Linear Algebra - A wrapper around the C++ library Eigen compiled to asm.js with emscripten. Future updates will compile the more optimized sparse matrix library Suitesparse to asm.js. (Note that this wrapper can also be used for other, non-geometric projects which seek to use Eigen on the web; you can find the standalone release here)
Rendering - three.js
This work is supported in part by National Science Foundation award #1717320. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation