|
@@ -44,31 +44,25 @@ THREE.VTKLoader.prototype = {
|
|
|
|
|
|
var geometry = new THREE.Geometry();
|
|
|
|
|
|
- function vertex( x, y, z ) {
|
|
|
+ var vertex = function ( x, y, z ) {
|
|
|
|
|
|
geometry.vertices.push( new THREE.Vector3( x, y, z ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
- function face3( a, b, c ) {
|
|
|
+ var face3 = function ( a, b, c ) {
|
|
|
|
|
|
geometry.faces.push( new THREE.Face3( a, b, c ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
- function face4( a, b, c, d ) {
|
|
|
-
|
|
|
- geometry.faces.push( new THREE.Face4( a, b, c, d ) );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
var pattern, result;
|
|
|
|
|
|
// float float float
|
|
|
|
|
|
pattern = /([\+|\-]?[\d]+[\.][\d|\-|e]+)[ ]+([\+|\-]?[\d]+[\.][\d|\-|e]+)[ ]+([\+|\-]?[\d]+[\.][\d|\-|e]+)/g;
|
|
|
|
|
|
- while ( ( result = pattern.exec( data ) ) != null ) {
|
|
|
+ while ( ( result = pattern.exec( data ) ) !== null ) {
|
|
|
|
|
|
// ["1.0 2.0 3.0", "1.0", "2.0", "3.0"]
|
|
|
|
|
@@ -80,7 +74,7 @@ THREE.VTKLoader.prototype = {
|
|
|
|
|
|
pattern = /3[ ]+([\d]+)[ ]+([\d]+)[ ]+([\d]+)/g;
|
|
|
|
|
|
- while ( ( result = pattern.exec( data ) ) != null ) {
|
|
|
+ while ( ( result = pattern.exec( data ) ) !== null ) {
|
|
|
|
|
|
// ["3 1 2 3", "1", "2", "3"]
|
|
|
|
|
@@ -92,11 +86,12 @@ THREE.VTKLoader.prototype = {
|
|
|
|
|
|
pattern = /4[ ]+([\d]+)[ ]+([\d]+)[ ]+([\d]+)[ ]+([\d]+)/g;
|
|
|
|
|
|
- while ( ( result = pattern.exec( data ) ) != null ) {
|
|
|
+ while ( ( result = pattern.exec( data ) ) !== null ) {
|
|
|
|
|
|
// ["4 1 2 3 4", "1", "2", "3", "4"]
|
|
|
|
|
|
- face4( parseInt( result[ 1 ] ), parseInt( result[ 2 ] ), parseInt( result[ 3 ] ), parseInt( result[ 4 ] ) );
|
|
|
+ face3( parseInt( result[ 1 ] ), parseInt( result[ 2 ] ), parseInt( result[ 4 ] ) );
|
|
|
+ face3( parseInt( result[ 2 ] ), parseInt( result[ 3 ] ), parseInt( result[ 4 ] ) );
|
|
|
|
|
|
}
|
|
|
|