Throw error when provided mesh is empty

@peteruithoven
This commit is contained in:
casperlamboo 2017-07-24 15:40:39 +02:00
parent 8b475d8e4b
commit cb465b9eee

View File

@ -23,6 +23,10 @@ export function sliceGeometry(settings, geometry, matrix, sync = false, onProgre
throw new Error('Geometry is not an instance of BufferGeometry or Geometry');
}
if (geometry.faces.length === 0) {
throw new Error('Geometry does not contain any data');
}
if (matrix) {
geometry.applyMatrix(matrix);
}