stl

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

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

func ReadMesh

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

func Save

func Save(fp string, m modeling.Mesh) error

func Write

func Write(out io.Writer, bin Binary) error

func WriteMesh

func WriteMesh(out io.Writer, m modeling.Mesh) error

Types

type Binary

type Binary struct {
	Header    Header
	Triangles []Triangle
}

func Read

func Read(in io.Reader) (*Binary, error)
type Header [80]byte

type Triangle

type Triangle struct {
	Normal    Vec
	Vertex1   Vec
	Vertex2   Vec
	Vertex3   Vec
	Attribute uint16
}

type Vec

type Vec struct {
	X float32
	Y float32
	Z float32
}

func (Vec) Float64

func (v Vec) Float64() vector3.Float64

func (Vec) Zero

func (v Vec) Zero() bool

Jump to

Keyboard shortcuts

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