This section is empty.


This section is empty.


func MultiPolygon

func MultiPolygon(ctx context.Context, triangles []geom.Triangle) geom.MultiPolygon

func PolygonForRing

func PolygonForRing(ctx context.Context, rng [][2]float64) (plyg [][][2]float64)

PolygonForRing returns a polygon for the given ring, this will destroy the ring.

func SortedEdges

func SortedEdges(t geom.Triangle) [3][2][2]float64


type Walker

type Walker struct {
	Triangles []geom.Triangle

	Order winding.Order
	// contains filtered or unexported fields

func New

func New(triangles []geom.Triangle) *Walker

New creates a new walker that can be used to fix a geometry.

func (*Walker) EdgeMap

func (w *Walker) EdgeMap() (edgeMap map[[2][2]float64][]int)

EdgeMap returns a copy of the edgemap

func (*Walker) MultiPolygon

func (w *Walker) MultiPolygon(ctx context.Context) (mplyg geom.MultiPolygon)

MultiPolygon walks all triangles and returns the generated polygons as a multipolygon.

func (*Walker) PolygonForTriangle

func (w *Walker) PolygonForTriangle(ctx context.Context, idx int, seen map[int]bool) (plyg [][][2]float64)

PolygonForTriangle walks the triangles starting at the given triangle returning the generated polygon from the walk.

func (*Walker) RingForTriangle

func (w *Walker) RingForTriangle(ctx context.Context, idx int, seen map[int]bool) (rng [][2]float64)

RingForTriangle will walk the set of triangles starting at the given triangle index. As it walks the triangles it will mark them as seen on the seen map. The function will return the outside ring of the walk if seen is nil, the function will panic.