mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-19 12:27:56 +01:00
instance check instead of type check
This commit is contained in:
parent
0553076c57
commit
35a50f222e
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user