Creates a mesh object. This is just a test code. For efficient, reliable and general code use the fmesher package.
mesh2d(loc, domain, max.edge, offset, SP = TRUE)
a mesh object.
a two column matrix with location coordinates.
a two column matrix defining the domain.
the maximum edge length.
the length of the outer extension.
logical indicating if the output will include the SpatialPolygons.
This is just for illustration purpose and one should consider the efficient function available a the INLA package.