makevalid

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destructure

func Destructure(ctx context.Context, cmp pkgcmp.Compare, clipbox *geom.Extent, multipolygon *geom.MultiPolygon) ([]geom.Line, error)

Destructure will take a multipolygon, break up the polygon into a set of segments that have the following characteristics: 1. no segment will intersect with another segment, other then at the end points; or colinear and partial-coliner lines. 2. normalize direction of line segments to left to right 3. line segments are generally unique. 4. line segments outside of the clipbox will be clipped

func InsideTrianglesForMultiPolygon

func InsideTrianglesForMultiPolygon(ctx context.Context, clipbox *geom.Extent, multipolygon *geom.MultiPolygon, hm planar.HitMapper) ([]geom.Triangle, error)

InsideTrianglesForMultiPolygon returns triangles that are painted as inside triangles for the multipolygon

func InsideTrianglesForSegments

func InsideTrianglesForSegments(ctx context.Context, segs []geom.Line, hm planar.HitMapper) ([]geom.Triangle, error)

InsideTrianglesForSegments returns triangles that are painted as as inside triangles

Types

type ByXYLine

type ByXYLine []geom.Line

func (ByXYLine) Len

func (a ByXYLine) Len() int

func (ByXYLine) Less

func (a ByXYLine) Less(i, j int) bool

func (ByXYLine) Swap

func (a ByXYLine) Swap(i, j int)

type ByXYPoint

type ByXYPoint [][2]float64

func (ByXYPoint) Len

func (a ByXYPoint) Len() int

func (ByXYPoint) Less

func (a ByXYPoint) Less(i, j int) bool

func (ByXYPoint) Swap

func (a ByXYPoint) Swap(i, j int)

type Makevalid

type Makevalid struct {
	Hitmap planar.HitMapper
	// Currently not used, but once we have the IsValid function, we can use this instead
	// Of running the MakeValid routine on a Geometry that is already valid.
	// Used to clip geometries that are not Polygon and MultiPolygons
	Clipper planar.Clipper
	CMP     pkgcmp.Compare
	Order   winding.Order
}

func (*Makevalid) Makevalid

func (mv *Makevalid) Makevalid(ctx context.Context, geo geom.Geometry, clipbox *geom.Extent) (geometry geom.Geometry, didClip bool, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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