public class ObjTriangleMeshReader extends AbstractObjPolygonReader
triangle mesh
.Constructor and Description |
---|
ObjTriangleMeshReader(Reader reader,
Precision.DoubleEquivalence precision)
Construct a new instance that reads OBJ content from the given reader.
|
Modifier and Type | Method and Description |
---|---|
protected void |
handleNormal(Vector3D normal)
Method called when a normal is found in the OBJ content.
|
protected void |
handleVertex(Vector3D vertex)
Method called when a vertex is found in the OBJ content.
|
TriangleMesh |
readTriangleMesh()
Return a
triangle mesh constructed from all of the OBJ content
from the underlying reader. |
close, isFailOnNonPolygonKeywords, readFace, setFailOnNonPolygonKeywords
public ObjTriangleMeshReader(Reader reader, Precision.DoubleEquivalence precision)
reader
- reader to read fromprecision
- precision context used to compare floating point numberspublic TriangleMesh readTriangleMesh()
triangle mesh
constructed from all of the OBJ content
from the underlying reader. Non-triangle faces are converted to triangles using a simple
triangle fan. All vertices present in the OBJ content are also present in the returned mesh,
regardless of whether or not they are used in a face.IllegalStateException
- if data format error occursUncheckedIOException
- if an I/O error occursprotected void handleVertex(Vector3D vertex)
handleVertex
in class AbstractObjPolygonReader
vertex
- vertex valueprotected void handleNormal(Vector3D normal)
handleNormal
in class AbstractObjPolygonReader
normal
- normal valueCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.