manifold icon indicating copy to clipboard operation
manifold copied to clipboard

Vector library for JS

Open elalish opened this issue 2 years ago • 1 comments

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.

elalish avatar Oct 10 '22 15:10 elalish

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.

elalish avatar Oct 14 '22 15:10 elalish

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.

pca006132 avatar Dec 22 '22 10:12 pca006132

Sounds good to me.

elalish avatar Dec 22 '22 22:12 elalish