Skip to content

Add helper functions to create AxisAlignedBox objects from other shapes #666

@scpeters

Description

@scpeters

Desired behavior

Add helper functions that create an AxisAlignedBox object when passed a shape object like Box, Capsule, Cylinder, etc.

Alternatives considered

Implementation suggestion

Add static helper functions to a separate header file (such as include/gz/math/AxisAlignedBoxHelpers.hh) with the following API:

static gz::math::AxisAlignedBox ConvertToAxisAlignedBox(const gz::math::Box &);
static gz::math::AxisAlignedBox ConvertToAxisAlignedBox(const gz::math::Sphere &);
static gz::math::AxisAlignedBox ConvertToAxisAlignedBox(const gz::math::Capsule &);
etc.

Additional context

This was motivated by the feature proposed by @gabrielfpacheco in gazebosim/sdformat#1547.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions