hobbyCurve
Replaces this contour by a Hobby curve through its vertices, see hobbyCurve.
Parameters
the curl at the ends of an open contour
the METAFONT tension at every point, at least 3/4; higher values give tighter curves
whether the tension is a minimum that keeps every segment inside the triangle of its chord and end tangents, as METAFONT's tension atleast
Replaces every contour of this shape by a Hobby curve through its vertices, see ShapeContour.hobbyCurve.
Generates a smooth contour passing through a set of points based on Hobby's algorithm.
Return
A ShapeContour object representing the smoothed curve based on Hobby's algorithm.
Parameters
A list of 2D points through which the curve should pass.
A boolean value indicating whether the curve is closed (true) forming a loop, or open (false). The default is false.
A parameter that controls the curvature of the open-ended curve. Only applicable if the curve is not closed. The default is 0.0.
A lambda function that accepts the chord index (an integer) and returns a pair of factors (Double) for the lengths of the curve's control handles, applied after the curve has been solved. Larger values give rounder segments. These are not METAFONT tensions, which enter the solve itself and make the curve tighter as they grow; see the overloads that take a tension for those. The default lambda assigns both values as 1.0.
Generates a Hobby curve through points with a METAFONT tension, after Hobby, "Smooth, easy to compute interpolating splines" (Discrete & Computational Geometry, 1986) and Knuth, "METAFONT: The Program" (§276-§299).
The tension enters the equations for the directions at the points, not only the lengths of the control handles: with reciprocal tensions α where a segment leaves a point and β where it arrives, the mock curvature at an interior point is continuous where A·θᵢ₋₁ + (B + C)·θᵢ + D·θᵢ₊₁ = -B·ψᵢ - D·ψᵢ₊₁, with A = αᵢ₋₁ / (βᵢ²·dᵢ₋₁), B = (3 - αᵢ₋₁) / (βᵢ²·dᵢ₋₁), C = (3 - βᵢ₊₁) / (αᵢ²·dᵢ) and D = βᵢ₊₁ / (αᵢ²·dᵢ), for the directions θ relative to the chords, the turning angles ψ and the chord lengths d. The ends of an open curve follow from the curl through METAFONT's curl ratio. The control handles have length ρ(θ, φ) / (3τ) times the chord. Tension 1 is Hobby's original curve, higher tensions give tighter curves that approach the polyline, and tensions below 1, down to 3/4, rounder ones.
With atLeast the tension is a minimum, as METAFONT's tension atleast: where the tangents at both ends of a segment lie on the same side of its chord, its handles are shortened so that the segment stays inside the triangle of the chord and the two tangent lines.
Parameters
the points through which the curve passes
whether the curve is closed
the curl at the ends of an open curve: 0 makes the end segments straighten out, 1 makes them nearly circular arcs
the tension at every point, at least 3/4
whether the tension is a minimum that keeps every segment inside the triangle of its chord and end tangents
Generates a Hobby curve through points with METAFONT tensions per segment, see the overload that takes a single tension.
Parameters
the tensions of every segment, one per segment: as many as there are points for a closed curve, one fewer for an open one
Uses Hobby's algorithm to construct a Path3D through a given list of points.
Return
A Path3D through points.
Parameters
The list of points through which the curve should go.
Whether to construct a closed or open curve.
The 'curl' at the endpoints of the curve; this is only applicable when closed is false. Best results for values in -1, 1, where a higher value makes segments closer to circular arcs.
A function that returns factors for the lengths of the in and out control handles given a chord index, applied after the curve has been solved; these are not METAFONT tensions, see the overloads that take those.
A 3D Hobby curve through points with a METAFONT tension, see the 2D overload that takes a single tension.
A 3D Hobby curve through points with METAFONT tensions per segment, see the 2D overload.