Documentation ¶
Overview ¶
Package tri wraps Triangle to perform mesh generation a Delaunay triangulation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delaunay ¶
Delaunay computes 2D Delaunay triangulation using Triangle
Input: X = { x0, x1, x2, ... Npoints } Y = { y0, y1, y2, ... Npoints } Ouptut: V = { { x0, y0 }, { x1, y1 }, { x2, y2 } ... Nvertices } C = { { id0, id1, id2 }, { id0, id1, id2 } ... Ncellls }
Types ¶
type Cell ¶
type Cell struct { ID int // identifier Tag int // tag V []int // vertices EdgeTags []int // edge tags (2D or 3D) }
Cell holds cell data
type Hole ¶
type Hole struct { X float64 // x-coordinate of a point inside hole Y float64 // y-coordinate of a point inside hole }
Hole holds input data defining a "hole"
type Input ¶
type Input struct { Points []*Point // list of points Segments []*Segment // list of segments Regions []*Region // list of regions Holes []*Hole // list of holes }
Input holds a Planar Straight Line Graph (PSLG)
func (*Input) Generate ¶
func (o *Input) Generate(globalMaxArea, globalMinAngle float64, o2, verbose bool, extraSwitches string) (m *Mesh)
Generate generates unstructured mesh of triangles
globalMaxArea -- imposes a maximum triangle area constraint; fixed area constraint that applies to every triangle globalMinAngle -- quality mesh generation with no angles smaller than specified value in degrees globalMinAngle must be in [0, 60] o2 -- generates quadratic triangles verbose -- shows Triangle messages extraSwitches -- extra arguments to be passed to Triangle
type Region ¶
type Region struct { Tag int // tag of region MaxArea float64 // max area constraint for triangulation of region X float64 // x-coordinate of a point inside region Y float64 // y-coordinate of a point inside region }
Region holds input data defining a "region"
Click to show internal directories.
Click to hide internal directories.