stl

package
v0.0.0-...-a894b33 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

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

Get the corresponding edge for the Nodes

func (*Edge) EdgeDiff

func (thisEd *Edge) EdgeDiff(othEd *Edge) bool

see two edge is differ

func (*Edge) HasEdge

func (thisEd *Edge) HasEdge(othTriLine *TriLine) (bool, int8)

see two edge is differ

type Element

type Element struct {
	Nodes [3]Vertex
}

Store the element it is a vertex

func NewElement

func NewElement(v0, v1, v2 Vertex) *Element

Compute a vertex

func (Element) GetEdge

func (ele Element) GetEdge() *TriLine

func (Element) GetNormalReverse

func (ele Element) GetNormalReverse() Vertex

Compute a vertex

func (Element) Move

func (ele Element) Move(normTrans *Vertex, ExtrudLen float64) *Element

Translation and the same the normal direction

func (Element) Translation

func (ele Element) Translation(normTrans *Vertex, ExtrudLen float64) *Element

Translation and reverse the normal direction

type ExtrudeFace

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

func Extrude

func Extrude(start Vertex, end Vertex, normExtrude *Vertex, ExtrudLen float64) *ExtrudeFace

type Mesh

type Mesh struct {
	//Store a list of Elements
	Elements []Element

	//Store the name of the info
	Name string
}

Hold everything in the mesh

func ExtrudeTriAndCreateMesh

func ExtrudeTriAndCreateMesh(pts []Vertex, normExtrude *Vertex, ExtrudLen float64) (*Mesh, error)

func ReadMesh

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

Read the mesh from a file

func RotateAndCreateMesh

func RotateAndCreateMesh(pts []Vertex, slices int) (*Mesh, error)

func (*Mesh) ConvertToSI

func (mesh *Mesh) ConvertToSI(unit utils.Unit)

func (*Mesh) ExtrudeFaceAndCreateMesh

func (facemesh *Mesh) ExtrudeFaceAndCreateMesh(normExtrude *Vertex, ExtrudLen float64) (*Mesh, error)

func (*Mesh) GetBounds

func (mesh *Mesh) GetBounds() (low [3]float64, high [3]float64)

func (*Mesh) GetCenter

func (mesh *Mesh) GetCenter() Vertex

func (*Mesh) GetImage

func (mesh *Mesh) GetImage() (image.Image, error)

func (*Mesh) GetLength

func (mesh *Mesh) GetLength() float64

func (*Mesh) GetSubsetMesh

func (mesh *Mesh) GetSubsetMesh(ints []int) (*Mesh, error)

Returns a subset of elements

func (*Mesh) SaveAsPng

func (mesh *Mesh) SaveAsPng(file string) error

func (*Mesh) WriteMesh

func (mesh *Mesh) WriteMesh(w io.Writer) error

Write the mesh, for now default to binary

func (*Mesh) WriteMeshAscii

func (mesh *Mesh) WriteMeshAscii(w io.Writer) error

Write the mesh out to the writer stream

func (*Mesh) WriteMeshBinary

func (mesh *Mesh) WriteMeshBinary(w io.Writer) error

Write the mesh out to the writer stream as a binary file

func (*Mesh) WriteUintahPts

func (mesh *Mesh) WriteUintahPts(w io.Writer) error

GEt the stl as a pts file

func (*Mesh) WriteUintahTri

func (mesh *Mesh) WriteUintahTri(w io.Writer) error

GEt the stl as a tri file

type RotationMatrix

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

func NewRotationMatrix

func NewRotationMatrix(start Vertex, end Vertex, theta float64) *RotationMatrix

Create the rotation matrix

type TriLine

type TriLine struct {
	FaceTriEdge [3]Edge
}

type Vertex

type Vertex [3]float32

Setup the vertex type

func IncreaseLineResolution

func IncreaseLineResolution(pts []Vertex, radialRes, longitudinalRes float32) ([]Vertex, error)

Jump to

Keyboard shortcuts

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