Segmentation fault while reading a file

matheus matheus at gmail.com
Thu Aug 1 00:55:29 UTC 2024


On Wednesday, 31 July 2024 at 23:06:30 UTC, Ruby The Roobster 
wrote:
> ... or is `readln` bugging out because the file (backpack.obj 
> contained in the linked .zip file) is too large?
> ...

I don't have I compiler in hand to try your code at moment, but 
about your concern over the size of the file, you could try a 
simple object[1]:

# cube.obj
#

g cube

v  0.0  0.0  0.0
v  0.0  0.0  1.0
v  0.0  1.0  0.0
v  0.0  1.0  1.0
v  1.0  0.0  0.0
v  1.0  0.0  1.0
v  1.0  1.0  0.0
v  1.0  1.0  1.0

vn  0.0  0.0  1.0
vn  0.0  0.0 -1.0
vn  0.0  1.0  0.0
vn  0.0 -1.0  0.0
vn  1.0  0.0  0.0
vn -1.0  0.0  0.0

f  1//2  7//2  5//2
f  1//2  3//2  7//2
f  1//6  4//6  3//6
f  1//6  2//6  4//6
f  3//3  8//3  7//3
f  3//3  4//3  8//3
f  5//5  7//5  8//5
f  5//5  8//5  6//5
f  1//4  5//4  6//4
f  1//4  6//4  2//4
f  2//1  6//1  8//1
f  2//1  8//1  4//1

Matheus.

[1] https://cs.wellesley.edu/~cs307/readings/obj-ojects.html


More information about the Digitalmars-d-learn mailing list