threlte logo
@threlte/extras

<RoundedBoxGeometry>

Creates a rounded box geometry with a Three.js ExtrudeGeometry.

Example

<script>
  import { T, Canvas } from '@threlte/core'
  import { RoundedBoxGeometry } from '@threlte/extras'
</script>

<Canvas>
  <T.PerspectiveCamera
    makeDefault
    position={[3, 3, 3]}
    lookAt={[0, 0, 0]}
  />

  <T.Mesh>
    <RoundedBoxGeometry />
    <T.MeshPhongMaterial color="hotpink" />
  </T.Mesh>
</Canvas>

Component Signature

Props

name
type
required
default
description

args
[number, number, number]
no
[1, 1, 1]
Width, height, depth

creaseAngle
number
no
0.4
Smooth normals everywhere except faces that meet at an angle greater than the crease angle.

radius
number
no
0.05
Radius of the rounded corners.

smoothness
number
no
4
The number of curve segments.

steps
number
no
1
Number of points used for subdividing segments along the depth of the extruded spline.