Description Usage Arguments Value Examples
Command line utility wrapper for the voro++ software library. voro++ must be installed on your system to use this function.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x |
data.table/data.frame with the input points described by four variables (named columns):
|
x_min |
minimum x-axis coordinate of the tessellation box. Default: min(x).
These values are automatically multiplied by the scaling factor in |
x_max |
maximum x-axis coordinate of the tessellation box. Default: max(x) |
y_min |
minimum y-axis coordinate of the tessellation box. Default: min(y) |
y_max |
maximum y-axis coordinate of the tessellation box. Default: max(y) |
z_min |
minimum z-axis coordinate of the tessellation box. Default: min(z) |
z_max |
maximum z-axis coordinate of the tessellation box. Default: max(z) |
unit_scaling |
numeric vector with 3 scaling factors for x, y and z axis values. As a default setting (c(1,1,1)) tesselate assumes that the values given as x, y and z are comparable in units. If you input spatio-temporal data, make sure that you have units that determine your 3D distance metric the way you intend it to be. For example, if you need 1km=1year, use those units in the input. Otherwise, rescale appropriately. Mind that the values of *_min and *_max are adjusted as well by these factors. The unit_scaling parameter is stored as an attribute of the output to scale the output back automatically in read_polygon_edges. |
output_definition |
string that describes how the output file of voro++ should be structured. This is passed to the -c option of the command line interface. All possible customization options are documented here. Default: "%i*%P*%t" |
options |
string with additional options passed to voro++. All options are documented here. Default: "-v" |
voro_path |
system path to the voro++ executable. Default: "voro++" |
raw, linewise output of voro++ in a character vector with an attribute "unit scaling" (see above)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | random_unique_points <- unique(data.table::data.table(
id = NA,
x = runif(10, 0, 100000),
y = runif(10, 0, 100000),
z = runif(10, 0, 100)
))
random_unique_points$id <- seq_len(nrow(random_unique_points))
voro_output <- tessellate(random_unique_points, unit_scaling = c(0.001, 0.001, 1))
polygon_points <- read_polygon_edges(voro_output)
cut_surfaces <- cut_polygons(polygon_points, c(20, 40, 60))
cut_surfaces_sf <- cut_polygons_to_sf(cut_surfaces, crs = 25832)
polygons_z_20 <- sf::st_geometry(cut_surfaces_sf[cut_surfaces_sf$z == 20, ])
plot(polygons_z_20, col = sf::sf.colors(10, categorical = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.