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

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

## 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

```
mcap_2d <- mesh_to_2d(mcap, plot = TRUE)
geometry::polyarea(mcap_2d$x, mcap_2d$y) # area
#> [1] 0.08303158
planar(mcap)
#> L0 is set to mesh resolution (0.00783124724167033)
#> [1] 0.08303158
perimeter(mcap_2d) # perimeter
#> [1] 1.678564
circularity(mcap_2d) # circularity
#> [1] 0.6085393
fd_boxes(mcap_2d) # fractal dimension
#> [1] 1.39879
```