glodrei
Version:
useful add-ons for react-three-fiber
24 lines (20 loc) • 949 B
text/mdx
title: CatmullRomLine
sourcecode: src/core/CatmullRomLine.tsx
[](https://drei.vercel.app/?path=/story/shapes-line--catmull-rom-st)
Renders a THREE.Line2 using THREE.CatmullRomCurve3 for interpolation.
```jsx
<CatmullRomLine
points={[[0, 0, 0], ...]} // Array of Points
closed={false} // Default
curveType="centripetal" // One of "centripetal" (default), "chordal", or "catmullrom"
tension={0.5} // Default (only applies to "catmullrom" curveType)
color="black" // Default
lineWidth={1} // In pixels (default)
dashed={false} // Default
vertexColors={[[0, 0, 0], ...]} // Optional array of RGB values for each point
{...lineProps} // All THREE.Line2 props are valid
{...materialProps} // All THREE.LineMaterial props are valid
/>
```