plyg

package
v0.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMultiPolygon

func GenerateMultiPolygon(cols []RingCol) (plys [][][]maths.Pt)

func WriteoutCols

func WriteoutCols(filename string, cols ...RingCol)

Types

type Builder

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

func (*Builder) AddPts

func (b *Builder) AddPts(l maths.Label, pts1, pts2 []maths.Pt) (ring Ring, x1 float64, y1s []YPart, x2 float64, y2s []YPart, new bool)

func (*Builder) CurrentRing

func (b *Builder) CurrentRing() (ring Ring, x1 float64, y1s []YPart, x2 float64, y2s []YPart)

type EdgeByY

type EdgeByY []YEdge

func (EdgeByY) Len

func (s EdgeByY) Len() int

func (EdgeByY) Less

func (s EdgeByY) Less(i, j int) bool

func (EdgeByY) Swap

func (s EdgeByY) Swap(i, j int)

type Ring

type Ring struct {
	Points []maths.Pt
	Label  maths.Label
	// contains filtered or unexported fields
}

func (*Ring) BBox

func (r *Ring) BBox() [4]float64

func (Ring) LineRing

func (r Ring) LineRing() (pts []maths.Pt)

LineRing returns a copy of the points in the correct winding order.

type RingCol

type RingCol struct {
	Rings  []Ring
	X1, X2 float64
	Y1s    []YEdge
	Y2s    []YEdge
	// contains filtered or unexported fields
}

func BuildRingCol

func BuildRingCol(ctx context.Context, hm hitmap.Interface, col1, col2 []maths.Pt, pt2my map[maths.Pt]int64) (col RingCol)

func LoadCols

func LoadCols(filename string) (cols []RingCol)

func MergeCols

func MergeCols(cols []RingCol) RingCol

func (*RingCol) MultiPolygon

func (rc *RingCol) MultiPolygon() [][][]maths.Pt

func (*RingCol) String

func (rc *RingCol) String() string

type RingDesc

type RingDesc struct {
	Idx   int
	PtIdx int
	Label maths.Label
}

type YEdge

type YEdge struct {
	// Start y value (lowest value) of the edge.
	Y     float64
	Descs []RingDesc
}

type YPart

type YPart struct {
	Y   float64
	Idx int
}

type YPartByY

type YPartByY []YPart

func (YPartByY) Len

func (ys YPartByY) Len() int

func (YPartByY) Less

func (ys YPartByY) Less(i, j int) bool

func (YPartByY) Swap

func (ys YPartByY) Swap(i, j int)

Jump to

Keyboard shortcuts

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