openrndr / org.openrndr.shape / ShapeContour

ShapeContour

data class ShapeContour (source)

Constructors

<init>

ShapeContour(segments: List<Segment>, closed: Boolean, polarity: YPolarity = YPolarity.CW_NEGATIVE_Y)

Properties

bounds

val bounds: Rectangle

clockwise

val clockwise: ShapeContour

closed

val closed: Boolean

counterClockwise

val counterClockwise: ShapeContour

exploded

val exploded: List<ShapeContour>

length

val length: Double

polarity

val polarity: YPolarity

reversed

val reversed: ShapeContour

segments

val segments: List<Segment>

triangulation

val triangulation: List<Triangle>

winding

val winding: Winding

Functions

adaptivePositions

fun adaptivePositions(distanceTolerance: Double = 0.5): List<Vector2>

adaptivePositionsAndDirection

fun adaptivePositionsAndDirection(distanceTolerance: Double = 0.5): Pair<List<Vector2>, List<Vector2>>

contains

operator fun contains(v: Vector2): Boolean

equidistantPositions

fun equidistantPositions(pointCount: Int): List<Vector2>

map

fun map(closed: Boolean = this.closed, mapper: (Segment) -> Segment): ShapeContour

normal

Evaluates the contour for the given position

fun normal(ut: Double): Vector2

offset

fun offset(distance: Double, joinType: SegmentJoin = SegmentJoin.ROUND): ShapeContour

on

Checks if a give point lies on the contour

fun on(point: Vector2, error: Double = 5.0): Double?

plus

operator fun plus(other: ShapeContour): ShapeContour

position

fun position(ut: Double): Vector2

project

Project a point on the contour

fun project(point: Vector2): ContourProjection

sampleEquidistant

Sample the shape contour into line segments

fun sampleEquidistant(pointCount: Int): ShapeContour

sampleLinear

Adaptively sample the contour into line segments while still approximating the original contour

fun sampleLinear(distanceTolerance: Double = 0.5): ShapeContour

sub

Sample a sub contour

fun sub(u0: Double, u1: Double): ShapeContour

transform

fun transform(transform: Matrix44): ShapeContour

Companion Object Properties

EMPTY

val EMPTY: ShapeContour

Companion Object Functions

fromPoints

fun fromPoints(points: List<Vector2>, closed: Boolean, polarity: YPolarity = YPolarity.CW_NEGATIVE_Y): ShapeContour