Skip to content

Commit 44ffd9d

Browse files
authored
binvox header fix (#2486)
Hello ! Apparently there has been an update to the binvox file header (tested on binvox version 1.38), now binvox files includes a new header line that looks like this : ``` # generated by [binvox], https://www.google.com/search?q=binvox, parameters: ... ``` This PR fixes the binvox parser and header to account for the newline.
2 parents c4b3acd + 3c708bf commit 44ffd9d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

trimesh/exchange/binvox.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def parse_binvox_header(fp):
5757
space = " "
5858
if not line.startswith(binvox):
5959
raise OSError("Not a binvox file")
60+
fp.readline()
6061
shape = tuple(int(s) for s in fp.readline().strip().split(space)[1:])
6162
translate = tuple(float(s) for s in fp.readline().strip().split(space)[1:])
6263
scale = float(fp.readline().strip().split(space)[1])
@@ -98,6 +99,7 @@ def parse_binvox(fp, writeable=False):
9899

99100

100101
_binvox_header = """#binvox 1
102+
# Generated by trimesh using Patrick Min format ---
101103
dim {sx} {sy} {sz}
102104
translate {tx} {ty} {tz}
103105
scale {scale}

0 commit comments

Comments
 (0)