mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-16 19:17:57 +01:00
instance check instead of type check
This commit is contained in:
parent
782c61ecdb
commit
b6350871be
@ -22,9 +22,9 @@ export default class extends EventDispatcher {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
setGeometry (geometry, matrix) {
|
setGeometry (geometry, matrix) {
|
||||||
if (geometry.type === 'BufferGeometry') {
|
if (geometry instanceof THREE.BufferGeometry) {
|
||||||
geometry = new THREE.Geometry().fromBufferGeometry(geometry);
|
geometry = new THREE.Geometry().fromBufferGeometry(geometry);
|
||||||
} else if (geometry.type.endsWith('Geometry')) {
|
} else if (geometry instanceof THREE.Geometry) {
|
||||||
geometry = geometry.clone();
|
geometry = geometry.clone();
|
||||||
} else {
|
} else {
|
||||||
throw 'Geometry is not an instance of BufferGeometry or Geometry';
|
throw 'Geometry is not an instance of BufferGeometry or Geometry';
|
||||||
|
Loading…
Reference in New Issue
Block a user