triangle

package module
v0.0.0-...-d3acf44 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: MIT Imports: 4 Imported by: 2

README

go-triangle

This package is a Go wrapper for the Triangle library originally written in C by Jonathan Shewchuk.

###Features

  • Constrained & Conforming Delaunay triangulation
  • Voronoi tesselation
  • Triangle mesh generation with area and angle constraints

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delaunay

func Delaunay(pts [][2]float64) [][3]int32

Delaunay computes the unconstrained Delaunay triangulation of a given set of points

func FreeTriangulateIO

func FreeTriangulateIO(t *triangulateIO)

func NewOptions

func NewOptions() *options

NewOptions returns a new options struct with default parameters

func NewTriangulateIO

func NewTriangulateIO() *triangulateIO

func Triangulate

func Triangulate(in *triangulateIO, opts *options, verbose bool) *triangulateIO

Triangulate performs constrained Delaunay triangulation. Constraints and quality options can be set using the second argument. Holes and segments that must appear in the triangulation can be set using methods (SetSegments() and SetHoles()) in the input triangulateIO struct.

Note that FreeTriangulateIO() has to be called explicitly on the in and out to release the memory.

func Voronoi

func Voronoi(pts [][2]float64) ([][2]float64, [][2]int32, []int32, [][2]float64)

Voronoi computes the Voronoi diagram of a given set of points It returns a set of Voronoi vertices, a set of edges between the points, as well as infinite which can occur around the boundary (defined by rayOrigins which indexes into the vertices, and rayDirs which provides the direction).

Types

type SegmentSplitting

type SegmentSplitting uint8
const (
	SplittingAllowed SegmentSplitting = 0 + iota
	NoSplittingInBoundary
	NoSplitting
)

Jump to

Keyboard shortcuts

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