jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.65k stars 514 forks source link

feat(modeling): rework orthonormal formula #1214

Closed z3dev closed 1 year ago

z3dev commented 1 year ago

These changes rework the old orthonormal basis class into a common usable, fully tested class; OrthonormalFormula

This new class has been moved to math/utils/OrthonormalFormula.js, as well as creating a new test suite.

All Submissions:

z3dev commented 1 year ago

@platypii please take a look at the first take of the rework. this is now a real class with real methods.

next up, i want to rename this to OrthonormalFormula, as that's the real functionality, i.e. the formula allows sets of vectors (basis) to be converted to and from an orthonormal basis.

second, i will rework again to use a set for storing/returning 3D vertices, just like the little class in earcut.

third, i will optimize the creation of vectors, and calculations.

forth, i will add test cases.

any other requests?

z3dev commented 1 year ago

@platypii this is ready now. please review.

i believe that OrthonormalFormula can also be used by earcut as well. Maybe a separate pull request?

z3dev commented 1 year ago

@platypii sorry for the delay. i finally got back to JSCAD. please review.