Convert attribute ``attr`` from either per-vertex or per-face attribute into per-voxel attribute. Args: mesh (:py:class:`Mesh`): Input mesh. attr (``numpy.ndarray``): #voxel by k matrix of floats. Returns: Per-voxel attribute. The value at a voxel will be the a
(mesh, attr)
| 42 | return PyMesh.convert_to_face_attribute_from_name(mesh.raw_mesh, name) |
| 43 | |
| 44 | def convert_to_voxel_attribute(mesh, attr): |
| 45 | """ Convert attribute ``attr`` from either per-vertex or per-face attribute |
| 46 | into per-voxel attribute. |
| 47 | |
| 48 | Args: |
| 49 | mesh (:py:class:`Mesh`): Input mesh. |
| 50 | attr (``numpy.ndarray``): #voxel by k matrix of floats. |
| 51 | |
| 52 | Returns: |
| 53 | Per-voxel attribute. The value at a voxel will be the average of |
| 54 | the values at its neighboring vertices or faces. |
| 55 | """ |
| 56 | return PyMesh.convert_to_voxel_attribute(mesh.raw_mesh, attr) |
| 57 | |
| 58 | def convert_to_voxel_attribute_from_name(mesh, name): |
| 59 | """ Same as :py:func:`convert_to_voxel_attribute` except looking up |