ObjExporter throws Error for any THREE.Line<BufferGeometry> passed to it.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 858
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
threeversion:^0.167.1@types/threeversion - :@types/three@0.167.2three-stdlibversion: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)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/exporters/OBJExporter.ts at parseLine and reproduce the error with a THREE.Line. Check the geometry-type guard against the reported behavior, then confirm that exporting the line completes without throwing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- three.js, typescript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100