mesh.functions {geometry} | R Documentation |
Elementary distance functions, usefull for defining distance functions of more complex regions.
mesh.dcircle(p, radius = 1, ...) mesh.dsphere(p, radius = 1, ...) mesh.drectangle(p, x1 = -1/2, y1 = -1/2, x2 = 1/2, y2 = 1/2, ...) mesh.diff(p, regionA, regionB, ...) mesh.intersect(p, regionA, regionB, ...) mesh.union(p, regionA, regionB, ...)
p |
A matrix with 2 columns (3 in mesh.dsphere ), each row representing a point in the plane. |
radius |
radius of circle |
x1 |
lower left corner of rectangle |
y1 |
lower left corner of rectangle |
x2 |
upper right corner of rectangle |
y2 |
upper right corner of rectangle |
regionA |
vectorized function describing region A in the union / intersection / difference |
regionB |
vectorized function describing region B in the union / intersection / difference |
... |
additional arguments passed to regionA and regionB |
regionA
and regionB
must accept a matrix p
with 2 columns as
their first argument, and must return a vector of length nrow(p)
containing
the signed distances of the supplied points in p
to their respective regions.
a vector of length nrow(p)
containing the signed distances
Raoul Grasman; translated from original Matlab sources of Per-Olof Persson.
http://www-math.mit.edu/~persson/mesh/
P.-O. Persson, G. Strang, A Simple Mesh Generator in MATLAB. SIAM Review, Volume 46 (2), pp. 329-345, June 2004
example(distmesh2d)