Class ObjFileWriter

java.lang.Object
boofcv.io.points.impl.ObjFileWriter

public class ObjFileWriter extends Object
Interface for creating an OBJ file. As components are added they are written to. It's possible to add a face that automatically uses recent vertexes. Only vertexes and faces are currently supported.
  • Field Details

    • formatFloat

      public String formatFloat
  • Constructor Details

    • ObjFileWriter

      public ObjFileWriter(Writer writer)
  • Method Details

    • addComment

      public void addComment(String comment) throws IOException
      Throws:
      IOException
    • addVertex

      public void addVertex(double x, double y, double z) throws IOException
      Throws:
      IOException
    • addTextureVertex

      public void addTextureVertex(double x, double y) throws IOException
      Throws:
      IOException
    • addVertexNormal

      public void addVertexNormal(double dx, double dy, double dz) throws IOException
      Throws:
      IOException
    • addMaterial

      public void addMaterial(String name) throws IOException
      Throws:
      IOException
    • addLibrary

      public void addLibrary(String name) throws IOException
      Throws:
      IOException
    • addGroup

      public void addGroup(String name) throws IOException
      Throws:
      IOException
    • addPoint

      public void addPoint(int vertex) throws IOException
      Throws:
      IOException
    • addLine

      public void addLine(@Nullable @Nullable DogArray_I32 vertexes) throws IOException
      Adds a line with the specified vertexes.

      NOTE: Vertexes indexes are 0-indexed. Not 1-indexed like they are in OBJ files.

      Parameters:
      vertexes - Index of vertexes in this face. If null then automatic.
      Throws:
      IOException
    • addFace

      public void addFace(@Nullable @Nullable DogArray_I32 vertexes) throws IOException
      Adds a face with the specified vertexes. If there are no vertex indexes it will reference all the vertexes added since the last object was written.

      NOTE: Vertexes indexes are 0-indexed. Not 1-indexed like they are in OBJ files.

      Parameters:
      vertexes - Index of vertexes in this face. If null then automatic.
      Throws:
      IOException