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

Method get_voxel_attribute

python/pymesh/Mesh.py:98–106  ·  view source on GitHub ↗

Same as :py:meth:`.get_attribute` but reshaped to have :py:attr:`num_voxels` rows.

(self, name)

Source from the content-addressed store, hash-verified

96 (self.num_faces, -1), order="C")
97
98 def get_voxel_attribute(self, name):
99 """ Same as :py:meth:`.get_attribute` but reshaped to have
100 :py:attr:`num_voxels` rows.
101 """
102 if self.num_voxels == 0:
103 return self.__mesh.get_attribute(name)
104 else:
105 return self.__mesh.get_attribute(name).reshape(
106 (self.num_voxels, -1), order="C")
107
108 def set_attribute(self, name, val):
109 """ Set attribute to the given value.

Callers 2

mainFunction · 0.80

Calls 1

get_attributeMethod · 0.45

Tested by

no test coverage detected