diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3a03d01 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,60 @@ +name: geometry-processing - Continuous Integration + +on: + push + +jobs: + test: + name: Run Unit Tests + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + lfs: true + + - name: Install Testing Frameworks + run: | + echo '{ "type": "module", "scripts": { "test": "mocha tests/**/*.js --reporter mocha-github-actions-reporter" } }' >package.json + npm install --save-dev mocha chai mocha-github-actions-reporter + + - name: Run Unit Tests + timeout-minutes: 5 + run: npm test + + docs: + name: Build Docs + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + lfs: true + + - name: Install Doc Generation Frameworks + run: | + echo '{ "type": "module", "scripts": { "docs": "jsdoc -c doc-config/jsdoc.conf.json -t node_modules/ink-docstrap/template/ -R README.md -r -d docs ./" } }' >package.json + npm install --save-dev jsdoc ink-docstrap + + - name: Pre-Process Docs + run: | + cp doc-config/site.cosmo-rohan.css node_modules/ink-docstrap/template/static/styles/site.cosmo-rohan.css + + - name: Generate Docs + run: npm run docs + + - name: Post-Process Docs + run: sed -e 's/imgs\//..\/imgs\//g' docs/index.html > docs/index.html.tmp && mv docs/index.html.tmp docs/index.html + + - name: Commit Updated Docs + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Actions" + git add docs + git diff-index --quiet HEAD || git commit -m "Rebuild Docs" + + - name: Push Changes to branch + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} diff --git a/core/corner.js b/core/corner.js index 7aef8f1..d59ff3e 100644 --- a/core/corner.js +++ b/core/corner.js @@ -1,5 +1,3 @@ -"use strict"; - class Corner { /** * This class represents a corner in a {@link module:Core.Mesh Mesh}. It is a convenience @@ -58,3 +56,5 @@ class Corner { return this.index; } } + +export default Corner; \ No newline at end of file diff --git a/core/discrete-exterior-calculus.js b/core/discrete-exterior-calculus.js index d89cf07..d2914f0 100644 --- a/core/discrete-exterior-calculus.js +++ b/core/discrete-exterior-calculus.js @@ -1,7 +1,9 @@ -"use strict"; +import LinearAlgebra from '../linear-algebra/linear-algebra.js'; +let SparseMatrix = LinearAlgebra.SparseMatrix; +let Triplet = LinearAlgebra.Triplet; /** - * This class contains methods to build common {@link https://cs.cmu.edu/~kmcrane/Projects/DDG/paper.pdf discrete exterior calculus} operators. + * This class contains methods to build common {@link https://www.cs.cmu.edu/~kmcrane/Projects/DDG/paper.pdf discrete exterior calculus} operators. * @memberof module:Core */ class DEC { @@ -124,3 +126,5 @@ class DEC { return SparseMatrix.fromTriplet(T); } } + +export default DEC; \ No newline at end of file diff --git a/core/edge.js b/core/edge.js index dc87ad5..2501f9b 100644 --- a/core/edge.js +++ b/core/edge.js @@ -1,5 +1,3 @@ -"use strict"; - class Edge { /** * This class represents an edge in a {@link module:Core.Mesh Mesh}. @@ -30,3 +28,5 @@ class Edge { return this.index; } } + +export default Edge; \ No newline at end of file diff --git a/core/face.js b/core/face.js index 7b555eb..1b4cbea 100644 --- a/core/face.js +++ b/core/face.js @@ -1,5 +1,3 @@ -"use strict"; - class Face { /** * This class represents a face in a {@link module:Core.Mesh Mesh}. @@ -306,4 +304,6 @@ class FaceCornerIterator { } } } -} \ No newline at end of file +} + +export default Face; \ No newline at end of file diff --git a/core/geometry.js b/core/geometry.js index b66e054..0050e04 100644 --- a/core/geometry.js +++ b/core/geometry.js @@ -1,4 +1,10 @@ -"use strict"; +import LinearAlgebra from '../linear-algebra/linear-algebra.js'; +let Vector = LinearAlgebra.Vector; +let Complex = LinearAlgebra.Complex; +let SparseMatrix = LinearAlgebra.SparseMatrix; +let Triplet = LinearAlgebra.Triplet; +let ComplexSparseMatrix = LinearAlgebra.ComplexSparseMatrix; +let ComplexTriplet = LinearAlgebra.ComplexTriplet; class Geometry { /** @@ -245,7 +251,7 @@ class Geometry { /** * Computes the circumcentric dual area of a vertex. - * @see {@link http://cs.cmu.edu/~kmcrane/Projects/Other/TriangleAreasCheatSheet.pdf} + * @see {@link http://www.cs.cmu.edu/~kmcrane/Projects/Other/TriangleAreasCheatSheet.pdf} * @method module:Core.Geometry#circumcentricDualArea * @param {module:Core.Vertex} v The vertex whose circumcentric dual area needs to be computed. * @returns {number} @@ -572,3 +578,5 @@ function normalize(positions, vertices, rescale = true) { } } } + +export { Geometry, normalize }; \ No newline at end of file diff --git a/core/halfedge.js b/core/halfedge.js index 202f902..fc3cdbd 100644 --- a/core/halfedge.js +++ b/core/halfedge.js @@ -1,5 +1,3 @@ -"use strict"; - /** * This module implements a halfedge mesh data structure and its associated geometry. * A halfedge mesh stores mesh elements such as vertices, edges and faces as well as @@ -58,3 +56,5 @@ class Halfedge { return this.index; } } + +export default Halfedge; \ No newline at end of file diff --git a/core/mesh-subset.js b/core/mesh-subset.js index cc0f947..f54ff90 100644 --- a/core/mesh-subset.js +++ b/core/mesh-subset.js @@ -1,5 +1,3 @@ -"use strict"; - class MeshSubset { /** * This class represents a subset of a {@link module:Core.Mesh Mesh} @@ -212,3 +210,5 @@ class MeshSubset { return true; } } + +export default MeshSubset; \ No newline at end of file diff --git a/core/mesh.js b/core/mesh.js index 8bf01fd..852ee76 100644 --- a/core/mesh.js +++ b/core/mesh.js @@ -1,4 +1,8 @@ -"use strict"; +import Vertex from './vertex.js'; +import Edge from './edge.js'; +import Face from './face.js'; +import Halfedge from './halfedge.js'; +import Corner from './corner.js'; class Mesh { /** @@ -207,7 +211,7 @@ class Mesh { } // index elements - this.indexElements(); + this.indexElements(); return true; } @@ -401,3 +405,5 @@ function indexElements(elementList) { return index; } + +export { Mesh, indexElements } \ No newline at end of file diff --git a/core/vertex.js b/core/vertex.js index d9708ae..d3980b6 100644 --- a/core/vertex.js +++ b/core/vertex.js @@ -1,5 +1,3 @@ -"use strict"; - class Vertex { /** * This class represents a vertex in a {@link module:Core.Mesh Mesh}. @@ -335,4 +333,6 @@ class VertexCornerIterator { } } } -} \ No newline at end of file +} + +export default Vertex; \ No newline at end of file diff --git a/doc-config/jsdoc.conf.json b/doc-config/jsdoc.conf.json index 435d2e4..94cea71 100644 --- a/doc-config/jsdoc.conf.json +++ b/doc-config/jsdoc.conf.json @@ -26,6 +26,6 @@ "hardwrap": true }, "source": { - "excludePattern": "geometry-processing-js/node" + "excludePattern": "node_modules" } } diff --git a/docs/classes.list.html b/docs/classes.list.html index d18a082..4728373 100644 --- a/docs/classes.list.html +++ b/docs/classes.list.html @@ -47,7 +47,7 @@ @@ -318,9 +318,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/global.html b/docs/global.html index 5fee076..c74e59e 100644 --- a/docs/global.html +++ b/docs/global.html @@ -47,7 +47,7 @@ @@ -152,75 +152,6 @@

