We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4be3d13 commit bd7fabbCopy full SHA for bd7fabb
pyntcloud/io/off.py
@@ -13,6 +13,10 @@ def read_off(filename):
13
raise ValueError("The file does not start with the word OFF")
14
has_color = "C" in first_line
15
16
+ num_rows = None
17
+ n_points = None
18
+ n_faces = None
19
+
20
# Read header.
21
for line in f:
22
if line.startswith("#"):
@@ -25,6 +29,9 @@ def read_off(filename):
25
29
num_rows = n_points + n_faces
26
30
break
27
31
32
+ if num_rows is None:
33
+ raise ValueError("The file does not contain a valid header")
34
28
35
# Read remaining lines.
36
lines = [next(f) for _ in range(num_rows)]
37
0 commit comments