# Shape reference frame and bounding box

A shape has a reference frame and a bounding box, as does every object. The reference frame or coordinate frame is always located at the geometric center of the shape and indicates the point where the shape's position and orientation is calculated from. The coordinate frame has 3 axes: x-, y- and z-axis, corresponding to the red, green and blue arrows respectively. The shape's bounding box is centered around the shape's reference frame and has the same orientation as the reference frame (the x-, y- and z-axis have the same orientation as the bounding box's edges). The bounding box encompasses entirely the shape. The user can select from 4 different ways to define a shape's reference frame and bounding box orientation (pure simple shapes and heightfield shapes cannot be reoriented):

• Align with reference frame of world: [Menu bar --> Edit --> reorient bounding box --> with reference frame of world]. When this item is clicked (a shape must previously be selected), the coordinate frame will be computed in order to produce a bounding box with edges aligned with the world's reference frame axes (i.e. the absolute coordinate frame).
• Align with main axes of random shape: [Menu bar --> Edit --> Reorient bounding box --> with main axes of random shape]. When this item is clicked (a shape must previously be selected), the reference frame will be computed in order to produce the most compact bounding box around a random shape. This is the default calculation method.
• Align with main axis of cylinder shape: [Menu bar --> Edit --> Reorient bounding box --> with main axis of cylinder shape]. When this item is clicked (a shape must previously be selected), a precise reference frame will be computed on a cylinder shape, with its Z-axis coinciding with the cylinder's revolute axis. This is more precise than above item (align with main axes of random shape), but requires a precisely defined cylinder shape. The operation can fail if the shape appears to be too far from a regular and precise cylinder.
• Align with main axes of cuboid shape: [Menu bar --> Edit --> Reorient bounding box --> with main axes of cuboid shape]. When this item is clicked (a shape must previously be selected), a precise reference frame will be computed on a cuboid shape, aligned with the cubid's faces. This is more precise than above item (align with main axes of random shape), but requires a precisely defined cuboid shape. The operation can fail if the shape appears to be too far from a regular and precise cuboid.
• The bounding box orientation relative to its shape can also be modified in the geometry dialog or via the API.

[Two same shapes. The top one's ref. frame is aligned with the world, the bottom one's ref. frame is aligned with the shape's main axes]

### Recommended topics

• Shapes
• Geometry dialog