Package-level declarations

Types

Link copied to clipboard
data class HobbyTension(val start: Double = 1.0, val end: Double = 1.0, val atLeast: Boolean = false)

The METAFONT tensions of a segment of a Hobby curve, see hobbyCurve.

Functions

Link copied to clipboard
fun hobbyCurve(points: List<Vector2>, closed: Boolean = false, curl: Double = 0.0, tensions: (chordIndex: Int, inAngleDegrees: Double, outAngleDegrees: Double) -> Pair<Double, Double> = { _, _, _ -> Pair(1.0, 1.0) }): ShapeContour

Generates a smooth contour passing through a set of points based on Hobby's algorithm.

fun hobbyCurve(points: List<Vector2>, closed: Boolean = false, curl: Double = 0.0, segmentTensions: List<HobbyTension>): ShapeContour

Generates a Hobby curve through points with METAFONT tensions per segment, see the overload that takes a single tension.

fun hobbyCurve(points: List<Vector3>, closed: Boolean = false, curl: Double = 0.0, tensions: (chordIndex: Int, inAngleDegrees: Double, outAngleDegrees: Double) -> Pair<Double, Double> = { _, _, _ -> Pair(1.0, 1.0) }): Path3D

Uses Hobby's algorithm to construct a Path3D through a given list of points.

fun hobbyCurve(points: List<Vector3>, closed: Boolean = false, curl: Double = 0.0, segmentTensions: List<HobbyTension>): Path3D

A 3D Hobby curve through points with METAFONT tensions per segment, see the 2D overload.

fun hobbyCurve(points: List<Vector2>, closed: Boolean = false, curl: Double = 0.0, tension: Double, atLeast: Boolean = false): ShapeContour

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).

fun hobbyCurve(points: List<Vector3>, closed: Boolean = false, curl: Double = 0.0, tension: Double, atLeast: Boolean = false): Path3D

A 3D Hobby curve through points with a METAFONT tension, see the 2D overload that takes a single tension.

Link copied to clipboard
fun Shape.hobbyCurve(curl: Double = 0.0, tension: Double = 1.0, atLeast: Boolean = false): Shape

Replaces every contour of this shape by a Hobby curve through its vertices, see ShapeContour.hobbyCurve.

fun ShapeContour.hobbyCurve(curl: Double = 0.0, tension: Double = 1.0, atLeast: Boolean = false): ShapeContour

Replaces this contour by a Hobby curve through its vertices, see hobbyCurve.