Learn R Programming

habtools (version 1.1.1)

mesh_to_2d: Transform 3D mesh into 2D outline

Description

Turns a 3D Mesh file into an xy data frame.

Usage

mesh_to_2d(mesh, L0 = NULL, plot = FALSE, silent = TRUE)

Value

A data frame.

Arguments

mesh

A mesh3d object.

L0

(Optional) The desired DEM resolution in same units at the 3D mesh.

plot

logical. Plot the output?

silent

logical. Defaults to not showing warnings.

Details

The function uses the vertices of the mesh object and projects them on the XY plane. Then, only points that define the perimeter of the shape are maintained.

Examples

Run this code
mcap_2d <- mesh_to_2d(mcap, plot = TRUE)

geometry::polyarea(mcap_2d$x, mcap_2d$y) # area
planar(mcap)

perimeter(mcap_2d) # perimeter
circularity(mcap_2d) # circularity
fd_boxes(mcap_2d) # fractal dimension

Run the code above in your browser using DataLab