render

package
v0.0.0-...-1c91121 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create3MF

func Create3MF(filename string, r Renderer) error

Create3MF saves Renderer stream to a 3MF file type. This function is in experimental stage and may not work properly for large models.

func CreateSTL

func CreateSTL(path string, r Renderer) error

CreateSTL renders an SDF3 as an STL file using a Renderer.

func NewOctreeRenderer

func NewOctreeRenderer(s sdf.SDF3, meshCells int) *octree

NewOctreeRenderer returns a Marching Cubes implementation using octree cube sampling. As of May 2022 this implementation leaks the todo cube slice which may impact performance for complex shapes rendered at high resolutions. This is because it is much faster this way and simpler. Ideally the todo slice should be a queue or circular buffer.

func RenderAll

func RenderAll(r Renderer) ([]r3.Triangle, error)

RenderAll reads the full contents of a Renderer and returns the slice read. It does not return error on io.EOF, like the io.RenderAll implementation.

func WriteSTL

func WriteSTL(w io.Writer, model []r3.Triangle) error

WriteSTL writes model triangles to a writer in STL file format.

Types

type Renderer

type Renderer interface {
	ReadTriangles(t []r3.Triangle) (int, error)
}

type TriangleBuffer

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

func (*TriangleBuffer) Len

func (b *TriangleBuffer) Len() int

func (*TriangleBuffer) Read

func (b *TriangleBuffer) Read(t []r3.Triangle) int

Read reads from this buffer.

func (*TriangleBuffer) Write

func (b *TriangleBuffer) Write(t []r3.Triangle) int

Write appends triangles to this buffer.

Jump to

Keyboard shortcuts

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