vol_slice: Calculate soil volume above or below a reference plane

Description Usage Arguments Details Value See Also

View source: R/mesh-volume-fns.R

Description

One half of the total volume computation.

Usage

1
vol_slice(mesh, direction, z_displ_mm = 0.01, include_ref = FALSE)

Arguments

mesh

triangular mesh of class "mesh3d"

direction

one of "above" or "below"

z_displ_mm

vertical offset to prevent removal of vertices near the origin

include_ref

whether the returned mesh object should include the reference circle plane? Default is FALSE which returns only the points retained after slicing.

Details

\lifecycle

experimental

This applies a sort of hack to slice the mesh and keep only points residing above or below the x-y plane. The "hack" portion is translating the actual reference plane away from the mesh by a very small distance. The volume attributable to the offset is subtracted before completing the calculation. The meshes used in this project can never be "watertight" and it is my hope that so long as the mesh is 2-manifold, the volume computation is accurate. This function calls Rvcg::vcgClean() to remove non-manifold faces, then remove unreferenced vertices, and (finally) remove non-manifold vertices before coherently orienting the faces. This approach seems to resolve the non-manifoldness of the meshes induced by downsampling, cylinder removal, and top/bottom removal.

Value

list containing a numeric vector of length 1 (cm3 of soil residing above the reference plane) and the resulting mesh from the slicing operation

See Also

vol_gridded(), vol_faceweighted(), vol_pointwise()


evanmascitti/soilmesh documentation built on Sept. 30, 2021, 7:57 a.m.