tonylukasavage / jsstl

Pure Javascript code for parsing and rendering STL (ascii and binary) files
161 stars 50 forks source link

Gives RangeError when using different STL file #3

Open lponniah opened 9 years ago

lponniah commented 9 years ago

Hi,

I tried this code to display a different STL file like gato_3.stl. But it gives the below error

ArrayBuffer { byteLength: 519716 } RangeError: argument 1 accesses an index that is out of range

Could you kindly help resolve this?

Thanks

jdpsl commented 9 years ago

I ran into the same problem, however if you look at the code and the samples. it only parses binary stl format, it gives me an error also when i use ascii stl

jdpsl commented 9 years ago

parseStlBinary = function(stl) {

on line 40

5ilver commented 8 years ago

I got openscad ascii models to render.

Add geo.computeFaceNormals(); in the parsestl function above mesh = new THREE.Mesh( Below console.log(rep);, Change parseStlBinary(rep); to parseStl(rep); Set xhr.responseType = "string"; (instead of arraybuffer) Uncomment the xhr.setRequestHeader lines to include text content type stuff