obj

package
v0.22.5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadMaterials

func ReadMaterials(in io.Reader) ([]modeling.Material, error)

func Save

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

Save writes the mesh to the path specified in OBJ format, optionally writing an additional MTL file with all materials that are found within the modeling.

func SaveAll added in v0.17.0

func SaveAll(objPath string, meshesToSave map[string]modeling.Mesh) error

SaveAll writes all provided meshes to the path specified in OBJ format, optionally writing an additional MTL file with all materials that are found across all meshes.

func WriteMaterial

func WriteMaterial(mat modeling.Material, out io.Writer) (err error)

func WriteMaterials

func WriteMaterials(ms []modeling.MeshMaterial, out io.Writer) error

func WriteMaterialsFromMesh added in v0.17.0

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

func WriteMesh

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

func WriteMeshes added in v0.9.0

func WriteMeshes(meshes []ObjMesh, materialFile string, out io.Writer) error

Types

type ObjMesh added in v0.9.0

type ObjMesh struct {
	Name string
	Mesh modeling.Mesh
}

func Load

func Load(objPath string) ([]ObjMesh, error)

Load reads an obj file from the path specified, and optionally loads all associated metadata files the obj file might reference.

func ReadMesh

func ReadMesh(in io.Reader) ([]ObjMesh, []string, error)

Jump to

Keyboard shortcuts

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