ShapeContour

@Serializable
data class ShapeContour @JvmOverloads constructor(val segments: List<Segment>, val closed: Boolean, val polarity: YPolarity = YPolarity.CW_NEGATIVE_Y) : ShapeContourProvider(source)

A List for managing a collection of Segments.

Constructors

Link copied to clipboard
constructor(segments: List<Segment>, closed: Boolean, polarity: YPolarity = YPolarity.CW_NEGATIVE_Y)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun adaptivePositions(distanceTolerance: Double = 0.5): List<Vector2>

Recursively subdivides linear Segments to approximate Bézier curves.

Link copied to clipboard
fun adaptivePositionsAndCorners(distanceTolerance: Double = 0.5): Pair<List<Vector2>, List<Boolean>>

Recursively subdivides linear Segments to approximate Bézier curves.

Link copied to clipboard
fun adaptivePositionsWithT(distanceTolerance: Double = 0.5): List<Pair<Vector2, Double>>
Link copied to clipboard

Closes the path of the ShapeContour.

Link copied to clipboard
operator fun ShapeContour.contains(point: Vector2): Boolean

Returns true if given point lies inside the ShapeContour.

Link copied to clipboard

Applies a boolean difference operation between the ShapeContour and another Shape.

Link copied to clipboard
fun equidistantPositions(pointCount: Int, distanceTolerance: Double = 0.5): List<Vector2>

Returns specified amount of points of equal distance from each other.

Link copied to clipboard
fun equidistantPositionsWithT(pointCount: Int, distanceTolerance: Double = 0.5): List<Pair<Vector2, Double>>
Link copied to clipboard

Applies a boolean intersection operation between the ShapeContour and a Shape.

Link copied to clipboard

Calculates a List of all intersections between the ShapeContour and a Segment.

Calculates a List of all intersections between the ShapeContour and a Shape.

Calculates a List of all intersections between the ShapeContour and another ShapeContour.

Link copied to clipboard

Projects a point on the ShapeContour

Link copied to clipboard

Calculates the normal for the given ut.

Link copied to clipboard
fun ShapeContour.offset(distance: Double, joinType: SegmentJoin = SegmentJoin.ROUND): ShapeContour

Offsets a ShapeContour's Segments by given distance.

Link copied to clipboard
fun on(point: Vector2, error: Double = 5.0): Double?

Checks if given point lies on the path of the ShapeContour.

Link copied to clipboard
operator fun plus(other: ShapeContour): ShapeContour
Link copied to clipboard
fun pointAtLength(length: Double, distanceTolerance: Double = 0.5): Vector2

Calculates the point at a given distance along this ShapeContour.

Link copied to clipboard

Calculates the pose Matrix44 (i.e. translation and rotation) that describes an orthonormal basis formed by normal and tangent of the contour at t.

Link copied to clipboard

Returns a point on the path of the ShapeContour.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Samples the ShapeContour into equidistant linear Segments.

Link copied to clipboard
fun sampleLinear(distanceTolerance: Double = 0.5): ShapeContour

Adaptively samples the contour into a new ShapeContour of linear Segments while still approximating the original contour.

Link copied to clipboard

Returns segment number and segment offset in a ShapeContour for the given ut.

Link copied to clipboard
Link copied to clipboard
fun sub(t0: Double, t1: Double): ShapeContour

Samples a new ShapeContour from the current ShapeContour starting at t0 and ending at t1.

Link copied to clipboard
fun tForLength(length: Double): Double

Estimates the t value for a given length.

Link copied to clipboard

Applies linear transformation to ShapeContour.

Link copied to clipboard

Applies a boolean org.openrndr.shape.union operation between the ShapeContour and a Shape.

Properties

Link copied to clipboard

Calculates the bounding box of the contour as Rectangle.

Link copied to clipboard

Returns the ShapeContour, but with a clockwise winding.

Link copied to clipboard
Link copied to clipboard
open override val contour: ShapeContour

the provided contour

Link copied to clipboard

Returns the ShapeContour, but with a counterclockwise winding.

Link copied to clipboard

Returns true if ShapeContour doesn't contain any Segments.

Link copied to clipboard

Converts to a List of single Segments.

Link copied to clipboard

Calculates approximate Euclidean length of the contour.

Link copied to clipboard

Opens the path of the ShapeContour.

Link copied to clipboard
Link copied to clipboard

Reverses the direction of Segments and their order.

Link copied to clipboard
Link copied to clipboard

Returns Shape representation.

Link copied to clipboard

Determines the winding order of the ShapeContour.