region

package
v0.4.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDirection = errors.New("Line does not have direction on that coordinate.")

Functions

This section is empty.

Types

type Axis

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

func (*Axis) AsLine

func (a *Axis) AsLine() maths.Line

AsLine returns the Axis as a line.

func (*Axis) GoString

func (a *Axis) GoString() string

func (*Axis) Intersect

func (a *Axis) Intersect(line maths.Line) (pt maths.Pt, doesIntersect bool)

Intersect finds the intersections point if one exists with the line described by pt0,pt1. This point will be clamped to the line of the clipping region.

func (*Axis) IsInward

func (a *Axis) IsInward(line maths.Line) (bool, error)

IsInward returns weather the line described by pt1,pt2 is headed inward with respect to the Axis.

func (*Axis) Next

func (a *Axis) Next() *Axis

Next returns the next Axis, or nil if there aren't anymore.

func (*Axis) PushInBetween

func (a *Axis) PushInBetween(pt list.ElementerPointer) bool

PushInBetween inserts the pt into the region list on this Axis.

type Region

type Region struct {
	list.List
	// contains filtered or unexported fields
}

A region is made up of axises and a winding order. A region can hold other points along it's axises.

func New

func New(winding maths.WindingOrder, Min, Max maths.Pt) *Region

New creates a new region, initilization paramters as needed.

func (*Region) Axis

func (r *Region) Axis(idx int) *Axis

func (*Region) Contains

func (r *Region) Contains(pt maths.Pt) bool

func (*Region) DebugStringAugmented

func (r *Region) DebugStringAugmented(augmenter func(idx int, e maths.Pt) string) string

func (*Region) FirstAxis

func (r *Region) FirstAxis() *Axis

func (*Region) GoString

func (r *Region) GoString() string

func (*Region) Init

func (r *Region) Init(winding maths.WindingOrder, Min, Max maths.Pt) *Region

Init initilizes the region struct.

func (*Region) LineString

func (r *Region) LineString() []float64

func (*Region) Max

func (r *Region) Max() maths.Pt

func (*Region) Min

func (r *Region) Min() maths.Pt

func (*Region) SentinalPoints

func (r *Region) SentinalPoints() (pts []maths.Pt)

func (*Region) WindingOrder

func (r *Region) WindingOrder() maths.WindingOrder

Jump to

Keyboard shortcuts

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