-

Members

- -
- -
-
-

Detector

- - -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - -
Author:
-
-
    -
  • alteredq / http://alteredqualia.com/
  • - -
  • mr.doob / http://mrdoob.com/
  • -
-
- - - - - - - - - - - - - - - - - -
- - - -
- -
-

Methods

@@ -1226,9 +1157,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/index.html b/docs/index.html index c7fc504..a37ad94 100644 --- a/docs/index.html +++ b/docs/index.html @@ -47,7 +47,7 @@ @@ -147,9 +147,7 @@

Dependencies (all included)

About Javascript

The implementation of geometry-processing-js attempts to minimize the use of obscure Javascript language features. It should not be too difficult for anyone with experience in a dynamic language like Python or familiar with the principles of Object Oriented Programming to get a handle on Javascript syntax by reading through some of the code in this framework. The documentation contains examples specific to this framework which will also be of help. For a more formal introduction to Javascript, checkout this really nice tutorial.

Building the Documentation

-

This documentation was generated using jsdoc and ink-docstrap. We used a modified version of the cosmo theme. After installing jsdoc and ink-docstrap, you can build the documentation by running

-
jsdoc -c node_modules/ink-docstrap/template/jsdoc.conf.json -t node_modules/ink-docstrap/template/ -R geometry-processing-js/README.md -r -d geometry-processing-js/docs
-
+

See guide here.

Authors

Rohan Sawhney

Email: rohansawhney@cs.cmu.edu

@@ -206,9 +204,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. @@ -299,4 +297,4 @@ - + \ No newline at end of file diff --git a/docs/module-Core.Corner.html b/docs/module-Core.Corner.html index 500a12b..60aa131 100644 --- a/docs/module-Core.Corner.html +++ b/docs/module-Core.Corner.html @@ -47,7 +47,7 @@ @@ -578,9 +578,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Core.DEC.html b/docs/module-Core.DEC.html index b38f1e4..466008a 100644 --- a/docs/module-Core.DEC.html +++ b/docs/module-Core.DEC.html @@ -47,7 +47,7 @@ @@ -90,7 +90,7 @@

DEC

-

This class contains methods to build common discrete exterior calculus operators.

+

This class contains methods to build common discrete exterior calculus operators.

