Add test where two cubes are connecting in one vertex.
This commit is contained in:
parent
d72e8ad79d
commit
67a4754ec9
@ -167,7 +167,14 @@ describe ('Model Utils', function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it ('Two Cubes Connection in One Edge Topology Calculation', function () {
|
it ('Two Cubes Connecting in One Vertex Topology Calculation', function () {
|
||||||
|
const model = testUtils.GetTwoCubesConnectingInOneVertexModel ();
|
||||||
|
let topology = OV.GetTopology (model);
|
||||||
|
assert.strictEqual (topology.vertices.length, 15);
|
||||||
|
assert (OV.IsSolid (model));
|
||||||
|
});
|
||||||
|
|
||||||
|
it ('Two Cubes Connecting in One Edge Topology Calculation', function () {
|
||||||
const model = testUtils.GetTwoCubesConnectingInOneEdgeModel ();
|
const model = testUtils.GetTwoCubesConnectingInOneEdgeModel ();
|
||||||
let topology = OV.GetTopology (model);
|
let topology = OV.GetTopology (model);
|
||||||
assert.strictEqual (topology.vertices.length, 14);
|
assert.strictEqual (topology.vertices.length, 14);
|
||||||
|
|||||||
@ -163,6 +163,23 @@ module.exports =
|
|||||||
return cube;
|
return cube;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
GetTwoCubesConnectingInOneVertexModel ()
|
||||||
|
{
|
||||||
|
let model = new OV.Model ();
|
||||||
|
|
||||||
|
let cube1 = this.GetCubeMesh ();
|
||||||
|
model.AddMesh (cube1);
|
||||||
|
|
||||||
|
let cube2 = this.GetCubeMesh ();
|
||||||
|
let matrix = new OV.Matrix ().CreateTranslation (1.0, 1.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;
|
||||||
|
},
|
||||||
|
|
||||||
GetTwoCubesConnectingInOneEdgeModel ()
|
GetTwoCubesConnectingInOneEdgeModel ()
|
||||||
{
|
{
|
||||||
let model = new OV.Model ();
|
let model = new OV.Model ();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user