MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / convert_to_face_attribute

Function convert_to_face_attribute

python/pymesh/meshutils/attribute_utils.py:24–36  ·  view source on GitHub ↗

Convert attribute ``attr`` from either per-vertex or per-voxel attribute into per-face attribute. Args: mesh (:py:class:`Mesh`): Input mesh. attr (``numpy.ndarray``): #faces by k matrix of floats. Returns: Per-face attribute. The value at a face will be the ave

(mesh, attr)

Source from the content-addressed store, hash-verified

22 return PyMesh.convert_to_vertex_attribute_from_name(mesh.raw_mesh, name)
23
24def convert_to_face_attribute(mesh, attr):
25 """ Convert attribute ``attr`` from either per-vertex or per-voxel attribute
26 into per-face attribute.
27
28 Args:
29 mesh (:py:class:`Mesh`): Input mesh.
30 attr (``numpy.ndarray``): #faces by k matrix of floats.
31
32 Returns:
33 Per-face attribute. The value at a face will be the average of
34 the values at its neighboring vertices or its neighboring voxels.
35 """
36 return PyMesh.convert_to_face_attribute(mesh.raw_mesh, attr)
37
38def convert_to_face_attribute_from_name(mesh, name):
39 """ Same as :py:func:`convert_to_face_attribute` except looking up

Callers 4

test_vertex_to_faceMethod · 0.90
check_vertex_fieldMethod · 0.85
check_voxel_fieldMethod · 0.85

Calls 1

Tested by 3

test_vertex_to_faceMethod · 0.72
check_vertex_fieldMethod · 0.68
check_voxel_fieldMethod · 0.68