dem2mesh: Create a 3d mesh from raster data.

Description Usage Arguments Details

View source: R/dem2stl.R

Description

Creates a 3d mesh showing elevations and earth curvature based on raster data.

Usage

1
2
3
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)

Arguments

data

a raster object (such as of class RasterLayer)

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

Details

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.


kevinstadler/dem2stl documentation built on April 3, 2018, 10:04 a.m.