module Mesh_triangle:Interface for the Triangle 2D mesh generator.`sig`

..`end`

Triangle is a
two-dimensional quality mesh generator and delaunay triangulator
which was awarded the 2003 Wilkinson Prize.

**Author(s):** Christophe Troestler (Christophe.Troestler@umons.ac.be)

**Version:** 0.5

class`['a]`

pslg :`'a Bigarray.layout ->`

`object`

..`end`

Planar Straight Line Graph datastructure (

`Mesh.pslg`

enriched
with methods specific to Triangle).
class type`['a]`

t =`object`

..`end`

Object describing various caracteristics of a mesh (

`Mesh.t`

enriched with methods specific to Triangle).
class type`['a]`

voronoi =`object`

..`end`

Voronoi diagram (

`Mesh.voronoi`

enriched with methods specific to
Triangle).
`exception Invalid_argument of ``string`

Exception raised by the functions of this module to indicate that
an argument not respecting the specifications was given.

type`triunsuitable =`

`float -> float -> float -> float -> float -> float -> float -> bool`

Type of functions used to determine whether or not a selected
triangle is too big (and needs to be refined).

```
triunsuitable x1
y1 x2 y2 x3 y3 area
```

must return `true`

if the triangle is too
big. The arguments are as follow:`x1`

and`y1`

are the X an Y coordinates of the triangle's origin vertex.`x2`

and`y2`

are the X an Y coordinates of the triangle's destination vertex.`x3`

and`y3`

are the X an Y coordinates of the triangle's apex vertex.`area`

is the area of the triangle.

`val triangulate : ``?delaunay:bool ->`

?min_angle:float ->

?max_area:float ->

?max_steiner:int ->

?voronoi:bool ->

?edge:bool ->

?neighbor:bool ->

?subparam:bool ->

?triunsuitable:triunsuitable ->

?debug:bool ->

'a pslg -> 'a t * 'a voronoi

`triangulate pslg`

returns a triangulation and a possibly a
Voronoi diagram of the domain described by `pslg`

. If
`pslg#segment`

is empty, the convex hull of the set of points is
used. Note that the numbering of nodes returned by this function
may be far from optimal for the FEM. See `delaunay`

: generates a truly Delaunay (not just constrained
Delaunay) triangulation. It usually increases the number of
vertices and triangles. Default: `true`

.`max_area`

: Imposes a maximum triangle area.`edge`

: return the edges of the triangulation in `#edge`

.
Default: `true`

.`neighbor`

: Outputs an array of triangles neighboring each
triangle in `#neighbor`

. Default: `false`

.`debug`

: if true, outputs some explanation of what Triangle is
doing and some statistics. Default: `true`

as it can contain
interesting information during program development.`val refine : ``?delaunay:bool ->`

?min_angle:float ->

?max_area:float ->

?max_steiner:int ->

?voronoi:bool ->

?edge:bool ->

?neighbor:bool ->

?subparam:bool ->

?triangle_area:'a Mesh.vec ->

?triunsuitable:triunsuitable ->

?debug:bool ->

'a t -> 'a t * 'a voronoi

`refine mesh`

returns a refined version of the `mesh`

.`triangle_area`

: allows to specify, for each triangle `i`

, a
maximum area `triangle_area.{i}`

. If both `max_area`

and
`triangle_area`

are specified, `triangle_area`

is used.