get_2d_alpha_shape: Compute area, perimeter and centroid of an 2d alpha-shape for...

Description Usage Arguments Value Author(s) Examples

View source: R/get_2d_alpha_shape.R

Description

Compute area, perimeter and centroid of an 2d alpha-shape.
Alpha-shape is checked for connectivity and circular graphs.
If problems occur alpha-value is increased by 0.2. To avoid collinearity a small random jitter is added to the points before alpha-shape computation.

Usage

1
2
3
4
5
get_2d_alpha_shape(
  input_cloud = data.frame(x = runif(20), y = runif(20)),
  alpha = 1,
  plot = FALSE
)

Arguments

input_cloud

A file or data.frame containing x and y points. If file, it assumes first three columns to be x y z without header. Futher columns are ignored.

alpha

Alpha value for alpha-shape computation. Default 0.5

plot

Should the alpha shape be plotted. Default to FALSE.

Value

A data.frame containing: area, perimeter, cpa_cen_x, cpa_cen_y.

Author(s)

Matthias Kunz, last updated: 27.04.2019

Examples

1
get_2d_alpha_shape(data.frame(x=runif(20),y=runif(20)), alpha=1.0)

spatial-mk/tre3d documentation built on April 1, 2020, 5:26 p.m.