walker

package
v0.0.0-...-3cd2f5a Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

Types

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.

Jump to

Keyboard shortcuts

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