Commit 9274adf9 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Added trimesh property to Mesh class.

parent 8e974faf
......@@ -27,6 +27,8 @@ import numpy as np
import six
import trimesh
import fsl.utils.transform as transform
from . import image as fslimage
......@@ -121,6 +123,11 @@ class TriangleMesh(object):
if fixWinding:
self.__fixWindingOrder()
self.__trimesh = trimesh.Trimesh(self.__vertices,
self.__indices,
process=False,
validate=False)
def __repr__(self):
"""Returns a string representation of this ``TriangleMesh`` instance.
......@@ -147,6 +154,14 @@ class TriangleMesh(object):
return self.__indices
@property
def trimesh(self):
"""Reference to a ``trimesh.Trimesh`` object which can be used for
geometric operations on the mesh.
"""
return self.__trimesh
def __fixWindingOrder(self):
"""Called by :meth:`__init__` if ``fixWinding is True``. Fixes the
mesh triangle winding order so that all face normals are facing
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment