Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canonicalize rotation when testing flattening #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/parameterization/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@ describe("SpectralConformalParameterization", function() {
let success = true;
let flattening_sol = loadFlattening();
let flattening = spectralConformalParameterization.flatten();

let v0 = mesh.vertices[0];
let p0 = new Complex(flattening[v0].x, flattening[v0].y);
let s0 = new Complex(flattening_sol[v0].x, flattening_sol[v0].y);
let rot = s0.overComplex(p0);

for (let v of mesh.vertices) {
if (!flattening[v].isValid() || flattening_sol[v].minus(flattening[v]).norm() > 1e-6) {
let p = new Complex(flattening[v].x, flattening[v].y);
let pRot = p.timesComplex(rot);
let flatteningRot = new Vector(pRot.re, pRot.im, flattening[v].z);
if (!flatteningRot.isValid() || flattening_sol[v].minus(flatteningRot).norm() > 1e-6) {
success = false;
break;
}
Expand Down