Add test for topology calulation for two cubes connecting in one edge.

This commit is contained in:
Viktor Kovacs 2021-05-21 19:31:03 +02:00
parent aff5740fba
commit 7dbfa862c8
2 changed files with 23 additions and 0 deletions

View File

@ -163,4 +163,10 @@ describe ('Model Utils', function () {
assert.strictEqual (topology.edges[i].triangles.length, 2); assert.strictEqual (topology.edges[i].triangles.length, 2);
} }
}); });
it ('Two Cubes Connection in One Edge Topology Calculation', function () {
const model = testUtils.GetTwoCubesConnectingInOneEdgeModel ();
let topology = OV.GetTopology (model);
assert.strictEqual (topology.vertices.length, 14);
});
}); });

View File

@ -163,6 +163,23 @@ module.exports =
return cube; return cube;
}, },
GetTwoCubesConnectingInOneEdgeModel ()
{
let model = new OV.Model ();
let cube1 = this.GetCubeMesh ();
model.AddMesh (cube1);
let cube2 = this.GetCubeMesh ();
let matrix = new OV.Matrix ().CreateTranslation (1.0, 0.0, 1.0);
let transformation = new OV.Transformation (matrix);
OV.TransformMesh (cube2, transformation);
model.AddMesh (cube2);
OV.FinalizeModel (model, function () { new OV.Material () });
return model;
},
GetCubeWithOneMissingFaceMesh () GetCubeWithOneMissingFaceMesh ()
{ {
var cube = new OV.Mesh (); var cube = new OV.Mesh ();