Skip to main content

bezier

Functions

curveThroughPoints()

g.bezier.curveThroughPoints(points)
warning

Deprecated. Use the g.Curve.throughPoints function instead.

Return the SVG path that defines a cubic bezier curve passing through points.

This method automatically computes the cubic bezier control points necessary to create a smooth curve with points as intermediary endpoints.

getCurveControlPoints()

g.bezier.getCurveControlPoints(knots)
warning

Deprecated. Use the g.Curve.throughPoints function instead.

Get open-ended Bezier Spline Control Points.

The knots argument should be an array of (at least two) Bezier spline points. Returns an array where the first item is an array of the first control points and the second item is an array of second control points.

getCurveDivider()

g.bezier.getCurveDivider(p0, p1, p2, p3)
warning

Deprecated. Use the curve.divideAtT function instead.

Returns a function that divides a Bezier curve into two at point defined by value t between 0 and 1. Uses the deCasteljau algorithm.

getFirstControlPoints()

g.bezier.getFirstControlPoints(rhs)
warning

Deprecated. Use the g.Curve.throughPoints function instead.

Solves a tridiagonal system for one of coordinates (x or y) of first Bezier control points.

The rhs argument is a right hand side vector. Returns a solution vector.

getInversionSolver()

g.bezier.getInversionSolver(p0, p1, p2, p3)
warning

Deprecated. Use the curve.closestPointT function instead.

Solves an inversion problem -- Given the (x, y) coordinates of a point which lies on a parametric curve x = x(t)/w(t), y = y(t)/w(t), find the parameter value t which corresponds to that point. Returns a function that accepts a point and returns t.