跳到主要内容

utils.projectPointOntoCurve()

The utils.projectPointOntoCurve() function finds the closest point to p on the Bézier curve defined by from, to and two 控制点.

注意

The line between the given point and the returned point will always be either perpendicular to the curve or go to an endpoint.

Signature

Point utils.projectPointOntoCurve(
Point p,
Point from,
Point cp1,
Point cp2,
Point to
)

Example

A Utils.projectPointOntoCurve() example