off

package
v0.0.0-...-b5aa40e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

package off describes methods for interacting with OFF files and structures formatted as OFF files. The file loading code is modeled after Ryan Holmes' C++ code, http://www.holmes3d.net/graphics/offfiles/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(o OFF) (*dcel.DCEL, error)

Decode converts an OFF struct into a dcel.

func Load

func Load(file string) (*dcel.DCEL, error)

Load loads Object File Format files.

func Read

func Read(f io.Reader) (*dcel.DCEL, error)

Read peforms the underlying work to transform OFF data into a dcel.DCEL.

Types

type Face

type Face []int

type OFF

type OFF struct {
	NumVertices, NumFaces, NumEdges int
	Vertices                        []Vertex
	Faces                           []Face
}

OFF represents the geometric values stored in the OFF format. Does not store color. Todo: if we could make a structure that satisfied io.Reader, we could have less duplicate code here.

func NewOFF

func NewOFF() OFF

func Save

func Save(dc *dcel.DCEL) OFF

Save converts a DCEL into an OFF structure.

func (OFF) WriteFile

func (of OFF) WriteFile(relPath string) error

WriteFile takes an OFF structure and writes it to the given relative path.

type Vertex

type Vertex [3]float64

func NewVertex

func NewVertex(d geom.D3) Vertex

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL