diff --git a/pyntcloud/__init__.py b/pyntcloud/__init__.py index 334f139..87feacc 100644 --- a/pyntcloud/__init__.py +++ b/pyntcloud/__init__.py @@ -1 +1 @@ -from .core_class import PyntCloud +from .core_class import PyntCloud diff --git a/pyntcloud/io/ply.py b/pyntcloud/io/ply.py index ef26801..eeb3bbd 100644 --- a/pyntcloud/io/ply.py +++ b/pyntcloud/io/ply.py @@ -75,7 +75,7 @@ def read_ply(filename): # element mesh if b'list' in line: - if b"vertex_indices" in line[-1]: + if b"vertex_indices" in line[-1] or b"vertex_index" in line[-1]: mesh_names = ["n_points", "v1", "v2", "v3"] else: has_texture = True diff --git a/tests/data/diamond_ascii_vertex_index.ply b/tests/data/diamond_ascii_vertex_index.ply new file mode 100644 index 0000000..fde2d75 --- /dev/null +++ b/tests/data/diamond_ascii_vertex_index.ply @@ -0,0 +1,31 @@ +ply +format ascii 1.0 +comment VCGLIB generated +element vertex 6 +property float x +property float y +property float z +property float nx +property float ny +property float nz +property uchar red +property uchar green +property uchar blue +property uchar alpha +element face 8 +property list uchar int vertex_index +end_header +0.5 0 0.5 0 -1 0 255 0 0 255 +0 0.5 0.5 -1 0 0 255 0 0 255 +0.5 0.5 0 0 0 -1 0 255 0 255 +1 0.5 0.5 1 0 0 255 0 0 255 +0.5 1 0.5 0 1 0 255 0 0 255 +0.5 0.5 1 0 0 1 0 0 255 255 +3 0 1 2 +3 0 3 2 +3 3 4 2 +3 4 1 2 +3 0 1 5 +3 0 3 5 +3 3 4 5 +3 4 1 5 diff --git a/tests/integration/io/test_from_file.py b/tests/integration/io/test_from_file.py index 3393f64..1b1fd24 100644 --- a/tests/integration/io/test_from_file.py +++ b/tests/integration/io/test_from_file.py @@ -38,6 +38,7 @@ def assert_mesh(data): @pytest.mark.parametrize("extension,color,mesh", [ (".ply", True, True), ("_ascii.ply", True, True), + ("_ascii_vertex_index.ply", True, True), (".npz", True, True), (".obj", False, True), (".off", False, False),