Creates a pyramid with a square base centred at base_center
in the XZ plane, with the apex above it along Y.
Usage
generate_pyramid(
base_center,
apex,
half_width = 1,
color = c(0.7, 0.7, 0.7, 1)
)Examples
mesh <- generate_pyramid(c(0, 0, 0), c(0, 2, 0), half_width = 1)
mesh$vertices
#> [,1] [,2] [,3]
#> [1,] 1 0 -1
#> [2,] -1 0 -1
#> [3,] 0 2 0
#> [4,] 1 0 1
#> [5,] 1 0 -1
#> [6,] 0 2 0
#> [7,] -1 0 1
#> [8,] 1 0 1
#> [9,] 0 2 0
#> [10,] -1 0 -1
#> [11,] -1 0 1
#> [12,] 0 2 0
#> [13,] -1 0 -1
#> [14,] 1 0 -1
#> [15,] 1 0 1
#> [16,] -1 0 1