From b6350871be71607f5b92870e57f4c8ecfb06c110 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Tue, 19 Jul 2016 14:26:06 +0200 Subject: [PATCH] instance check instead of type check --- src/slicer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slicer.js b/src/slicer.js index b9ba263..7dc8e07 100644 --- a/src/slicer.js +++ b/src/slicer.js @@ -22,9 +22,9 @@ export default class extends EventDispatcher { return this; } setGeometry (geometry, matrix) { - if (geometry.type === 'BufferGeometry') { + if (geometry instanceof THREE.BufferGeometry) { geometry = new THREE.Geometry().fromBufferGeometry(geometry); - } else if (geometry.type.endsWith('Geometry')) { + } else if (geometry instanceof THREE.Geometry) { geometry = geometry.clone(); } else { throw 'Geometry is not an instance of BufferGeometry or Geometry';