Turns a 3D Mesh file into an xy data frame.
mesh_to_2d(mesh, L0 = NULL, plot = FALSE, silent = TRUE)
A mesh3d object.
(Optional) The desired DEM resolution in same units at the 3D mesh.
logical. Plot the output?
logical. Defaults to not showing warnings.
A data frame.
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.
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