generate_pyramid: Generate a square pyramid mesh

View source: R/mesh_utils.R

generate_pyramidR Documentation

Generate a square pyramid mesh

Description

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)
)

Arguments

base_center

Length-3 vector: centre of the square base.

apex

Length-3 vector: position of the tip.

half_width

Half-width of the square base.

color

Length-4 RGBA colour.

Value

A mesh descriptor list.

Examples

mesh <- generate_pyramid(c(0, 0, 0), c(0, 2, 0), half_width = 1)
mesh$vertices


scimesh documentation built on Aug. 9, 2026, 9:07 a.m.