File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ THREE.VTKLoader.prototype = {
259259
260260 // Nodal. Use BufferGeometry
261261 geometry = new THREE . BufferGeometry ( ) ;
262- geometry . setIndex ( new THREE . BufferAttribute ( new ( indices . length > 65535 ? Uint32Array : Uint16Array ) ( indices ) , 1 ) ) ;
262+ geometry . setIndex ( new THREE . BufferAttribute ( new Uint32Array ( indices ) , 1 ) ) ;
263263 geometry . addAttribute ( 'position' , new THREE . BufferAttribute ( new Float32Array ( positions ) , 3 ) ) ;
264264
265265 if ( colors . length == positions . length ) {
@@ -532,11 +532,18 @@ THREE.VTKLoader.prototype = {
532532
533533 var meta = String . fromCharCode . apply ( null , new Uint8Array ( data , 0 , 250 ) ) . split ( '\n' ) ;
534534
535- // console.log( meta );
536535
537- if ( meta [ 2 ] === 'ASCII' ) {
536+ if ( meta [ 2 ] . includes ( 'ASCII' ) ) {
538537
539- return parseASCII ( String . fromCharCode . apply ( null , new Uint8Array ( data ) ) ) ;
538+ var stringFile = '' ;
539+ var charArray = new Uint8Array ( data ) ;
540+ for ( var i = 0 ; i < charArray . length ; i ++ ) {
541+
542+ stringFile += String . fromCharCode ( charArray [ i ] ) ;
543+
544+ }
545+
546+ return parseASCII ( stringFile ) ;
540547
541548 } else {
542549
You can’t perform that action at this time.
0 commit comments