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

Merge branch 'bf/mesh' into 'master'

Bf/mesh

See merge request fsl/fslpy!132
parents 99eb7f2b e4d972ac
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,8 @@ Fixed
* The :func:`.makeWriteable` function will always create a copy of an
``array`` if its base is a ``bytes`` object.
* Fixed a bug in the :meth:`.GitfitMesh.loadVertices` method.
* Fixed a bug in the :meth:`.Mesh.addVertices` method where the wrong face
normals could be used for newly added vertex sets.
2.2.0 (Wednesday May 8th 2019)
......
......@@ -422,7 +422,7 @@ class Mesh(notifier.Notifier, meta.Meta):
if fixWinding:
indices = self.__indices
normals = self.normals
normals = calcFaceNormals(vertices, indices)
needsFix = needsFixing(vertices, indices, normals, lo, hi)
# See needsFixing documentation
......@@ -433,6 +433,8 @@ class Mesh(notifier.Notifier, meta.Meta):
self.__vindices[ key] = self.__fixedIndices
self.__faceNormals[key] = normals * -1
else:
self.__faceNormals[key] = normals
return vertices
......
......@@ -174,7 +174,11 @@ def _test_block():
idle.block(2)
end = time.time()
assert (end - start) >= 2
# Be relaxed about precision - timing
# can sometimes be pretty sloppy when
# running in a docker container.
assert abs((end - start) < 2) < 0.05
if fslplatform.haveGui:
assert called[0]
......
......@@ -433,6 +433,7 @@ def test_mesh_different_winding_orders():
mnofix.addVertices(verts2, key='v2', fixWinding=False)
mfix .addVertices(verts1, key='v1', fixWinding=True)
mfix .addVertices(verts2, key='v2', fixWinding=True)
mfix .addVertices(verts1, key='v3', fixWinding=True, select=False)
mnofix.vertices = 'v1'
assert np.all(mnofix.indices == tris)
......@@ -443,3 +444,5 @@ def test_mesh_different_winding_orders():
assert np.all(mfix.indices == tris)
mfix.vertices = 'v2'
assert np.all(mfix.indices == trisfixed)
mfix.vertices = 'v3'
assert np.all(mfix.indices == tris)
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