ply

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GuassianSplatVertexAttributes map[string]bool = map[string]bool{
	"x":       true,
	"y":       true,
	"z":       true,
	"scale_0": true,
	"scale_1": true,
	"scale_2": true,
	"rot_0":   true,
	"rot_1":   true,
	"rot_2":   true,
	"rot_3":   true,
	"f_dc_0":  true,
	"f_dc_1":  true,
	"f_dc_2":  true,
	"opacity": true,
}

Functions

func Load

func Load(filepath string) (*modeling.Mesh, error)

func ReadMesh added in v0.2.0

func ReadMesh(in io.Reader) (*modeling.Mesh, error)

func Save

func Save(plyPath string, meshToSave modeling.Mesh) error

Save writes the mesh to the path specified in PLY format

func SaveBinary added in v0.7.0

func SaveBinary(plyPath string, meshToSave modeling.Mesh) error

func WriteASCII

func WriteASCII(out io.Writer, model modeling.Mesh) error

func WriteBinary added in v0.7.0

func WriteBinary(out io.Writer, model modeling.Mesh) error

Types

type AsciiReader

type AsciiReader struct {
	// contains filtered or unexported fields
}

func (*AsciiReader) ReadMesh

func (ar *AsciiReader) ReadMesh(vertexAttributes map[string]bool) (*modeling.Mesh, error)

type BinaryReader added in v0.2.0

type BinaryReader struct {
	// contains filtered or unexported fields
}

func (*BinaryReader) ReadMesh added in v0.2.0

func (le *BinaryReader) ReadMesh(vertexAttributes map[string]bool) (*modeling.Mesh, error)

type BodyReader added in v0.10.0

type BodyReader interface {
	ReadMesh(vertexAttributes map[string]bool) (*modeling.Mesh, error)
}

type Element

type Element struct {
	Name       string     `json:"name"`
	Count      int        `json:"count"`
	Properties []Property `json:"properties"`
}

func (Element) Write

func (e Element) Write(out io.Writer) error

type Format

type Format int64
const (
	ASCII Format = iota
	BinaryBigEndian
	BinaryLittleEndian
)
type Header struct {
	Format      Format    `json:"format"`
	Elements    []Element `json:"elements"`
	TextureFile *string   `json:"texture,omitempty"`
}

func ReadHeader added in v0.10.0

func ReadHeader(in io.Reader) (Header, error)

func (Header) BuildReader added in v0.10.0

func (h Header) BuildReader(in io.Reader) BodyReader

type ListProperty

type ListProperty struct {
	// contains filtered or unexported fields
}

func (ListProperty) Name

func (lp ListProperty) Name() string

func (ListProperty) Write

func (lp ListProperty) Write(out io.Writer) (err error)

type Property

type Property interface {
	Name() string
	Write(out io.Writer) error
}

type ScalarProperty

type ScalarProperty struct {
	PropertyName string             `json:"name"`
	Type         ScalarPropertyType `json:"type"`
}

func (ScalarProperty) Name

func (sp ScalarProperty) Name() string

func (ScalarProperty) Size added in v0.2.0

func (sp ScalarProperty) Size() int

func (ScalarProperty) Write

func (sp ScalarProperty) Write(out io.Writer) (err error)

type ScalarPropertyType

type ScalarPropertyType string
const (
	Char   ScalarPropertyType = "char"
	UChar  ScalarPropertyType = "uchar" //  uint8
	Short  ScalarPropertyType = "short"
	UShort ScalarPropertyType = "ushort"
	Int    ScalarPropertyType = "int"
	UInt   ScalarPropertyType = "uint"
	Float  ScalarPropertyType = "float"
	Double ScalarPropertyType = "double"
)

Jump to

Keyboard shortcuts

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