Skip to content
Snippets Groups Projects
Commit fd0b848f authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

TEST: Test Mesh with vertex sets needing different winding orders

parent 8af9ef7f
No related branches found
No related tags found
No related merge requests found
......@@ -417,3 +417,29 @@ def test_planeIntersection():
assert lines.shape == (0, 2, 3)
assert faces.shape == (0, )
assert dists.shape == (0, 2, 3)
def test_mesh_different_winding_orders():
verts1 = CUBE_VERTICES
verts2 = -CUBE_VERTICES
tris = CUBE_TRIANGLES_CCW
trisfixed = CUBE_TRIANGLES_CW
mnofix = fslmesh.Mesh(tris)
mfix = fslmesh.Mesh(tris)
mnofix.addVertices(verts1, key='v1', fixWinding=False)
mnofix.addVertices(verts2, key='v2', fixWinding=False)
mfix .addVertices(verts1, key='v1', fixWinding=True)
mfix .addVertices(verts2, key='v2', fixWinding=True)
mnofix.vertices = 'v1'
assert np.all(mnofix.indices == tris)
mnofix.vertices = 'v2'
assert np.all(mnofix.indices == tris)
mfix.vertices = 'v1'
assert np.all(mfix.indices == tris)
mfix.vertices = 'v2'
assert np.all(mfix.indices == trisfixed)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment