We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e877ee2 commit 1be9da6Copy full SHA for 1be9da6
trimesh/base.py
@@ -1562,7 +1562,11 @@ def facets_area(self):
1562
# avoid thrashing the cache inside a loop
1563
area_faces = self.area_faces
1564
# sum the area of each group of faces represented by facets
1565
- areas = np.array([area_faces[i].sum() for i in self.facets])
+ # use native python sum in tight loop as opposed to array.sum()
1566
+ # as in this case the lower function call overhead of
1567
+ # native sum provides roughly a 50% speedup
1568
+ areas = np.array([sum(area_faces[i]) for i in self.facets],
1569
+ dtype=np.float64)
1570
return areas
1571
1572
@caching.cache_decorator
trimesh/version.py
@@ -1 +1 @@
1
-__version__ = '2.33.40'
+__version__ = '2.33.41'
0 commit comments