diff --git a/pymeshlab/tests/example_custom_mesh_attributes.py b/pymeshlab/tests/example_custom_mesh_attributes.py index 90176e8..b5bd4fd 100644 --- a/pymeshlab/tests/example_custom_mesh_attributes.py +++ b/pymeshlab/tests/example_custom_mesh_attributes.py @@ -1,4 +1,5 @@ import pymeshlab +import numpy def example_custom_mesh_attributes(): @@ -51,3 +52,24 @@ def example_custom_mesh_attributes(): # - __ca_fs__: Custom Attribute Face Scalar; # - __ca_fp__: Custom Attribute Face Point; ms.save_current_mesh(output_path + 'cube_custom_attr.ply', binary=False, __ca_vs__v_attr=True) + + # add a point attribute manually using numpy array + + # generate numpy array + attrs = numpy.array([ + [-0.5, -0.5, -0.5], + [0.5, -0.5, -0.5], + [-0.5, 0.5, -0.5], + [0.5, 0.5, -0.5], + [-0.5, -0.5, 0.5], + [0.5, -0.5, 0.5], + [-0.5, 0.5, 0.5], + [0.5, 0.5, 0.5]]) + + # add a new custom point attribute + m.add_vertex_custom_point_attribute(attrs, 'numpy_attr') + + # get the attribute and print it + ret_attr = m.vertex_custom_point_attribute_matrix('numpy_attr') + + print(ret_attr) \ No newline at end of file diff --git a/src/meshlab b/src/meshlab index 30bd2e8..06c2e55 160000 --- a/src/meshlab +++ b/src/meshlab @@ -1 +1 @@ -Subproject commit 30bd2e8bb898855f9c687eb83d7a0a9688c9c1bb +Subproject commit 06c2e556beed1b1f86a4870920f81db89a93e763