@mocanvas/editor · class

CubicBezier2d

declare class CubicBezier2d extends Geometry2d

A single cubic bézier segment: start → end, shaped by the two control points cp1 and cp2. Shapes drawn as one wire (a connector, a pipeline link) return this from getGeometry.


Methods · 9

get c1(): Vec

The first control point, under the name a spline segment gives it.

get c2(): Vec

The second control point, under the name a spline segment gives it.

constructor(config: Flags & {
static GetAtT(segment: {

The point at t on the bézier defined by segment.

getPointAt(t: number): Vec

The point at t ∈ [0, 1] along the curve.

getVertices(): Vec[]
get p0(): Vec

The start point, under the name a spline segment gives it.

get p1(): Vec

The end point, under the name a spline segment gives it.

toPathWords(): number[]

Properties · 5

readonly cp1: Vec
readonly cp2: Vec
readonly end: Vec
readonly resolution: number

How many samples the flattened outline uses.

readonly start: Vec

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.