Skip to content

usePointOnPrimitive

Takes an input primitive and returns a vertex at a given percentage along the perimeter, across all edges.

Configuration

PropertyDefaultDescription
primitiveA primitive, such as the result of useCircle, useTriangle, etc.
percentage0A value between 0 and 1.

Usage

js
const square = useSquare({sideLength: 100})
const { point } = usePointOnPrimitive(square, 0.4)
// point.value = { x: -10, y: 50, z: 0 }

Returns

usePointOnPrimitive returns a single {point: ComputedRef<Vertex>} in the format {x: number, y: number, z: number}.

Released under the MIT License.