CurveInterval

class CurveInterval(curve: Curve2, tLo: Double, tHi: Double, pLo: Vec2, pHi: Vec2)(source)

Represents a parametric interval of a 2D curve, defined by a start and end parameter, and their corresponding geometric positions.

The CurveInterval class is used for operations such as splitting, bounding box calculations, and intersection testing within this range of the curve.

Parameters

curve

the curve (Curve2) to which this interval belongs

tLo

the lower bound of the parametric range

tHi

the upper bound of the parametric range

pLo

the 2D point on the curve corresponding to tLo

pHi

the 2D point on the curve corresponding to tHi

Constructors

Link copied to clipboard
constructor(curve: Curve2, tLo: Double, tHi: Double, pLo: Vec2, pHi: Vec2)

Creates a new instance of CurveInterval representing the interval of a curve. It calculates whether the interval is "flat," determines its parameter range, and sets the starting and ending positions of the interval on the curve.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val pHi: Vec2

Represents the 2D point on the curve corresponding to the upper parameter bound (tHi) of the interval.

Link copied to clipboard
val pLo: Vec2

Represents the 2D position corresponding to the lower parametric bound (tLo) of the curve interval.

Link copied to clipboard
val tHi: Double

The upper bound of the parametric range for the curve interval.

Link copied to clipboard
val tLo: Double

The lower bound of the parametric range of a curve interval.

Functions

Link copied to clipboard
fun bounds(): Box2
Link copied to clipboard

Computes the intersection points between the current CurveInterval and another provided CurveInterval. The computed intersection points are added to the provided list of Vec2 objects.

Link copied to clipboard
Link copied to clipboard

Splits the current curve interval into two sub-intervals.

Link copied to clipboard
open override fun toString(): String