@@ -1148,9 +1148,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Core.Edge.html b/docs/module-Core.Edge.html index 5edaa0f..f4f21b0 100644 --- a/docs/module-Core.Edge.html +++ b/docs/module-Core.Edge.html @@ -47,7 +47,7 @@ @@ -391,9 +391,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Core.Face.html b/docs/module-Core.Face.html index bc1ddec..97334e2 100644 --- a/docs/module-Core.Face.html +++ b/docs/module-Core.Face.html @@ -47,7 +47,7 @@ @@ -1180,9 +1180,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Core.Geometry.html b/docs/module-Core.Geometry.html index 7d744b0..0383c97 100644 --- a/docs/module-Core.Geometry.html +++ b/docs/module-Core.Geometry.html @@ -47,7 +47,7 @@ @@ -2465,7 +2465,7 @@
Parameters:
See:
@@ -4589,9 +4589,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Core.Halfedge.html b/docs/module-Core.Halfedge.html index f57da98..0eb3a20 100644 --- a/docs/module-Core.Halfedge.html +++ b/docs/module-Core.Halfedge.html @@ -47,7 +47,7 @@ @@ -457,9 +457,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Core.Mesh.html b/docs/module-Core.Mesh.html index a87941a..749c4c1 100644 --- a/docs/module-Core.Mesh.html +++ b/docs/module-Core.Mesh.html @@ -47,7 +47,7 @@ @@ -765,9 +765,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Core.MeshSubset.html b/docs/module-Core.MeshSubset.html index 51d98aa..f967220 100644 --- a/docs/module-Core.MeshSubset.html +++ b/docs/module-Core.MeshSubset.html @@ -47,7 +47,7 @@ @@ -2512,9 +2512,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Core.Vertex.html b/docs/module-Core.Vertex.html index 28cd23c..ac5ffc1 100644 --- a/docs/module-Core.Vertex.html +++ b/docs/module-Core.Vertex.html @@ -47,7 +47,7 @@ @@ -1372,9 +1372,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Core.html b/docs/module-Core.html index 43cdb21..3760dfd 100644 --- a/docs/module-Core.html +++ b/docs/module-Core.html @@ -47,7 +47,7 @@ @@ -244,9 +244,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.Cholesky.html b/docs/module-LinearAlgebra.Cholesky.html index f27725b..a6dd9fa 100644 --- a/docs/module-LinearAlgebra.Cholesky.html +++ b/docs/module-LinearAlgebra.Cholesky.html @@ -47,7 +47,7 @@ @@ -408,9 +408,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.Complex.html b/docs/module-LinearAlgebra.Complex.html index f32d13e..b4067fa 100644 --- a/docs/module-LinearAlgebra.Complex.html +++ b/docs/module-LinearAlgebra.Complex.html @@ -47,7 +47,7 @@ @@ -2035,9 +2035,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.ComplexCholesky.html b/docs/module-LinearAlgebra.ComplexCholesky.html index 1b2b2cd..6f68e8e 100644 --- a/docs/module-LinearAlgebra.ComplexCholesky.html +++ b/docs/module-LinearAlgebra.ComplexCholesky.html @@ -47,7 +47,7 @@ @@ -411,9 +411,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.ComplexDenseMatrix.html b/docs/module-LinearAlgebra.ComplexDenseMatrix.html index e9b8894..36aa243 100644 --- a/docs/module-LinearAlgebra.ComplexDenseMatrix.html +++ b/docs/module-LinearAlgebra.ComplexDenseMatrix.html @@ -47,7 +47,7 @@ @@ -3818,9 +3818,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.ComplexLU.html b/docs/module-LinearAlgebra.ComplexLU.html index 8ddc9b2..1fde03b 100644 --- a/docs/module-LinearAlgebra.ComplexLU.html +++ b/docs/module-LinearAlgebra.ComplexLU.html @@ -47,7 +47,7 @@ @@ -408,9 +408,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.ComplexQR.html b/docs/module-LinearAlgebra.ComplexQR.html index 1df0015..dc7d12e 100644 --- a/docs/module-LinearAlgebra.ComplexQR.html +++ b/docs/module-LinearAlgebra.ComplexQR.html @@ -47,7 +47,7 @@ @@ -408,9 +408,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.ComplexSparseMatrix.html b/docs/module-LinearAlgebra.ComplexSparseMatrix.html index e24f8b2..60338fc 100644 --- a/docs/module-LinearAlgebra.ComplexSparseMatrix.html +++ b/docs/module-LinearAlgebra.ComplexSparseMatrix.html @@ -47,7 +47,7 @@ @@ -3155,9 +3155,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.ComplexTriplet.html b/docs/module-LinearAlgebra.ComplexTriplet.html index 339a670..cb59344 100644 --- a/docs/module-LinearAlgebra.ComplexTriplet.html +++ b/docs/module-LinearAlgebra.ComplexTriplet.html @@ -47,7 +47,7 @@ @@ -506,9 +506,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.DenseMatrix.html b/docs/module-LinearAlgebra.DenseMatrix.html index c1ed7d7..fa46af2 100644 --- a/docs/module-LinearAlgebra.DenseMatrix.html +++ b/docs/module-LinearAlgebra.DenseMatrix.html @@ -47,7 +47,7 @@ @@ -3717,9 +3717,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.EmscriptenMemoryManager.html b/docs/module-LinearAlgebra.EmscriptenMemoryManager.html index 6b072b9..c8da080 100644 --- a/docs/module-LinearAlgebra.EmscriptenMemoryManager.html +++ b/docs/module-LinearAlgebra.EmscriptenMemoryManager.html @@ -47,7 +47,7 @@ @@ -445,9 +445,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.LU.html b/docs/module-LinearAlgebra.LU.html index eb2fdcf..ef6109b 100644 --- a/docs/module-LinearAlgebra.LU.html +++ b/docs/module-LinearAlgebra.LU.html @@ -47,7 +47,7 @@ @@ -407,9 +407,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.QR.html b/docs/module-LinearAlgebra.QR.html index 0386d36..f9b33fc 100644 --- a/docs/module-LinearAlgebra.QR.html +++ b/docs/module-LinearAlgebra.QR.html @@ -47,7 +47,7 @@ @@ -408,9 +408,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.SparseMatrix.html b/docs/module-LinearAlgebra.SparseMatrix.html index f9a3b4c..ae407fc 100644 --- a/docs/module-LinearAlgebra.SparseMatrix.html +++ b/docs/module-LinearAlgebra.SparseMatrix.html @@ -47,7 +47,7 @@ @@ -3051,9 +3051,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.Triplet.html b/docs/module-LinearAlgebra.Triplet.html index f314d64..1cb6aee 100644 --- a/docs/module-LinearAlgebra.Triplet.html +++ b/docs/module-LinearAlgebra.Triplet.html @@ -47,7 +47,7 @@ @@ -505,9 +505,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.Vector.html b/docs/module-LinearAlgebra.Vector.html index e92f610..c75e793 100644 --- a/docs/module-LinearAlgebra.Vector.html +++ b/docs/module-LinearAlgebra.Vector.html @@ -47,7 +47,7 @@ @@ -2310,9 +2310,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-LinearAlgebra.html b/docs/module-LinearAlgebra.html index 7aaa0e3..5241e3e 100644 --- a/docs/module-LinearAlgebra.html +++ b/docs/module-LinearAlgebra.html @@ -47,7 +47,7 @@ @@ -252,9 +252,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.BoundaryFirstFlattening.html b/docs/module-Projects.BoundaryFirstFlattening.html index f5c470d..389d859 100644 --- a/docs/module-Projects.BoundaryFirstFlattening.html +++ b/docs/module-Projects.BoundaryFirstFlattening.html @@ -47,7 +47,7 @@ @@ -962,9 +962,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.HarmonicBases.html b/docs/module-Projects.HarmonicBases.html index 41f309a..1e1c1c1 100644 --- a/docs/module-Projects.HarmonicBases.html +++ b/docs/module-Projects.HarmonicBases.html @@ -47,7 +47,7 @@ @@ -108,7 +108,7 @@

new Harm
-

This class computes the harmonic bases of a surface mesh.

+

This class computes the harmonic bases of a surface mesh.

@@ -440,9 +440,9 @@

- Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.HeatMethod.html b/docs/module-Projects.HeatMethod.html index a1ae40d..f17d6b7 100644 --- a/docs/module-Projects.HeatMethod.html +++ b/docs/module-Projects.HeatMethod.html @@ -47,7 +47,7 @@ @@ -108,7 +108,7 @@

new HeatMet
-

This class implements the heat method to compute geodesic distance
+

This class implements the heat method to compute geodesic distance
on a surface mesh.

@@ -565,9 +565,9 @@

- Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.HodgeDecomposition.html b/docs/module-Projects.HodgeDecomposition.html index aeb0b00..13f5fba 100644 --- a/docs/module-Projects.HodgeDecomposition.html +++ b/docs/module-Projects.HodgeDecomposition.html @@ -47,7 +47,7 @@ @@ -108,7 +108,7 @@

new
-

This class computes the hodge decomposition of a vector field on a surface mesh.

+

This class computes the hodge decomposition of a vector field on a surface mesh.

@@ -1083,9 +1083,9 @@

- Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.MeanCurvatureFlow.html b/docs/module-Projects.MeanCurvatureFlow.html index 2dabf2e..67d5e3f 100644 --- a/docs/module-Projects.MeanCurvatureFlow.html +++ b/docs/module-Projects.MeanCurvatureFlow.html @@ -47,7 +47,7 @@ @@ -108,7 +108,7 @@

new
-

This class performs mean curvature flow on a surface mesh.

+

This class performs mean curvature flow on a surface mesh.

@@ -495,9 +495,9 @@

- Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.ModifiedMeanCurvatureFlow.html b/docs/module-Projects.ModifiedMeanCurvatureFlow.html index d84b671..e7e7471 100644 --- a/docs/module-Projects.ModifiedMeanCurvatureFlow.html +++ b/docs/module-Projects.ModifiedMeanCurvatureFlow.html @@ -47,7 +47,7 @@ @@ -108,7 +108,7 @@

-

This class performs a modified version of mean curvature flow on a surface mesh.

+

This class performs a modified version of mean curvature flow on a surface mesh.

@@ -491,9 +491,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.ScalarPoissonProblem.html b/docs/module-Projects.ScalarPoissonProblem.html index 4a2a06d..1ef929e 100644 --- a/docs/module-Projects.ScalarPoissonProblem.html +++ b/docs/module-Projects.ScalarPoissonProblem.html @@ -47,7 +47,7 @@ @@ -108,7 +108,7 @@

