Skip to content

Commit e5a22fc

Browse files
authored
Always write space delimiters (#20)
I tried to open a Ply file written by this package in QGIS and found that the parser in MDAL does not support tabs. I could of course fix that, but that seems much more involved, and perhaps this is a bit more consistent / common anyway.
1 parent 65fa400 commit e5a22fc

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/io.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function write_ascii_value(stream::IO, prop::ArrayProperty{<:AbstractArray}, ind
240240
p = prop.data[index]
241241
for i = 1:length(p)
242242
if i != 1
243-
write(stream, '\t')
243+
write(stream, ' ')
244244
end
245245
print(stream, p[i])
246246
end
@@ -366,7 +366,7 @@ function save_ply(ply, stream::IO; ascii::Bool=false)
366366
for i=1:length(element)
367367
for (j,property) in enumerate(element.properties)
368368
if j != 1
369-
write(stream, '\t')
369+
write(stream, ' ')
370370
end
371371
write_ascii_value(stream, property, i)
372372
end

test/runtests.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ end
6161
property int16 g
6262
comment Final comment
6363
end_header
64-
1 1.1 2 0 1
65-
2 2.2 3 2 3 4
66-
3 3.3 1 5
67-
-1 1
68-
1 1
64+
1 1.1 2 0 1
65+
2 2.2 3 2 3 4
66+
3 3.3 1 5
67+
-1 1
68+
1 1
6969
"""
7070
end
7171

@@ -197,9 +197,9 @@ end
197197
property uint8 g
198198
property uint8 b
199199
end_header
200-
1.0 2.0
201-
3.0 4.0
202-
1 2 3
200+
1.0 2.0
201+
3.0 4.0
202+
1 2 3
203203
"""
204204
end
205205

0 commit comments

Comments
 (0)