paths

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulgeVector

type BulgeVector interface {
	GetX() float64
	GetY() float64
	GetBulge() float64
}

type Direction

type Direction int
const (
	DirectionBackward Direction = iota
	DirectionForward
)

type Path

type Path struct {
	Closed   bool
	Reversed bool
	Points   []vector2.Vector2
}

func NewPath

func NewPath(points []vector2.Vector2, closed bool) *Path

func (*Path) AddPoint

func (p *Path) AddPoint(point vector2.Vector2)

func (*Path) GetDistance

func (p *Path) GetDistance(fromIndex, toIndex int, direction Direction) float64

func (*Path) GetNearestPoint

func (p *Path) GetNearestPoint(fromPosition vector2.Vector2) (vector2.Vector2, int, int)

func (*Path) GetNearestSegment

func (p *Path) GetNearestSegment(fromPosition vector2.Vector2) (int, int)

func (*Path) GetPoint

func (p *Path) GetPoint(index int) vector2.Vector2

func (*Path) GetSegment

func (p *Path) GetSegment(aIndex, bIndex int) [2]vector2.Vector2

func (*Path) InsertPoint

func (p *Path) InsertPoint(point vector2.Vector2, index int)

func (*Path) Next

func (p *Path) Next(index int, direction Direction) int

func (*Path) Offset

func (p *Path) Offset(delta float64, allowInversion bool) error

func (*Path) Previous

func (p *Path) Previous(index int, direction Direction) int

func (*Path) Walk

func (p *Path) Walk(fromPosition vector2.Vector2, distance float64, direction Direction) ([]int, vector2.Vector2)

func (*Path) WalkToEnd

func (p *Path) WalkToEnd(start vector2.Vector2, direction Direction) ([]int, vector2.Vector2)

func (*Path) WalkToIndex

func (p *Path) WalkToIndex(fromIndex, toIndex int, direction Direction) ([]int, float64)

type VectorB

type VectorB struct {
	vector2.Vector2
	B float64
}

func (VectorB) GetArcTo

func (vb VectorB) GetArcTo(to VectorB) *arc.Arc

Jump to

Keyboard shortcuts

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