Computes a refined constrained Delaunay triangulation on R2 or S2.
Arguments
- ...
Currently passed on to
fm_mesh_2d_inlaor converted tofmesher_rcdt()options.- loc
Input coordinates that should be part of the mesh. Can be a matrix,
sf,sfc,SpatialPoints, or other object supported byfm_unify_coords().- tv
Initial triangulation, as a N-by-3 index vector into
loc- boundary, interior
Objects supported by
fm_as_segm(). Ifboundaryisnumeric,fm_nonconvex_hull(loc, convex = boundary)is used.- extend
logicalorlistspecifying whether to extend the data region, with parameters- list("n")
the number of edges in the extended boundary (default=16)
- list("offset")
the extension distance. If negative, interpreted as a factor relative to the approximate data diameter (default=-0.10)
Setting to
FALSEis only useful in combinationlatticeorboundary.- refine
logicalorlistspecifying whether to refine the triangulation, with parameters- list("min.angle")
the minimum allowed interior angle in any triangle. The algorithm is guaranteed to converge for
min.angleat most 21 (default=21)- list("max.edge")
the maximum allowed edge length in any triangle. If negative, interpreted as a relative factor in an ad hoc formula depending on the data density (default=
Inf)- list("max.n.strict")
the maximum number of vertices allowed, overriding
min.angleandmax.edge(default=-1, meaning no limit)- list("max.n")
the maximum number of vertices allowed, overriding
max.edgeonly (default=-1, meaning no limit)
- lattice
An
fm_lattice_2dobject, generated byfm_lattice_2d(), specifying points on a regular lattice.- globe
If non-NULL, an integer specifying the level of subdivision for global mesh points, used with
fmesher_globe_points()- cutoff
The minimum allowed distance between points. Point at most as far apart as this are replaced by a single vertex prior to the mesh refinement step.
- quality.spec
List of vectors of per vertex
max.edgetarget specification for each location inloc,boundary/interior(segm), andlattice. Only used if refining the mesh.- crs
Optional crs object
- delaunay
logical; If
FALSE,refineisFALSE, and a ready-made mesh is provided, only creates the mesh data structure. DefaultTRUE, for ensuring a Delaunay triangulation.
Functions
fm_rcdt_2d_inla(): Legacy method for theINLA::inla.mesh.create()interfacefm_delaunay_2d(): Construct a plain Delaunay triangulation.
INLA compatibility
For mesh and curve creation, the fm_rcdt_2d_inla(), fm_mesh_2d_inla(),
and fm_nonconvex_hull_inla() methods will keep the interface syntax used by
INLA::inla.mesh.create(), INLA::inla.mesh.2d(), and
INLA::inla.nonconvex.hull() functions, respectively, whereas the
fm_rcdt_2d(), fm_mesh_2d(), and fm_nonconvex_hull() interfaces may be
different, and potentially change in the future.
Examples
(m <- fm_rcdt_2d_inla(
boundary = fm_nonconvex_hull(cbind(0, 0), convex = 5)
))
#> fm_mesh_2d object:
#> Manifold: R2
#> V / E / T: 32 / 61 / 30
#> Euler char.: 1
#> Constraints: Boundary: 32 boundary edges (1 group: 1), Interior: 0 edges
#> Bounding box: (-4.996242, 4.996242) x (-4.996242, 4.996242)
#> Basis d.o.f.: 32
fm_delaunay_2d(matrix(rnorm(30), 15, 2))
#> fm_mesh_2d object:
#> Manifold: R2
#> V / E / T: 15 / 36 / 22
#> Euler char.: 1
#> Constraints: Boundary: 6 boundary edges (1 group: 1), Interior: 0 edges
#> Bounding box: (-2.028607, 2.143613) x (-2.586141, 1.095199)
#> Basis d.o.f.: 15