barycentric

package
v0.0.0-...-9c88ebf Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: BSD-3-Clause Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type B

type B struct {
	U, V float64
}

B is a barycentric coordinate

func (B) AssertEqual

func (b B) AssertEqual(actual interface{}, t cmpr.Tolerance) error

AssertEqual fulfils geomtest.AssertEqualizer

func (B) Edge

func (b B) Edge(d float64) bool

Edge will return true if B is within d of an edge.

func (B) Inside

func (b B) Inside() bool

Inside returns true if B is inside it's triangle.

func (B) String

func (b B) String() string

String fulfills Stringer

type BIterator

type BIterator struct {
	// Origin and U are the indexes to use, V is computed from these.
	Origin, U int
	Step      [2]B
	Cur       B
	// Reset is the point to reset to after one "line scan" completes
	Reset B
	Idx   int
}

BIterator iterates over points inside a triangle. A single iterator can be used to map between multiple triangles.

func (*BIterator) Next

func (bs *BIterator) Next() (b B, done bool)

Next returns the next B and if it is done

func (*BIterator) Start

func (bs *BIterator) Start() (b B, done bool)

Start resets the iterator

func (*BIterator) V

func (bs *BIterator) V() int

V returns the index of the V coordinate

Jump to

Keyboard shortcuts

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