Skip to content

ObjExporter throws Error for any THREE.Line<BufferGeometry> passed to it. #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Hudi304 opened this issue Mar 13, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Hudi304
Copy link

Hudi304 commented Mar 13, 2025

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) 
@Hudi304 Hudi304 added the bug Something isn't working label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant