component

Path

A meandering ribbon trail from seeded waypoints; decorative, laid just over the ground.

⌖ Explore the library in 3D →

Add it

npx @runek/cli add path

Pulls @runek/core@^0.13.0, three@^0.184.0.

Use it

import { Path } from './runek/Path'

<Path position={[0, 0, 0]} seed={1} />

Props

export interface PathProps {
  position?: Vec3
  rotation?: Vec3
  /** Length along local Z, in units. */
  length?: number
  width?: number
  /** Lateral meander amplitude, in units. */
  meander?: number
  /** Total height climbed from the near end (local −Z) to the far end (+Z), in units. For a
   *  trail that gains height as it winds; the ribbon rises linearly along its length. */
  rise?: number
  /** Explicit elevation profile, in units: evenly spaced samples from the near end (local −Z)
   *  to the far end (+Z), linearly interpolated along the ribbon. Overrides `rise`. Author it
   *  from the terrain the trail crosses so the ribbon hugs the ground it climbs. */
  heights?: number[]
  /** Defaults to the world palette's `ground` slot. */
  color?: string
  segments?: number
  seed?: number
}

Registry manifest

registry manifest /r/components/path.json Self-contained JSON: inlined source plus resolved dependencies, exactly what runek add path fetches.

Browse the whole catalog in the gallery →.