|
@@ -99,7 +99,13 @@ Object.assign( THREE.VTKLoader.prototype, THREE.EventDispatcher.prototype, {
|
|
|
|
|
|
var line = lines[ i ];
|
|
|
|
|
|
- if ( inPointsSection ) {
|
|
|
+ if ( line.indexOf( 'DATASET' ) === 0 ) {
|
|
|
+
|
|
|
+ var dataset = line.split( ' ' )[ 1 ];
|
|
|
+
|
|
|
+ if ( dataset !== 'POLYDATA' ) throw new Error( 'Unsupported DATASET type: ' + dataset );
|
|
|
+
|
|
|
+ } else if ( inPointsSection ) {
|
|
|
|
|
|
// get the vertices
|
|
|
while ( ( result = pat3Floats.exec( line ) ) !== null ) {
|
|
@@ -354,7 +360,13 @@ Object.assign( THREE.VTKLoader.prototype, THREE.EventDispatcher.prototype, {
|
|
|
state = findString( buffer, index );
|
|
|
line = state.parsedString;
|
|
|
|
|
|
- if ( line.indexOf( 'POINTS' ) === 0 ) {
|
|
|
+ if ( line.indexOf( 'DATASET' ) === 0 ) {
|
|
|
+
|
|
|
+ var dataset = line.split( ' ' )[ 1 ];
|
|
|
+
|
|
|
+ if ( dataset !== 'POLYDATA' ) throw new Error( 'Unsupported DATASET type: ' + dataset );
|
|
|
+
|
|
|
+ } else if ( line.indexOf( 'POINTS' ) === 0 ) {
|
|
|
|
|
|
vtk.push( line );
|
|
|
// Add the points
|
|
@@ -1117,7 +1129,7 @@ Object.assign( THREE.VTKLoader.prototype, THREE.EventDispatcher.prototype, {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- // TODO for vtu,vti,and other xml formats
|
|
|
+ throw new Error( 'Unsupported DATASET type' );
|
|
|
|
|
|
}
|
|
|
|