Add test for lines in meshes.

This commit is contained in:
kovacsv 2023-10-17 19:56:41 +02:00
parent 1af09bf377
commit a3f9138579
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,13 @@
v 0.0 0.0 0.0
v 1.0 0.0 0.0
v 1.0 1.0 0.0
v 0.0 1.0 0.0
v 0.0 0.0 1.0
v 1.0 0.0 1.0
v 1.0 1.0 1.0
v 0.0 1.0 1.0
g Mesh01
l 1 2
l 3 4
g Mesh02
l 5 6 6 7 7 8 8 5

View File

@ -680,6 +680,45 @@ describe ('Obj Importer', function () {
});
});
it ('lines_in_meshes.obj', function (done) {
ImportObjFile ('lines_in_meshes.obj', function (model) {
assert.ok (OV.CheckModel (model));
assert.deepStrictEqual (ModelToObject (model), {
name : '',
materials : [
{ name : '' }
],
meshes : [
{
name : 'Mesh01',
lines : [
{
vertices : [0, 0, 0, 1, 0, 0],
mat : 0
},
{
vertices : [1, 1, 0, 0, 1, 0],
mat : 0
}
],
triangles : []
},
{
name : 'Mesh02',
lines : [
{
vertices : [0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1],
mat : 0
}
],
triangles : []
}
]
});
done ();
});
});
it ('lines_colors.obj', function (done) {
ImportObjFile ('lines_colors.obj', function (model) {
assert.ok (OV.CheckModel (model));