generate_bbox: Generate a wireframe bounding box mesh

View source: R/mesh_utils.R

generate_bboxR Documentation

Generate a wireframe bounding box mesh

Description

Creates 12 edge segments around an axis-aligned bounding box.

Usage

generate_bbox(bbox, color = c(0, 0, 0, 1), radius = 0.01)

Arguments

bbox

A bounding box list from mesh_bbox(), or a mesh descriptor (in which case mesh_bbox() is called).

color

RGBA colour for the edges (length 4, 0-1 scale).

radius

Cylinder radius for the edges.

Value

A mesh descriptor list suitable for render_mesh() or inclusion in a scene list.

Examples

mesh <- generate_cuboid(c(0, 0, 0), c(1, 2, 3))
bbox_mesh <- generate_bbox(mesh)
nrow(bbox_mesh$vertices)


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