three-stdlib
three-stdlib copied to clipboard
ObjExporter throws Error for any THREE.Line<BufferGeometry> passed to it.
threeversion:^0.167.1@types/threeversion - :@types/[email protected]three-stdlibversion:[email protected]
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)