n
-

This class solves a scalar poisson problem on a surface mesh.

+

This class solves a scalar poisson problem on a surface mesh.

@@ -564,9 +564,9 @@

- Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.SimplicialComplexOperators.html b/docs/module-Projects.SimplicialComplexOperators.html index af22d07..54945a6 100644 --- a/docs/module-Projects.SimplicialComplexOperators.html +++ b/docs/module-Projects.SimplicialComplexOperators.html @@ -47,7 +47,7 @@ @@ -2197,9 +2197,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.SpectralConformalParameterization.html b/docs/module-Projects.SpectralConformalParameterization.html index a5e8824..1f8cb98 100644 --- a/docs/module-Projects.SpectralConformalParameterization.html +++ b/docs/module-Projects.SpectralConformalParameterization.html @@ -47,7 +47,7 @@ @@ -108,7 +108,7 @@

-

This class implements the spectral conformal parameterization algorithm to flatten
+

This class implements the spectral conformal parameterization algorithm to flatten
surface meshes with boundaries conformally.

@@ -470,9 +470,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.TreeCotree.html b/docs/module-Projects.TreeCotree.html index 1a936ca..ff796c9 100644 --- a/docs/module-Projects.TreeCotree.html +++ b/docs/module-Projects.TreeCotree.html @@ -47,7 +47,7 @@ @@ -108,7 +108,7 @@

new TreeCot
-

This class computes the tree cotree decomposition of a surface mesh
+

This class computes the tree cotree decomposition of a surface mesh
to build its homology generators.

@@ -473,9 +473,9 @@

- Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.TrivialConnections.html b/docs/module-Projects.TrivialConnections.html index dd0a8f7..4c6cdf5 100644 --- a/docs/module-Projects.TrivialConnections.html +++ b/docs/module-Projects.TrivialConnections.html @@ -47,7 +47,7 @@ @@ -638,9 +638,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Projects.html b/docs/module-Projects.html index ea67f6b..b088038 100644 --- a/docs/module-Projects.html +++ b/docs/module-Projects.html @@ -47,7 +47,7 @@ @@ -232,9 +232,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Utils.Distortion.html b/docs/module-Utils.Distortion.html index d695806..4865b8f 100644 --- a/docs/module-Utils.Distortion.html +++ b/docs/module-Utils.Distortion.html @@ -47,7 +47,7 @@ @@ -633,9 +633,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Utils.MeshIO.html b/docs/module-Utils.MeshIO.html index 491f910..7bec991 100644 --- a/docs/module-Utils.MeshIO.html +++ b/docs/module-Utils.MeshIO.html @@ -47,7 +47,7 @@ @@ -669,9 +669,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Utils.Solvers.html b/docs/module-Utils.Solvers.html index dec1500..e8165b5 100644 --- a/docs/module-Utils.Solvers.html +++ b/docs/module-Utils.Solvers.html @@ -47,7 +47,7 @@ @@ -716,9 +716,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/module-Utils.html b/docs/module-Utils.html index 0e6f99e..d05f053 100644 --- a/docs/module-Utils.html +++ b/docs/module-Utils.html @@ -47,7 +47,7 @@ @@ -208,9 +208,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/modules.list.html b/docs/modules.list.html index 87a3855..6c7271e 100644 --- a/docs/modules.list.html +++ b/docs/modules.list.html @@ -47,7 +47,7 @@ @@ -318,9 +318,9 @@ - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.6 - on Mon Jan 13th 2020 + on Sun Feb 14th 2021 using the DocStrap template. diff --git a/docs/quicksearch.html b/docs/quicksearch.html index 621668c..16c650f 100644 --- a/docs/quicksearch.html +++ b/docs/quicksearch.html @@ -7,7 +7,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/projects/simplicial-complex-operators/setup.js b/projects/simplicial-complex-operators/setup.js index 3db1123..36d4d5e 100644 --- a/projects/simplicial-complex-operators/setup.js +++ b/projects/simplicial-complex-operators/setup.js @@ -1,4 +1,27 @@ -if (!Detector.webgl) Detector.addGetWebGLMessage(); +import { WEBGL } from 'https://cdn.jsdelivr.net/npm/three@0.125.2/examples/jsm/WebGL.js'; +import dat from 'https://cdn.jsdelivr.net/npm/three@0.125.2/examples/jsm/libs/dat.gui.module.js'; +import * as THREE from 'https://cdn.jsdelivr.net/npm/three@0.125.2/build/three.module.js' +import { TrackballControls } from 'https://cdn.jsdelivr.net/npm/three@0.125.2/examples/jsm/controls/TrackballControls.js'; + +import { Mesh } from "../../core/mesh.js"; +import MeshIO from "../../utils/meshio.js"; +import { Geometry } from "../../core/geometry.js"; +import small_disk from "../../input/small_disk.js"; +import MeshSubset from "../../core/mesh-subset.js"; +import Vector from "../../linear-algebra/vector.js"; +import SimplicialComplexOperators from "./simplicial-complex-operators.js"; +import EmscriptenMemoryManager from "../../linear-algebra/emscripten-memory-manager.js"; + +// Warn the user if WebGL is not Available +if (!WEBGL.isWebGLAvailable()){ + var parent, id, element; + let parameters = null || {}; + parent = parameters.parent !== undefined ? parameters.parent : document.body; + id = parameters.id !== undefined ? parameters.id : 'oldie'; + element = WEBGL.getWebGLErrorMessage(); + element.id = id; + parent.appendChild( element ); +} let input = document.getElementById("fileInput"); let renderer = undefined; @@ -361,9 +384,9 @@ function initThreeMesh() { // set geometry threeGeometry.setIndex(new THREE.BufferAttribute(indices, 1)); - threeGeometry.addAttribute("position", new THREE.BufferAttribute(positions, 3)); - threeGeometry.addAttribute("normal", new THREE.BufferAttribute(normals, 3)); - threeGeometry.addAttribute("color", new THREE.BufferAttribute(colors, 3)); + threeGeometry.setAttribute("position", new THREE.BufferAttribute(positions, 3)); + threeGeometry.setAttribute("normal", new THREE.BufferAttribute(normals, 3)); + threeGeometry.setAttribute("color", new THREE.BufferAttribute(colors, 3)); // create material let threeMaterial = new THREE.MeshPhongMaterial(materialSettings); @@ -522,8 +545,8 @@ function initThreePickMesh() { } // set geometry - threePickGeometry.addAttribute("position", new THREE.BufferAttribute(pickPositions, 3)); - threePickGeometry.addAttribute("color", new THREE.BufferAttribute(pickColors, 3)); + threePickGeometry.setAttribute("position", new THREE.BufferAttribute(pickPositions, 3)); + threePickGeometry.setAttribute("color", new THREE.BufferAttribute(pickColors, 3)); // create material let threePickMaterial = new THREE.MeshBasicMaterial({ @@ -592,12 +615,15 @@ function initFaceMesh(id) { let p2Minus = shrunk_p2.minus(normal.times(offset)); let p3Minus = shrunk_p3.minus(normal.times(offset)); - let threeGeometry = new THREE.Geometry(); - threeGeometry.vertices.push(toThreeVector(p1Minus)); - threeGeometry.vertices.push(toThreeVector(p2Minus)); - threeGeometry.vertices.push(toThreeVector(p3Minus)); - threeGeometry.faces.push(new THREE.Face3(0, 1, 2)); - threeGeometry.computeFaceNormals(); + let threeGeometry = new THREE.BufferGeometry(); + let verts = [toThreeVector(p1Minus), toThreeVector(p2Minus), toThreeVector(p3Minus)]; + let threeGeometryVertices = new Float32Array( [ + verts[0].x, verts[0].y, verts[0].z, + verts[1].x, verts[1].y, verts[1].z, + verts[2].x, verts[2].y, verts[2].z + ] ); + threeGeometry.setAttribute('position', new THREE.BufferAttribute(threeGeometryVertices, 3)); + threeGeometry.computeVertexNormals(); // create mesh let material = new THREE.MeshPhongMaterial({color: selectedColor}); @@ -633,7 +659,7 @@ function deleteFaceMesh(id) { } function initControls() { - controls = new THREE.TrackballControls(camera, renderer.domElement); + controls = new TrackballControls(camera, renderer.domElement); controls.rotateSpeed = 5.0; } @@ -663,7 +689,8 @@ function pick(clickX, clickY) { // draw let pickTarget = new THREE.WebGLRenderTarget(window.innerWidth, window.innerHeight); pickTarget.texture.generateMipmaps = false; - pickRenderer.render(pickScene, camera, pickTarget); + pickRenderer.setRenderTarget(pickTarget); + pickRenderer.render(pickScene, camera); // read color let pixelBuffer = new Uint8Array(4); @@ -712,4 +739,4 @@ function displayMeshSubset() { function toThreeVector(v) { return new THREE.Vector3(v.x, v.y, v.z); -} +} \ No newline at end of file diff --git a/projects/simplicial-complex-operators/simplicial-complex-operators.js b/projects/simplicial-complex-operators/simplicial-complex-operators.js index a40fe43..ba6db26 100644 --- a/projects/simplicial-complex-operators/simplicial-complex-operators.js +++ b/projects/simplicial-complex-operators/simplicial-complex-operators.js @@ -1,4 +1,6 @@ -"use strict"; +import { SparseMatrix, Triplet } from "../../linear-algebra/sparse-matrix.js"; +import MeshSubset from "../../core/mesh-subset.js"; +import DenseMatrix from "../../linear-algebra/dense-matrix.js"; class SimplicialComplexOperators { @@ -297,3 +299,5 @@ class SimplicialComplexOperators { return this.closure(boundary); } } + +export default SimplicialComplexOperators; \ No newline at end of file diff --git a/projects/vector-field-decomposition/harmonic-bases.js b/projects/vector-field-decomposition/harmonic-bases.js index b56d1a2..ca87644 100644 --- a/projects/vector-field-decomposition/harmonic-bases.js +++ b/projects/vector-field-decomposition/harmonic-bases.js @@ -1,8 +1,10 @@ -"use strict"; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let DenseMatrix = LinearAlgebra.DenseMatrix; +import { indexElements } from '../../core/mesh.js'; class HarmonicBases { /** - * This class computes the {@link https://cs.cmu.edu/~kmcrane/Projects/DDG/paper.pdf harmonic bases} of a surface mesh. + * This class computes the {@link https://www.cs.cmu.edu/~kmcrane/Projects/DDG/paper.pdf harmonic bases} of a surface mesh. * @constructor module:Projects.HarmonicBases * @param {module:Core.Geometry} geometry The input geometry of the mesh this class acts on. */ @@ -66,3 +68,5 @@ class HarmonicBases { return gammas; } } + +export default HarmonicBases; \ No newline at end of file diff --git a/projects/vector-field-decomposition/hodge-decomposition.js b/projects/vector-field-decomposition/hodge-decomposition.js index 898b4be..bc077ee 100644 --- a/projects/vector-field-decomposition/hodge-decomposition.js +++ b/projects/vector-field-decomposition/hodge-decomposition.js @@ -1,8 +1,11 @@ -"use strict"; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let SparseMatrix = LinearAlgebra.SparseMatrix; +import DEC from '../../core/discrete-exterior-calculus.js'; +import { indexElements } from '../../core/mesh.js'; class HodgeDecomposition { /** - * This class computes the {@link https://cs.cmu.edu/~kmcrane/Projects/DDG/paper.pdf hodge decomposition} of a vector field on a surface mesh. + * This class computes the {@link https://www.cs.cmu.edu/~kmcrane/Projects/DDG/paper.pdf hodge decomposition} of a vector field on a surface mesh. * @constructor module:Projects.HodgeDecomposition * @param {module:Core.Geometry} geometry The input geometry of the mesh this class acts on. * @property {Object} edgeIndex A dictionary mapping each edge of the input mesh to a unique index. @@ -90,3 +93,5 @@ class HodgeDecomposition { return omega.minus(dAlpha.plus(deltaBeta)); } } + +export default HodgeDecomposition; \ No newline at end of file diff --git a/projects/vector-field-decomposition/index.html b/projects/vector-field-decomposition/index.html index 0233a31..d4e709f 100644 --- a/projects/vector-field-decomposition/index.html +++ b/projects/vector-field-decomposition/index.html @@ -21,31 +21,34 @@

Vector Field Decomposition

