manifold
manifold copied to clipboard
Vector library for JS
I think we have a pretty good generic JS binding API now, but for ManifoldCAD, which is three.js-based, I think it would be quite a bit more ergonomic to have basic vector 2-4 support like GLM gives us in C++. Three.js has this built in (Vector2
, Matrix4
, etc), so it would be nice to bridge across to that so they can be used in our editor rather than bare arrays.
I verified that three's API works, e.g. new THREE.Vector3()
. Now we just need a .d.ts file for it so the editor recognizes it and gives auto-completion.
It seems that @types/three
contains the set of required files, but we should probably bundle them together instead of downloading many files. And we can bundle the files inside the math directory to reduce the download size.
Sounds good to me.