Struct visioncortex::Spline
source · [−]Expand description
Series of connecting 2D Bezier Curves
Fields
points: Vec<PointF64>
1+3*(num_curves) points, where the first curve is represented by the first 4 points and each subsequent curve is represented by the last point in the previous curve plus 3 points Points are of PointF64 type.
Implementations
Adds a curve to the end of the spline. Takes 3 points that are the second to fourth control points of the bezier curve. Note that the first control point is taken from the last point of the previous curve.
Returns an iterator on the vector of points on the spline
Returns the number of curves on the spline
Returns true if the spline contains no curve, false otherwise A curve is defined by 4 points, so a non-empty spline should contain at least 4 points.
pub fn from_image(
image: &BinaryImage,
clockwise: bool,
corner_threshold: f64,
outset_ratio: f64,
segment_length: f64,
max_iterations: usize,
splice_threshold: f64
) -> Self
pub fn from_image(
image: &BinaryImage,
clockwise: bool,
corner_threshold: f64,
outset_ratio: f64,
segment_length: f64,
max_iterations: usize,
splice_threshold: f64
) -> Self
Returns a spline created from image. The following steps are performed:
- Convert pixels into path
- Simplify the path into polygon
- Smoothen the polygon and approximate it with a curve-fitter
Corner/Splice thresholds are specified in radians. Length threshold is specified in pixels (length unit in path coordinate system).
Returns a spline by curve-fitting a path.
Splice threshold is specified in radians.