Learn R Programming

isocubes (version 1.0.0)

gen_prism: Generate a rectangular prism centered at the origin

Description

To simplify implementation, only odd side lengths are generated.

Usage

gen_prism(x = 5, y = x, z = x)

Value

data.frame of voxel coordinates

Arguments

x, y, z

prism dimensions. Default 5x5x5. Note that due to the quantization of coordinates to integer values for rendering, this function rounds up even dimensions to the next odd number.

Examples

Run this code
gen_prism(3, 5, 7) |>
   isocubesGrob() |>
   grid::grid.draw()

Run the code above in your browser using DataLab