The convex regions a region decomposes into for optimisation
Source:R/region.R, R/region_algebra.R, R/triangulate.R
cells.RdA union returns its pieces and a triangulable geometry its triangulation;
any other region is its own only cell. Cells may overlap.
Contrast parts(), which is what the region was declared as.
An empty region has no cells.
A union's cells are its parts' cells, flattened, without
exceeding the shared max_cells budget.
A bounded polyhedron's cells are its triangulation; an
unbounded one, or a simplex_region(), is its own only cell.
Usage
cells(space, max_cells = getOption("ripr.max_cells", 1000L), .budget = NULL)Arguments
- space
A region.
- max_cells
The number of simplices triangulation may produce before giving up. Defaults to the
ripr.max_cellsoption, or1000Lwhen that is unset.- .budget
Internal: the shared budget a union hands its parts. Leave it
NULL.
Value
A list of convex_region objects whose union is space.
Examples
cells(simplex_region(vertices = diag(3)))
#> [[1]]
#> <simplex_region>
#> 3 vertices in R^3
#> facets: 3 inequalities, 1 equality
#> vertices:
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>