three version: ^0.167.1
@types/three version - : @types/three@0.167.2
three-stdlib version: three-stdlib@2.35.14
Problem description:
I was trying to export some THREE.Line<BufferGeometry> objects and the exporter throws THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry. I checked and rechecked my code it looks absolutely fine (works fine with meshes, didn't try points).
Relevant code:
https://github.com/pmndrs/three-stdlib/blob/main/src/exporters/OBJExporter.ts
private parseLine(line: Line): void {
let nbVertex = 0
const geometry = line.geometry
const type = line.type
if (geometry.isBufferGeometry) {
throw new Error('THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.')
}
...
}
Suggested solution:
I believe this condition needs to be negated.
if (geometry.isBufferGeometry)