package mesh
Library
Module
Module type
Parameter
Class
Class type
Interface for the Triangle 2D mesh generator.
Triangle is a two-dimensional quality mesh generator and delaunay triangulator which was awarded the 2003 Wilkinson Prize.
Jonathan Richard Shewchuk, the author of triangle, would like that, if you use Triangle in a scientific publication, you acknowledgment it with the following citation: Jonathan Richard Shewchuk, ``Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator,'' in Applied Computational Geometry: Towards Geometric Engineering (Ming C. Lin and Dinesh Manocha, editors), volume 1148 of Lecture Notes in Computer Science, pages 203-222, Springer-Verlag, Berlin, May 1996.
class 'l pslg : 'l Bigarray.layout -> object ... end
Planar Straight Line Graph datastructure (Mesh.pslg
enriched with methods specific to Triangle). By default, creating an object from this class results in all methods being initialized with empty arrays.
val pslg :
?hole:'l Mesh.mat ->
?region:'l Mesh.mat ->
?point_attribute:'l Mesh.mat ->
?point_marker:'l Mesh.int_vec ->
'l Mesh.mat ->
?segment_marker:'l Mesh.int_vec ->
'l Mesh.int_mat ->
'l pslg
pslg point segment
creates a PSLG with the proper methods. The default values for unspecified values are empty arrays.
Object describing various characteristics of a mesh (Mesh.t
enriched with methods specific to Triangle). It can also be used to construct t
values from Mesh.t with empty attributes matrices.
class type 'l voronoi = object ... end
Voronoi diagram (Mesh.voronoi
enriched with methods specific to Triangle).
Exception raised by the functions of this module to indicate that an argument not respecting the specifications was given.
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
andy1
are the X an Y coordinates of the triangle's origin vertex.x2
andy2
are the X an Y coordinates of the triangle's destination vertex.x3
andy3
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 ->
?region_area:bool ->
?max_steiner:int ->
?voronoi:bool ->
?edge:bool ->
?neighbor:bool ->
?subparam:bool ->
?triunsuitable:triunsuitable ->
?check_finite:bool ->
?debug:bool ->
?verbose:[ `V | `VV | `VVV ] ->
'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 band
.
Note that #point_marker
are not propagated to points created on the segment. You must set #segment_marker
for that. If you do not set #segment_marker
, only the external boundary points will receive a marker of 1, the points on internal boundaries will have the marker 0.
If #region
is non-empty, it will be used to assign an additional floating-point attribute to each triangle. It will be written as the single attribute of #triangle_attribute
matrix.
#point_attribute
are interpolated to all points.
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 ->
?check_finite:bool ->
?debug:bool ->
?verbose:[ `V | `VV | `VVV ] ->
'a t ->
'a t * 'a voronoi
refine mesh
returns a refined version of the mesh
. The initial indices for the points are preserved, additional nodes are added at the end. However, the refinement is not hierarchical: there is no guarantee that each output element is contained in a single input element.
sub mesh ?pos len
returns a new mesh keeping only the points with indices between pos
and pos + len - 1
(included). See Mesh.sub
for more information.
val permute_points : 'l t -> ?inv:bool -> 'l Mesh.int_vec -> 'l t
permute_points perm mesh
, see Mesh.permute_points
. This version also permutes the #point_attribute
matrix.
val permute_triangles : 'l t -> ?inv:bool -> 'l Mesh.int_vec -> 'l t
permute_points perm mesh
, see Mesh.permute_points
. This version also permutes the #point_attribute
matrix.