geometry processing js logo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/tests/direction-field-design/test.js b/tests/direction-field-design/test.js index 6aab454..b0a546a 100644 --- a/tests/direction-field-design/test.js +++ b/tests/direction-field-design/test.js @@ -1,4 +1,12 @@ -"use strict"; +import chai from 'chai'; +import solution from './solution.js'; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let memoryManager = LinearAlgebra.memoryManager; +let DenseMatrix = LinearAlgebra.DenseMatrix; +import MeshIO from '../../utils/meshio.js'; +import { Mesh } from '../../core/mesh.js'; +import { Geometry } from '../../core/geometry.js'; +import TrivialConnections from '../../projects/direction-field-design/trivial-connections.js'; describe("TrivialConnections", function() { let polygonSoup = MeshIO.readOBJ(solution); @@ -6,7 +14,7 @@ describe("TrivialConnections", function() { mesh.build(polygonSoup); let geometry = new Geometry(mesh, polygonSoup["v"], false); let E = mesh.edges.length; - let trivialConnections, singularity, deltaBeta, gamma; + let trivialConnections, deltaBeta, gamma; describe("computeCoExactComponent", function() { it("computes the dual 0-form potential", function() { @@ -105,4 +113,4 @@ describe("TrivialConnections", function() { memoryManager.deleteExcept([]); }); }); -}); +}); \ No newline at end of file diff --git a/tests/discrete-exterior-calculus/solution.js b/tests/discrete-exterior-calculus/solution.js index 7390253..02555dc 100644 --- a/tests/discrete-exterior-calculus/solution.js +++ b/tests/discrete-exterior-calculus/solution.js @@ -55290,4 +55290,4 @@ f 1484 508 1482 f 1476 1482 510 `; -module.exports = solution \ No newline at end of file +export default solution; \ No newline at end of file diff --git a/tests/discrete-exterior-calculus/test.html b/tests/discrete-exterior-calculus/test.html deleted file mode 100644 index ac74872..0000000 --- a/tests/discrete-exterior-calculus/test.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/tests/discrete-exterior-calculus/test.js b/tests/discrete-exterior-calculus/test.js index 1c80094..6c2a305 100644 --- a/tests/discrete-exterior-calculus/test.js +++ b/tests/discrete-exterior-calculus/test.js @@ -1,4 +1,12 @@ -"use strict"; +import chai from 'chai'; +import solution from './solution.js'; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let memoryManager = LinearAlgebra.memoryManager; +let DenseMatrix = LinearAlgebra.DenseMatrix; +import MeshIO from '../../utils/meshio.js'; +import { Mesh, indexElements } from '../../core/mesh.js'; +import { Geometry } from '../../core/geometry.js'; +import DEC from '../../core/discrete-exterior-calculus.js'; describe("DEC", function() { let polygonSoup = MeshIO.readOBJ(solution); @@ -191,4 +199,4 @@ describe("DEC", function() { memoryManager.deleteExcept([]); }); }); -}); +}); \ No newline at end of file diff --git a/tests/geodesic-distance/solution.js b/tests/geodesic-distance/solution.js index 1820f43..2d9b2b4 100644 --- a/tests/geodesic-distance/solution.js +++ b/tests/geodesic-distance/solution.js @@ -27856,4 +27856,4 @@ f 358 3483 1119 X -0.6173470364864597 -0.22205606428481214 -0.754701093715734 `; -module.exports = solution \ No newline at end of file +export default solution; \ No newline at end of file diff --git a/tests/geodesic-distance/test.html b/tests/geodesic-distance/test.html deleted file mode 100644 index 5674b8d..0000000 --- a/tests/geodesic-distance/test.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - \ No newline at end of file diff --git a/tests/geodesic-distance/test.js b/tests/geodesic-distance/test.js index 50ec5b6..c8b850b 100644 --- a/tests/geodesic-distance/test.js +++ b/tests/geodesic-distance/test.js @@ -1,4 +1,13 @@ -"use strict"; +import chai from 'chai'; +import solution from './solution.js'; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let Vector = LinearAlgebra.Vector; +let memoryManager = LinearAlgebra.memoryManager; +let DenseMatrix = LinearAlgebra.DenseMatrix; +import MeshIO from '../../utils/meshio.js'; +import { Mesh } from '../../core/mesh.js'; +import { Geometry } from '../../core/geometry.js'; +import HeatMethod from '../../projects/geodesic-distance/heat-method.js'; describe("HeatMethod", function() { let polygonSoup = MeshIO.readOBJ(solution); diff --git a/tests/geometric-flow/solution.js b/tests/geometric-flow/solution.js index 10699c0..880345e 100644 --- a/tests/geometric-flow/solution.js +++ b/tests/geometric-flow/solution.js @@ -17413,4 +17413,4 @@ f 3102 2789 322 f 3483 1119 358 `; -module.exports = solution \ No newline at end of file +export default solution; \ No newline at end of file diff --git a/tests/geometric-flow/test.html b/tests/geometric-flow/test.html deleted file mode 100644 index c3b564e..0000000 --- a/tests/geometric-flow/test.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/tests/geometric-flow/test.js b/tests/geometric-flow/test.js index 5e31d1e..961ebb3 100644 --- a/tests/geometric-flow/test.js +++ b/tests/geometric-flow/test.js @@ -1,4 +1,13 @@ -"use strict"; +import chai from 'chai'; +import solution from './solution.js'; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let Vector = LinearAlgebra.Vector; +let memoryManager = LinearAlgebra.memoryManager; +import MeshIO from '../../utils/meshio.js'; +import { Mesh } from '../../core/mesh.js'; +import { Geometry } from '../../core/geometry.js'; +import MeanCurvatureFlow from '../../projects/geometric-flow/mean-curvature-flow.js'; +import ModifiedMeanCurvatureFlow from '../../projects/geometric-flow/modified-mean-curvature-flow.js'; describe("MeanCurvatureFlow", function() { let steps, h; @@ -96,4 +105,4 @@ describe("MeanCurvatureFlow", function() { memoryManager.deleteExcept([]); }); }); -}); +}); \ No newline at end of file diff --git a/tests/geometry/solution.js b/tests/geometry/solution.js index a93afe1..4e6385f 100644 --- a/tests/geometry/solution.js +++ b/tests/geometry/solution.js @@ -76611,4 +76611,4 @@ f 3102 2789 322 f 3483 1119 358 `; -module.exports = solution \ No newline at end of file +export default solution; \ No newline at end of file diff --git a/tests/geometry/test.html b/tests/geometry/test.html deleted file mode 100644 index eafe378..0000000 --- a/tests/geometry/test.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/tests/geometry/test.js b/tests/geometry/test.js index 2daeaf5..02e9e35 100644 --- a/tests/geometry/test.js +++ b/tests/geometry/test.js @@ -1,4 +1,14 @@ -"use strict"; +import chai from 'chai'; +import solution from './solution.js'; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let Vector = LinearAlgebra.Vector; +let memoryManager = LinearAlgebra.memoryManager; +let DenseMatrix = LinearAlgebra.DenseMatrix; +let SparseMatrix = LinearAlgebra.SparseMatrix; +let Triplet = LinearAlgebra.Triplet; +import MeshIO from '../../utils/meshio.js'; +import { Mesh, indexElements } from '../../core/mesh.js'; +import { Geometry } from '../../core/geometry.js'; describe("Geometry", function() { let polygonSoup = MeshIO.readOBJ(solution); @@ -331,4 +341,4 @@ describe("Geometry", function() { memoryManager.deleteExcept([]); }); }); -}); +}); \ No newline at end of file diff --git a/tests/linear-algebra/test.html b/tests/linear-algebra/test.html deleted file mode 100644 index 0ecd976..0000000 --- a/tests/linear-algebra/test.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/tests/linear-algebra/test.js b/tests/linear-algebra/test.js index 387e317..c06fcc9 100644 --- a/tests/linear-algebra/test.js +++ b/tests/linear-algebra/test.js @@ -1,4 +1,14 @@ -"use strict"; +import chai from 'chai'; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let Vector = LinearAlgebra.Vector; +let memoryManager = LinearAlgebra.memoryManager; +let Complex = LinearAlgebra.Complex; +let DenseMatrix = LinearAlgebra.DenseMatrix; +let SparseMatrix = LinearAlgebra.SparseMatrix; +let Triplet = LinearAlgebra.Triplet; +let ComplexDenseMatrix = LinearAlgebra.ComplexDenseMatrix; +let ComplexSparseMatrix = LinearAlgebra.ComplexSparseMatrix; +let ComplexTriplet = LinearAlgebra.ComplexTriplet; describe("Vector", function() { let u = new Vector(3, 4, 0); @@ -1721,4 +1731,4 @@ describe("ComplexSparseMatrix", function() { chai.assert.strictEqual(success, true); }); }); -}); +}); \ No newline at end of file diff --git a/tests/mesh/test.html b/tests/mesh/test.html deleted file mode 100644 index 819ffdd..0000000 --- a/tests/mesh/test.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - -
- -
- - - - - - - - - - - -
- - - diff --git a/tests/mesh/test.js b/tests/mesh/test.js index 6fc4413..4e7c44f 100644 --- a/tests/mesh/test.js +++ b/tests/mesh/test.js @@ -1,37 +1,12 @@ -"use strict"; +import chai from 'chai'; +import faceMesh from '../../input/face.js'; +import MeshIO from '../../utils/meshio.js'; +import { Mesh } from '../../core/mesh.js'; -let input = document.getElementById("fileInput"); -input.addEventListener("change", function(e) { - let file = input.files[0]; - - if (file.name.endsWith(".obj")) { - let reader = new FileReader(); - - reader.onload = function(e) { - setupTests(reader.result); - mocha.run(); - - // NOTE: Disabling and hiding input tag because mocha does not - // allow reruns. Reload page to run tests with different file. - input.disabled = true; - input.hidden = true; - } - - reader.onerror = function(e) { - alert("Unable to load OBJ file"); - } - - reader.readAsText(file); - - } else { - alert("Please load an OBJ file"); - } -}); - -function setupTests(text) { +describe("Mesh", function() { let polygonSoup = undefined; describe("MeshIO.readOBJ", function() { - polygonSoup = MeshIO.readOBJ(text); + polygonSoup = MeshIO.readOBJ(faceMesh); it("loads a polygon soup", function() { chai.assert.notStrictEqual(polygonSoup, undefined); }); @@ -345,4 +320,4 @@ function setupTests(text) { chai.assert.strictEqual(success, true); }); }); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/tests/parameterization/solution.js b/tests/parameterization/solution.js index e73b25d..34ceb6d 100644 --- a/tests/parameterization/solution.js +++ b/tests/parameterization/solution.js @@ -24911,4 +24911,4 @@ f 2265 2063 2267 f 2267 2269 2271 `; -module.exports = solution \ No newline at end of file +export default solution \ No newline at end of file diff --git a/tests/parameterization/test.html b/tests/parameterization/test.html deleted file mode 100644 index 6dec277..0000000 --- a/tests/parameterization/test.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/tests/parameterization/test.js b/tests/parameterization/test.js index 782eab0..d0aa85c 100644 --- a/tests/parameterization/test.js +++ b/tests/parameterization/test.js @@ -1,4 +1,15 @@ -"use strict"; +import chai from 'chai'; +import solution from './solution.js'; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let Vector = LinearAlgebra.Vector; +let memoryManager = LinearAlgebra.memoryManager; +let Complex = LinearAlgebra.Complex; +let ComplexSparseMatrix = LinearAlgebra.ComplexSparseMatrix; +let ComplexTriplet = LinearAlgebra.ComplexTriplet; +import MeshIO from '../../utils/meshio.js'; +import { Mesh } from '../../core/mesh.js'; +import { Geometry } from '../../core/geometry.js'; +import SpectralConformalParameterization from '../../projects/parameterization/spectral-conformal-parameterization.js'; describe("SpectralConformalParameterization", function() { let polygonSoup = MeshIO.readOBJ(solution); @@ -71,4 +82,4 @@ describe("SpectralConformalParameterization", function() { memoryManager.deleteExcept([]); }); }); -}); +}); \ No newline at end of file diff --git a/tests/poisson-problem/solution.js b/tests/poisson-problem/solution.js index 25bc47e..062925e 100644 --- a/tests/poisson-problem/solution.js +++ b/tests/poisson-problem/solution.js @@ -17411,4 +17411,4 @@ f 322 3102 2789 f 358 3483 1119 `; -module.exports = solution \ No newline at end of file +export default solution \ No newline at end of file diff --git a/tests/poisson-problem/test.html b/tests/poisson-problem/test.html deleted file mode 100644 index 844bf85..0000000 --- a/tests/poisson-problem/test.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/tests/poisson-problem/test.js b/tests/poisson-problem/test.js index f9b2b7d..9e4066b 100644 --- a/tests/poisson-problem/test.js +++ b/tests/poisson-problem/test.js @@ -1,4 +1,12 @@ -"use strict"; +import chai from 'chai'; +import solution from './solution.js'; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let memoryManager = LinearAlgebra.memoryManager; +let DenseMatrix = LinearAlgebra.DenseMatrix; +import MeshIO from '../../utils/meshio.js'; +import { Mesh } from '../../core/mesh.js'; +import { Geometry } from '../../core/geometry.js'; +import ScalarPoissonProblem from '../../projects/poisson-problem/scalar-poisson-problem.js'; describe("ScalarPoissonProblem", function() { let polygonSoup = MeshIO.readOBJ(solution); @@ -40,4 +48,4 @@ describe("ScalarPoissonProblem", function() { memoryManager.deleteExcept([]); }); }); -}); +}); \ No newline at end of file diff --git a/tests/simplicial-complex-operators/solution.js b/tests/simplicial-complex-operators/solution.js index 4d72ce5..743ef18 100644 --- a/tests/simplicial-complex-operators/solution.js +++ b/tests/simplicial-complex-operators/solution.js @@ -1,3 +1,6 @@ +import MeshSubset from "../../core/mesh-subset.js" +import SimplicialComplexOperators from "../../projects/simplicial-complex-operators/simplicial-complex-operators.js"; +import { memoryManager } from "../../linear-algebra/emscripten-memory-manager.js" class SubcomplexOperationTest { // the lists of mesh elements are given as lists of indices. The indices are the positions of those mesh // elements in their corresponding lists in the mesh, not the indices assigned by some SimplicialComplexOperators object @@ -191,3 +194,14 @@ let faceDegreeTest = new SubcomplexFunctionTest("isPureComplex", [], [], [ let faceEdgesDegreeTest = new SubcomplexFunctionTest("isPureComplex", [], [1638, 1434, 2090], [1261], -1); let closedFaceDegreeTest = new SubcomplexFunctionTest("isPureComplex", [593, 731, 850], [1638, 1434, 2090], [1261], 2); let impureDegreeTest = new SubcomplexFunctionTest("isPureComplex", [593, 731, 850, 610], [1638, 1434, 2090, 2597], [1261], -1); + +export { + SubcomplexOperationTest, SubcomplexFunctionTest, + vertexStarTest, + verticesStarTest, edgeStarTest, faceStarTest, + vertexClosureTest, verticesClosureTest, edgeClosureTest, faceClosureTest, + vertexLinkTest, verticesLinkTest, edgeLinkTest, faceLinkTest, + vertexBoundaryTest, edgeBoundaryTest, faceBoundaryTest, facesBoundaryTest, + vertexComplexTest, edgeComplexTest, closedEdgeComplexTest, faceComplexTest, faceEdgesComplexTest, closedFaceComplexTest, + vertexDegreeTest, edgeDegreeTest, closedEdgeDegreeTest, faceDegreeTest, faceEdgesDegreeTest, closedFaceDegreeTest, impureDegreeTest +} \ No newline at end of file diff --git a/tests/simplicial-complex-operators/test.html b/tests/simplicial-complex-operators/test.html deleted file mode 100644 index 40a1e2d..0000000 --- a/tests/simplicial-complex-operators/test.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Simplicial Complex Tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/tests/simplicial-complex-operators/test.js b/tests/simplicial-complex-operators/test.js index abb3486..ffe7726 100644 --- a/tests/simplicial-complex-operators/test.js +++ b/tests/simplicial-complex-operators/test.js @@ -1,4 +1,21 @@ -"use strict"; +import chai from 'chai'; +import { + SubcomplexOperationTest, SubcomplexFunctionTest, + vertexStarTest, + verticesStarTest, edgeStarTest, faceStarTest, + vertexClosureTest, verticesClosureTest, edgeClosureTest, faceClosureTest, + vertexLinkTest, verticesLinkTest, edgeLinkTest, faceLinkTest, + vertexBoundaryTest, edgeBoundaryTest, faceBoundaryTest, facesBoundaryTest, + vertexComplexTest, edgeComplexTest, closedEdgeComplexTest, faceComplexTest, faceEdgesComplexTest, closedFaceComplexTest, + vertexDegreeTest, edgeDegreeTest, closedEdgeDegreeTest, faceDegreeTest, faceEdgesDegreeTest, closedFaceDegreeTest, impureDegreeTest +} from './solution.js'; +import small_bunny from '../../input/small_bunny.js' +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let DenseMatrix = LinearAlgebra.DenseMatrix; +import MeshIO from '../../utils/meshio.js'; +import { Mesh } from '../../core/mesh.js'; +import MeshSubset from "../../core/mesh-subset.js"; +import SimplicialComplexOperators from "../../projects/simplicial-complex-operators/simplicial-complex-operators.js"; function subsetElementsGivenByList(subset, simplexList, indices) { if(subset.size != indices.length) { diff --git a/tests/vector-field-decomposition/solution.js b/tests/vector-field-decomposition/solution.js index 6cc4077..21e3fae 100644 --- a/tests/vector-field-decomposition/solution.js +++ b/tests/vector-field-decomposition/solution.js @@ -46078,4 +46078,4 @@ f 1484 508 1482 f 1476 1482 510 `; -module.exports = solution \ No newline at end of file +export default solution \ No newline at end of file diff --git a/tests/vector-field-decomposition/test.html b/tests/vector-field-decomposition/test.html deleted file mode 100644 index 958e8c8..0000000 --- a/tests/vector-field-decomposition/test.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/tests/vector-field-decomposition/test.js b/tests/vector-field-decomposition/test.js index 4347e91..7840d59 100644 --- a/tests/vector-field-decomposition/test.js +++ b/tests/vector-field-decomposition/test.js @@ -1,4 +1,14 @@ -"use strict"; +import chai from 'chai'; +import solution from './solution.js'; +import LinearAlgebra from '../../linear-algebra/linear-algebra.js'; +let memoryManager = LinearAlgebra.memoryManager; +let DenseMatrix = LinearAlgebra.DenseMatrix; +import MeshIO from '../../utils/meshio.js'; +import { Mesh } from '../../core/mesh.js'; +import { Geometry } from '../../core/geometry.js'; +import HodgeDecomposition from '../../projects/vector-field-decomposition/hodge-decomposition.js'; +import TreeCotree from '../../projects/vector-field-decomposition/tree-cotree.js'; +import HarmonicBases from '../../projects/vector-field-decomposition/harmonic-bases.js'; describe("VectorFieldDecomposition", function() { let polygonSoup = MeshIO.readOBJ(solution); @@ -127,4 +137,4 @@ describe("VectorFieldDecomposition", function() { memoryManager.deleteExcept([]); }); }); -}); +}); \ No newline at end of file diff --git a/utils/colormap.js b/utils/colormap.js index e14713d..4224927 100644 --- a/utils/colormap.js +++ b/utils/colormap.js @@ -1,4 +1,5 @@ -"use strict"; +import LinearAlgebra from '../linear-algebra/linear-algebra.js'; +let Vector = LinearAlgebra.Vector; let seismic = [ [0.000, [0.000, 0.000, 0.300]], @@ -2071,3 +2072,11 @@ function colormap(x, min, max, values) { return c1.plus(c2.minus(c1).times(scaling)); } + +export { + colormap, + seismic, + coolwarm, + hot, + clamp +}; \ No newline at end of file diff --git a/utils/distortion.js b/utils/distortion.js index a6acda6..543dfd8 100644 --- a/utils/distortion.js +++ b/utils/distortion.js @@ -1,4 +1,6 @@ -"use strict" +import LinearAlgebra from '../linear-algebra/linear-algebra.js'; +let Vector = LinearAlgebra.Vector; +import { colormap, seismic } from "./colormap.js"; /** * This class computes the quasi conformal error and area scaling resulting from @@ -252,3 +254,5 @@ function hsv(h, s, v) { return new Vector(r, g, b); } + +export default Distortion; \ No newline at end of file diff --git a/utils/meshio.js b/utils/meshio.js index 0ac2ffd..2c8d96a 100644 --- a/utils/meshio.js +++ b/utils/meshio.js @@ -1,4 +1,5 @@ -"use strict"; +import LinearAlgebra from '../linear-algebra/linear-algebra.js'; +let Vector = LinearAlgebra.Vector; /** * This class converts text from 3D file formats such as OBJ to a polygon soup mesh @@ -89,3 +90,5 @@ class MeshIO { return output; } } + +export default MeshIO; \ No newline at end of file diff --git a/utils/solvers.js b/utils/solvers.js index b9e3f42..d3cf46f 100644 --- a/utils/solvers.js +++ b/utils/solvers.js @@ -1,4 +1,6 @@ -"use strict"; +import LinearAlgebra from '../linear-algebra/linear-algebra.js'; +let Complex = LinearAlgebra.Complex; +let ComplexDenseMatrix = LinearAlgebra.ComplexDenseMatrix; /** * This class implements frequently used numerical algorithms such as the inverse power method. @@ -75,3 +77,5 @@ class Solvers { return m; } } + +export default Solvers; \ No newline at end of file