Browse Source

Update points parser for VTK Loader

Some vtk files don't have float numbers in POINTS section.
They are int numbers. For example, parse wants:
0.0 1.5 2.0
But came:
0 1.5 2
In previos implementation parse pattern don't parse
This fix remove part after "." in number, and search will work
Alex 11 years ago
parent
commit
b1f846408b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/js/loaders/VTKLoader.js

+ 1 - 1
examples/js/loaders/VTKLoader.js

@@ -60,7 +60,7 @@ THREE.VTKLoader.prototype = {
 
 
 		// float float float
 		// float float float
 
 
-		pattern = /([\+|\-]?[\d]+[\.][\d|\-|e]+)[ ]+([\+|\-]?[\d]+[\.][\d|\-|e]+)[ ]+([\+|\-]?[\d]+[\.][\d|\-|e]+)/g;
+		pattern = /([\+|\-]?[\d]+[\.]*[\d|\-|e]*)[ ]+([\+|\-]?[\d]+[\.]*[\d|\-|e]*)[ ]+([\+|\-]?[\d]+[\.]*[\d|\-|e]*)/g;
 
 
 		while ( ( result = pattern.exec( data ) ) !== null ) {
 		while ( ( result = pattern.exec( data ) ) !== null ) {