aneeshtan / jsc3d

Automatically exported from code.google.com/p/jsc3d
0 stars 0 forks source link

large stl problem in IE9 #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
you focus the attention about test_ie_compatible.html Demo
2.
you (for example) overwrite hard_milk.stl original model with one of the 2 
files here in attachments (if you do not want to change js code). 
3.
you run demo test and select hard_milk.stl

What is the expected output? What do you see instead?

internet explorer 9 or 10(preview) doesn't show anything and remains waiting lo 
load stl file. 

What version of the product are you using? On what operating system?
I use the latest  jsc3d 0.9.8 version on windows7 32 bit.

Please provide any additional information below.

In Chrome everything is perfect and I can see these 2 file in attachments. But 
in ie9 or 10 I cannot visualize them.
Is there any idea?
In ie9 it seems I may visualize stl file only if their size is small (200k or 
similar)

Original issue reported on code.google.com by mariopon...@gmail.com on 20 Nov 2012 at 10:42

Attachments:

GoogleCodeExporter commented 9 years ago
The latest release of jsc3d.js (0.9.8) does not support binary stl format in 
IE9. This is because loading binary data using IE9's implementation of 
XmlHttpRequest is very inefficient. 

jsc3d_ie.js once implemented this using a snippet of vbscript to transcode the 
binary content of an stl file into a javascript array then read model from it 
(for more technical details, see 
http://code.google.com/p/jsc3d/source/browse/trunk/jsc3d/jsc3d_ie.js#4221). But 
this seems to cost too long for transcoding and will even lock the page for a 
while. So this method is not merged to jsc3d.js.

The good news is that IE10 makes promising enhancement on XHR's binary data 
access. I'm just looking into IE10's dev docs and re-writing that part.  All 
will be in next release.

Original comment by Humu2...@gmail.com on 20 Nov 2012 at 3:11

GoogleCodeExporter commented 9 years ago
really thanks, however by now i solved by installing the chrome framework on 
ie9 or ie10 and all is perfect!!

Original comment by mariopon...@gmail.com on 20 Nov 2012 at 3:49

GoogleCodeExporter commented 9 years ago
Hi i've found a way in order to convert in fast and efficient way a bynary file 
to array obect on IE9.

JSC3D.StlLoader.prototype.loadBinaryFromUrl = function (urlName) {

   var self = this;
   var xhr = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject('MSXML2.XMLHTTP.3.0');
   xhr.open('GET', urlName, true);
   var browserName = navigator.appName; 

   xhr.responseType = "arraybuffer";

   xhr.onreadystatechange = function () {
      if (xhr.readyState == 4) {

               var scene = new JSC3D.Scene;

               try {

                  var bytes = VBArray(xhr.responseBody).toArray(); // Only on IE!

                  self.parseStlBinary(scene, bytes);

               } catch (e) { }
               self.onload(scene);

      }
   };

   xhr.send();
};

it seems this command :

 var bytes = VBArray(xhr.responseBody).toArray(); 

works perfect in IE, i tested in IE9 with very large binary stl Files.

Give me your opinion if you like

hello, Mario

Original comment by mariopon...@yahoo.it on 19 Dec 2012 at 3:01

GoogleCodeExporter commented 9 years ago
Nice solution! It runs surprisingly fast in IE10, but does not seem to work in 
IE9 for the nonsupport of 'arraybuffer' response type.  I will add this to the 
next release of JSC3D to enable STL loader for IE10. 

Really thanks, Mario!

Original comment by Humu2...@gmail.com on 21 Dec 2012 at 10:01

GoogleCodeExporter commented 9 years ago
thanks to you, it's a pleasure for me to learn js by looking at your code!
But it should work on IE9 too. I use IE9 32 bit on windows 7 32 bit.

Hello, Mario

Original comment by mariopon...@gmail.com on 21 Dec 2012 at 10:45

GoogleCodeExporter commented 9 years ago
Mario,
I am too trying to find a way round the ie9 problem. Did your solution work 
with ie9 or was the support guy right with the array issue?

Original comment by undercut...@gmail.com on 24 Mar 2013 at 9:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The latest edition already provides support for loading STL binary and ascii 
files on IE9. Please get it from the repository. 

I'll release a new download package soon.

Original comment by Humu2...@gmail.com on 31 Jul 2013 at 2:29