Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeKinematics ¶
ComputeKinematics compute the absolute kinematic maximums of the clamped B-spline.
func InterpolatePoints ¶
InterpolatePoints takes a clamped cubic uniform b-spline and returns a similar spline that minimizes maximum speed, acceleration and jerk. The returned spline has a control point in each control point interval of the input spline. As a special case, a zero-length input B-spline is returned as is.
For example, the clamped uniform B-spline with n+4 control points,
P0P0P0 - P1 - P2 - P3 - … - P{n-1}P{n-1}P{n-1}
is turned into another clamped uniform B-spline n+5 control points
Q0Q0Q0 - Q1 - Q2 - Q3 - Q4 - … - Q{n}Q{n}Q{n}
where
Q0 = P0,
Q{n} = P{n-1}, and
Q{i} for i∈[1,n-1] is on the line segment P{i-1} - P{i}.
Types ¶
type Attributes ¶
func Measure ¶
func Measure(spline Curve) Attributes
type Bounds ¶
Bounds is like image.Rectangle with its upper bound inclusive.
type Kinematics ¶
type Kinematics struct {
Velocity bezier.Point
Acceleration bezier.Point
Jerk bezier.Point
// contains filtered or unexported fields
}
Kinematics track the derivative values of a B-Spline.
func (*Kinematics) Knot ¶
func (k *Kinematics) Knot(t uint, ctrl bezier.Point, scale uint)
Knot shifts the spline one knot and updates the kinematics.
func (*Kinematics) Max ¶
func (k *Kinematics) Max() (v, a, j uint)