Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MTLFile ¶
type MTLFile struct {
Materials []*MTLFileMaterial
}
MTLFile represents the contents of a Wavefront mtl file, which is a companion of an obj file.
type MTLFileMaterial ¶
type MTLFileMaterial struct { Name string Ambient [3]float32 Diffuse [3]float32 Specular [3]float32 SpecularExponent float32 // Texture maps AmbientMap *MTLFileTextureMap DiffuseMap *MTLFileTextureMap SpecularMap *MTLFileTextureMap HighlightMap *MTLFileTextureMap }
MTLFileMaterial is a single material in an MTLFile.
type MTLFileTextureMap ¶
MTLFileTextureMap is a configured texture map for an MTLFileMaterial.
type OBJFile ¶
type OBJFile struct { MaterialFiles []string Vertices [][3]float64 UVs [][2]float64 Normals [][3]float64 FaceGroups []*OBJFileFaceGroup }
An OBJFile represents the contents of a Wavefront obj file.
type OBJFileFaceGroup ¶
type OBJFileFaceGroup struct { // Material is the material name, or "" by default. Material string // Each face has three vertices, which itself has a // vertex, texture, and normal index. // If a texture or normal index is 0, it is omitted. Faces [][3][3]int }
An OBJFileFaceGroup is a group of faces with one material in a Wavefront obj file.
type OFFReader ¶
type OFFReader struct {
// contains filtered or unexported fields
}
An OFFReader reads an OFF file.
For info on the OFF format, see http://segeval.cs.princeton.edu/public/off_format.html.
func NewOFFReader ¶
NewOFFReader reads the header from an OFF file and returns the new reader, if successful.
type PLYWriter ¶
type PLYWriter struct {
// contains filtered or unexported fields
}
A PLYWriter encodes a PLY writable stream.
This may use buffering as it writes the file, but the full file will always be flushed by the time the last triangle is written.
func NewPLYWriter ¶
NewPLYWriter creates a new PLYWriter and writes the file header.
func (*PLYWriter) WriteCoord ¶
WriteCoord writes the next coordinate to the file.
This should be called exactly numCoords times.
func (*PLYWriter) WriteTriangle ¶
WriteTriangle writes the next triangle to the file.
This should be called exactly numTris times.
type STLReader ¶
type STLReader struct {
// contains filtered or unexported fields
}
An STLReader reads STL files.
func NewSTLReader ¶
NewSTLReader creates an STL reader by reading the header of an STL file.
func (*STLReader) NumTriangles ¶
NumTriangles gets the total number of triangles in the file as reported by the header.
type STLWriter ¶
type STLWriter struct {
// contains filtered or unexported fields
}
An STLWriter writes a triangle mesh in the STL format.
func NewSTLWriter ¶
NewSTLWriter creates an STLWriter and writes a header, which requires knowledge of the total number of triangles being written.