Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenMesh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenMesh
OpenMesh
Commits
26b3682c
Commit
26b3682c
authored
Feb 04, 2019
by
Jan Möbius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ply_fix' into 'master'
Ply fix Closes
#64
See merge request
!208
parents
f2d07dc9
4c2c8f34
Pipeline
#8448
passed with stages
in 51 minutes and 47 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1298 additions
and
8 deletions
+1298
-8
Doc/changelog.docu
Doc/changelog.docu
+1
-0
src/OpenMesh/Core/IO/reader/PLYReader.cc
src/OpenMesh/Core/IO/reader/PLYReader.cc
+8
-8
src/Unittests/TestFiles/sphere840.ply
src/Unittests/TestFiles/sphere840.ply
+1271
-0
src/Unittests/unittests_read_write_PLY.cc
src/Unittests/unittests_read_write_PLY.cc
+18
-0
No files found.
Doc/changelog.docu
View file @
26b3682c
...
...
@@ -27,6 +27,7 @@
<li>PLY Reader: Allowing the PLY reader to read custom face ( Thanks to morgan Leborgne for the patch)</li>
<li>PLY Reader: Fixed endless loop on unknown property list type</li>
<li>PLY Reader: Fix hang when reading directly from istream (Thanks to Paul Loré for the patch)</li>
<li>PLY Reader: Fix file load for ASCII PLY without a newline at the end of the file (Thanks to Mathieu Lamarre for the patch )
<li>OM Writer/Reader: Update file format version to 2.0. Older files can still be read, but older OpenMesh versions cannot read new format.</li>
<li>OM Writer/Reader: Fixed inconsistent writing/reading of edge properties</li>
<li>OM Writer/Reader: Add option to store status</li>
...
...
src/OpenMesh/Core/IO/reader/PLYReader.cc
View file @
26b3682c
...
...
@@ -306,6 +306,14 @@ bool _PLYReader_::read_ascii(std::istream& _in, BaseImporter& _bi, const Options
for
(
std
::
vector
<
ElementInfo
>::
iterator
e_it
=
elements_
.
begin
();
e_it
!=
elements_
.
end
();
++
e_it
)
{
if
(
_in
.
eof
())
{
if
(
err_enabled
)
omerr
().
enable
();
omerr
()
<<
"Unexpected end of file while reading."
<<
std
::
endl
;
return
false
;
}
if
(
e_it
->
element_
==
VERTEX
)
{
// read vertices:
...
...
@@ -475,14 +483,6 @@ bool _PLYReader_::read_ascii(std::istream& _in, BaseImporter& _bi, const Options
}
}
if
(
_in
.
eof
())
{
if
(
err_enabled
)
omerr
().
enable
();
omerr
()
<<
"Unexpected end of file while reading."
<<
std
::
endl
;
return
false
;
}
if
(
e_it
->
element_
==
FACE
)
// stop reading after the faces since additional elements are not preserved anyway
break
;
...
...
src/Unittests/TestFiles/sphere840.ply
0 → 100644
View file @
26b3682c
ply
format ascii 1.0
element vertex 422
property float x
property float y
property float z
element face 840
property list uchar int vertex_indices
end_header
0 0 -127
5 25 -125
10 24 -125
15 21 -125
19 17 -125
22 13 -125
25 8 -125
26 2 -125
26 -3 -125
25 -9 -125
22 -14 -125
19 -18 -125
15 -22 -125
10 -25 -125
5 -26 -125
0 -27 -125
-6 -26 -125
-11 -25 -125
-16 -22 -125
-20 -18 -125
-23 -14 -125
-26 -9 -125
-27 -3 -125
-27 2 -125
-26 8 -125
-23 13 -125
-20 17 -125
-16 21 -125
-11 24 -125
-6 25 -125
-1 26 -125
10 50 -117
21 47 -117
30 41 -117
38 34 -117
44 25 -117
49 15 -117
51 5 -117
51 -6 -117
49 -16 -117
44 -26 -117
38 -35 -117
30 -42 -117
21 -48 -117
10 -51 -117
0 -52 -117
-11 -51 -117
-22 -48 -117
-31 -42 -117
-39 -35 -117
-45 -26 -117
-50 -16 -117
-52 -6 -117
-52 5 -117
-50 15 -117
-45 25 -117
-39 34 -117
-31 41 -117
-22 47 -117
-11 50 -117
-1 51 -117
15 73 -103
30 68 -103
43 60 -103
55 49 -103
64 37 -103
70 23 -103
74 7 -103
74 -8 -103
70 -24 -103
64 -38 -103
55 -50 -103
43 -61 -103
30 -69 -103
15 -74 -103
0 -75 -103
-16 -74 -103
-31 -69 -103
-44 -61 -103
-56 -50 -103
-65 -38 -103
-71 -24 -103
-75 -8 -103
-75 7 -103
-71 23 -103
-65 37 -103
-56 49 -103
-44 60 -103
-31 68 -103
-16 73 -103
-1 74 -103
19 92 -85
38 86 -85
55 76 -85
70 63 -85
81 47 -85
89 29 -85
93 9 -85
93 -10 -85
89 -30 -85
81 -48 -85
70 -64 -85
55 -77 -85
38 -87 -85
19 -93 -85
0 -95 -85
-20 -93 -85
-39 -87 -85
-56 -77 -85
-71 -64 -85
-82 -48 -85
-90 -30 -85
-94 -10 -85
-94 9 -85
-90 29 -85
-82 47 -85
-71 63 -85
-56 76 -85
-39 86 -85
-20 92 -85
-1 94 -85
22 107 -64
44 100 -64
64 88 -64
81 73 -64
95 54 -64
104 33 -64
109 11 -64
109 -12 -64
104 -34 -64
95 -55 -64
81 -74 -64
64 -89 -64
44 -101 -64
22 -108 -64
0 -110 -64
-23 -108 -64
-45 -101 -64
-65 -89 -64
-82 -74 -64
-96 -55 -64
-105 -34 -64
-110 -12 -64
-110 11 -64
-105 33 -64
-96 54 -64
-82 73 -64
-65 88 -64
-45 100 -64
-23 107 -64
-1 109 -64
25 118 -40
49 110 -40
70 97 -40
89 80 -40
104 60 -40
114 37 -40
120 12 -40
120 -13 -40
114 -38 -40
104 -61 -40
89 -81 -40
70 -98 -40
49 -111 -40
25 -119 -40
0 -121 -40
-26 -119 -40
-50 -111 -40
-71 -98 -40
-90 -81 -40
-105 -61 -40
-115 -38 -40
-121 -13 -40
-121 12 -40
-115 37 -40
-105 60 -40
-90 80 -40
-71 97 -40
-50 110 -40
-26 118 -40
-1 120 -40
26 123 -14
51 115 -14
74 102 -14
93 84 -14
109 63 -14
120 39 -14
125 13 -14
125 -14 -14
120 -40 -14
109 -64 -14
93 -85 -14
74 -103 -14
51 -116 -14
26 -124 -14
0 -127 -14
-27 -124 -14
-52 -116 -14
-75 -103 -14
-94 -85 -14
-110 -64 -14
-121 -40 -14
-126 -14 -14
-126 13 -14
-121 39 -14
-110 63 -14
-94 84 -14
-75 102 -14
-52 115 -14
-27 123 -14
-1 126 -14
26 123 13
51 115 13
74 102 13
93 84 13
109 63 13
120 39 13
125 13 13
125 -14 13
120 -40 13
109 -64 13
93 -85 13
74 -103 13
51 -116 13
26 -124 13
0 -127 13
-27 -124 13
-52 -116 13
-75 -103 13
-94 -85 13
-110 -64 13
-121 -40 13
-126 -14 13
-126 13 13
-121 39 13
-110 63 13
-94 84 13
-75 102 13
-52 115 13
-27 123 13
-1 126 13
25 118 39
49 110 39
70 97 39
89 80 39
104 60 39
114 37 39
120 12 39
120 -13 39
114 -38 39
104 -61 39
89 -81 39
70 -98 39
49 -111 39
25 -119 39
0 -121 39
-26 -119 39
-50 -111 39
-71 -98 39
-90 -81 39
-105 -61 39
-115 -38 39
-121 -13 39
-121 12 39
-115 37 39
-105 60 39
-90 80 39
-71 97 39
-50 110 39
-26 118 39
-1 120 39
22 107 63
44 100 63
64 88 63
81 73 63
95 54 63
104 33 63
109 11 63
109 -12 63
104 -34 63
95 -55 63
81 -74 63
64 -89 63
44 -101 63
22 -108 63
0 -110 63
-23 -108 63
-45 -101 63
-65 -89 63
-82 -74 63
-96 -55 63
-105 -34 63
-110 -12 63
-110 11 63
-105 33 63
-96 54 63
-82 73 63
-65 88 63
-45 100 63
-23 107 63
-1 109 63
19 92 84
38 86 84
55 76 84
70 63 84
81 47 84
89 29 84
93 9 84
93 -10 84
89 -30 84
81 -48 84
70 -64 84
55 -77 84
38 -87 84
19 -93 84
0 -95 84
-20 -93 84
-39 -87 84
-56 -77 84
-71 -64 84
-82 -48 84
-90 -30 84
-94 -10 84
-94 9 84
-90 29 84
-82 47 84
-71 63 84
-56 76 84
-39 86 84
-20 92 84
-1 94 84
15 73 102
30 68 102
43 60 102
55 49 102
64 37 102
70 23 102
74 7 102
74 -8 102
70 -24 102
64 -38 102
55 -50 102
43 -61 102
30 -69 102
15 -74 102
0 -75 102
-16 -74 102
-31 -69 102
-44 -61 102
-56 -50 102
-65 -38 102
-71 -24 102
-75 -8 102
-75 7 102
-71 23 102
-65 37 102
-56 49 102
-44 60 102
-31 68 102
-16 73 102
-1 74 102
10 50 116
21 47 116
30 41 116
38 34 116
44 25 116
49 15 116
51 5 116
51 -6 116
49 -16 116
44 -26 116
38 -35 116
30 -42 116
21 -48 116
10 -51 116
0 -52 116
-11 -51 116
-22 -48 116
-31 -42 116
-39 -35 116
-45 -26 116
-50 -16 116
-52 -6 116
-52 5 116
-50 15 116
-45 25 116
-39 34 116
-31 41 116
-22 47 116
-11 50 116
-1 51 116
5 25 124
10 24 124
15 21 124
19 17 124
22 13 124
25 8 124
26 2 124
26 -3 124
25 -9 124
22 -14 124
19 -18 124
15 -22 124
10 -25 124
5 -26 124
0 -27 124
-6 -26 124
-11 -25 124
-16 -22 124
-20 -18 124
-23 -14 124
-26 -9 124
-27 -3 124
-27 2 124
-26 8 124
-23 13 124
-20 17 124
-16 21 124
-11 24 124
-6 25 124
-1 26 124
0 0 127
3 0 1 2
3 0 2 3
3 0 3 4
3 0 4 5
3 0 5 6
3 0 6 7
3 0 7 8
3 0 8 9
3 0 9 10
3 0 10 11
3 0 11 12
3 0 12 13
3 0 13 14
3 0 14 15
3 0 15 16
3 0 16 17
3 0 17 18
3 0 18 19
3 0 19 20
3 0 20 21
3 0 21 22
3 0 22 23
3 0 23 24
3 0 24 25
3 0 25 26
3 0 26 27
3 0 27 28
3 0 28 29
3 0 29 30
3 0 30 1
3 1 32 2
3 32 1 31
3 2 33 3
3 33 2 32
3 3 34 4
3 34 3 33
3 4 35 5
3 35 4 34
3 5 36 6
3 36 5 35
3 6 37 7
3 37 6 36
3 7 38 8
3 38 7 37
3 8 39 9
3 39 8 38
3 9 40 10
3 40 9 39
3 10 41 11
3 41 10 40
3 11 42 12
3 42 11 41
3 12 43 13
3 43 12 42
3 13 44 14
3 44 13 43
3 14 45 15
3 45 14 44
3 15 46 16
3 46 15 45
3 16 47 17
3 47 16 46
3 17 48 18
3 48 17 47
3 18 49 19
3 49 18 48
3 19 50 20
3 50 19 49
3 20 51 21
3 51 20 50
3 21 52 22
3 52 21 51
3 22 53 23
3 53 22 52
3 23 54 24
3 54 23 53
3 24 55 25
3 55 24 54
3 25 56 26
3 56 25 55
3 26 57 27
3 57 26 56
3 27 58 28
3 58 27 57
3 28 59 29
3 59 28 58
3 29 60 30
3 60 29 59
3 30 31 1
3 31 30 60
3 31 62 32
3 62 31 61
3 32 63 33
3 63 32 62
3 33 64 34
3 64 33 63
3 34 65 35
3 65 34 64
3 35 66 36
3 66 35 65
3 36 67 37
3 67 36 66
3 37 68 38
3 68 37 67
3 38 69 39
3 69 38 68
3 39 70 40
3 70 39 69
3 40 71 41
3 71 40 70
3 41 72 42
3 72 41 71
3 42 73 43
3 73 42 72
3 43 74 44
3 74 43 73
3 44 75 45
3 75 44 74
3 45 76 46
3 76 45 75
3 46 77 47
3 77 46 76
3 47 78 48
3 78 47 77
3 48 79 49
3 79 48 78
3 49 80 50
3 80 49 79
3 50 81 51
3 81 50 80
3 51 82 52
3 82 51 81
3 52 83 53
3 83 52 82
3 53 84 54
3 84 53 83
3 54 85 55
3 85 54 84
3 55 86 56
3 86 55 85
3 56 87 57
3 87 56 86
3 57 88 58
3 88 57 87
3 58 89 59
3 89 58 88
3 59 90 60
3 90 59 89
3 60 61 31
3 61 60 90
3 61 92 62
3 92 61 91
3 62 93 63
3 93 62 92
3 63 94 64
3 94 63 93
3 64 95 65
3 95 64 94
3 65 96 66
3 96 65 95
3 66 97 67
3 97 66 96
3 67 98 68
3 98 67 97
3 68 99 69
3 99 68 98
3 69 100 70
3 100 69 99
3 70 101 71
3 101 70 100
3 71 102 72
3 102 71 101
3 72 103 73
3 103 72 102
3 73 104 74
3 104 73 103
3 74 105 75
3 105 74 104
3 75 106 76
3 106 75 105
3 76 107 77
3 107 76 106
3 77 108 78
3 108 77 107
3 78 109 79
3 109 78 108
3 79 110 80
3 110 79 109
3 80 111 81
3 111 80 110
3 81 112 82
3 112 81 111
3 82 113 83
3 113 82 112
3 83 114 84
3 114 83 113
3 84 115 85
3 115 84 114
3 85 116 86
3 116 85 115
3 86 117 87
3 117 86 116
3 87 118 88
3 118 87 117
3 88 119 89