Skip to content

Commit

Permalink
Merge ff0f789 into fa868bf
Browse files Browse the repository at this point in the history
  • Loading branch information
panangam committed Feb 7, 2020
2 parents fa868bf + ff0f789 commit c78d03c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions trimesh/path/path.py
Expand Up @@ -1017,6 +1017,19 @@ def plot_entities(self, show=False):
if show:
plt.show()

@caching.cache_decorator
def centroid(self):
"""
Return the centroid of the path object.
Returns
-----------
centroid : (d,) float
Approximate centroid of the path
"""
centroid = self.vertices.mean(axis=0)
return centroid


class Path2D(Path):

Expand Down

0 comments on commit c78d03c

Please sign in to comment.