Creates a 3d mesh showing elevations and earth curvature based on raster data.
dem2mesh(data, thicknessratio = 0.01, thickness = NULL, size = NULL, scale = NULL, exaggeration = 1, up = c(0, 0, 1), flatbase = FALSE, a = 6378137, b = 6356752.314245)
data | a |
---|---|
thicknessratio | desired thickness of the base as a proportion of the overall size of the spheroid (i.e. between 0 and 1) |
thickness | desired thickness of the base (in absolute 3d coordinates) |
size | desired maximum extent (width/height) of the resultin mesh in mm |
scale | scale at which mesh should be rendered. If scale is specified, |
exaggeration | factor by which elevation differences are exaggerated |
up | desired direction of the front face of the resulting mesh |
flatbase | logical |
a | semi-principal axis length of the Earth spheroid |
b | semi-principal axis length of the Earth spheroid |
This function can render arbitrarily shaped landmasses by setting some
values of the raster data to NA
, which are consequently not rendered.
Only the biggest continuous clump of non-NA
values in the data set
is rendered. The center points of each raster cell are mapped to vertices
in 3d space on a spheroid with the given principal axes. Protrusions out of
the biggest clump which are only one raster cell wide are shaved off
(because a single protruding vertex cannot form part of a polygon if it
doesn't have neighbours on two adjacent sides).
The function does not support rendering of holes: holes (NA
regions
within the biggest clump's interior) are filled with 0s.