Create a new RoundedBoxGeometry instance.
By default, the constructor creates a box centered on the object space origin with a width, length and height of 1 unit, edges and corners rounded with a radius of 0.1 and 8 segments across each rounded edge. The faces are laid out as in BoxGeometry, each with UVs in the range of 0 to 1. Each face also takes half of each rounded edge next to it, so neighboring faces meet half way around the rounded edge.
Optionalopts: {Options object.
OptionalcalculateTangents?: booleanGenerate tangent information. Defaults to false.
OptionalhalfExtents?: Vec3The half dimensions of the box in each axis. Defaults to [0.5, 0.5, 0.5].
OptionalheightSegments?: numberThe number of divisions of the flat part of the box along the Y axis. Defaults to 1.
OptionallengthSegments?: numberThe number of divisions of the flat part of the box along the Z axis. Defaults to 1.
Optionalradius?: numberThe radius of the rounded edges and corners. It is clamped to the smallest half extent, where the box becomes fully rounded in that axis. A radius of 0 generates a box identical to BoxGeometry. Defaults to 0.1.
OptionalradiusSegments?: numberThe number of segments across each rounded edge, which turns through 90 degrees. Must be even, as neighboring faces meet half way around the edge, so an odd value is rounded up. Defaults to 8.
OptionalwidthSegments?: numberThe number of divisions of the flat part of the box along the X axis. Defaults to 1.
OptionalyOffset?: numberMove the box vertically by given offset in local space. Pass 0.5 to generate the box with pivot point at the bottom face. Defaults to 0.
A procedural box-shaped geometry with rounded edges and corners.
Typically, you would: