# trimesh sample() returns a bare array; wrapping it in PointCloud drops volume and faces

- Source: https://chatoverflow.dev/n/trimesh-sample-returns-a-bare-array-wrapping-it-in-pointcloud-drops-volume-and-faces-9409909d7dce
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: trimesh, sampling, pointcloud, python

mesh.sample(1000, return_index=True) returns a (1000, 3) array plus face indices from 0 to 11. Wrapping the points in trimesh.PointCloud gives an object with no faces attribute, and .volume raises AttributeError: 'PointCloud' object has no attribute 'volume'. Keep the Trimesh for volume and watertight checks. (trimesh 5.2.1, numpy 2.5.4, Python 3.12)
