CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.71k stars 307 forks source link

Power plant model does not convert #2

Closed pjcozzi closed 7 years ago

pjcozzi commented 8 years ago

Model: http://graphics.cs.williams.edu/data/meshes.xml

$ node bin/obj2gltf.js powerplant.obj

#
# Fatal error in d:\jenkins\workspace\nodejs-msi-julien\d8c2e2bb\deps\v8\src/handles.h, line 48
# CHECK(location_ != NULL) failed
#

Is it just out of memory?

mramato commented 8 years ago

Try adding --max-old-space-size=8192 right after node and that will allow 8 gigs of RAM and you can tell if it's a memory issue.

pjcozzi commented 8 years ago

Running with

node --max-old-space-size=4096 bin/obj2gltf.js  powerplant.obj  -o a.gltf

And larger memory sizes avoid the crash; however, it returns quickly and does not generate a glTF model. Perhaps this is related to the MTL file?

lilleyse commented 8 years ago

For me it doesn't work even with --max-old-space-size=16384. It fails at fs.readFile on the obj file, so I'll try out streams instead and see how it goes.

pjcozzi commented 8 years ago

Thanks @lilleyse! This will be useful for our Web3D tutorial.

lilleyse commented 8 years ago

It looks like the power plant model uses negative face indices in a lot of places, which I didn't know the OBJ format even supported. So I hope handling that will get this to work.

f -1468758//-106815 -1468757//-106606 -1468749//-106724
f -1468758//-106815 -1468749//-106724 -1468750//-106808
f -1468757//-106606 -1468756//-106605 -1468748//-106603
f -1468757//-106606 -1468748//-106603 -1468749//-106724
f -1468756//-106605 -1468755//-106604 -1468747//-106602
f -1468756//-106605 -1468747//-106602 -1468748//-106603
f -1468755//-106604 -1468754//-107067 -1468746//-106601
lilleyse commented 7 years ago

Fixed in #49

Converts with the --bypassPipeline flag. Still too large to be handled by gltf-pipeline however.

mramato commented 7 years ago

You should write up a copy of this issue for gltf-pipeline so we fix it there too.