openrndr / org.openrndr.shape / ContourBuilder

ContourBuilder

class ContourBuilder (source)

Constructors

<init>

ContourBuilder(multipleContours: Boolean)

Properties

anchor

var anchor: Vector2

cursor

var cursor: Vector2

lastSegment

val lastSegment: Segment?

result

val result: List<ShapeContour>

segments

val segments: MutableList<Segment>

Functions

arcTo

fun arcTo(crx: Double, cry: Double, angle: Double, largeArcFlag: Boolean, sweepFlag: Boolean, tx: Double, ty: Double): Unit
fun arcTo(crx: Double, cry: Double, angle: Double, largeArcFlag: Boolean, sweepFlag: Boolean, end: Vector2): Unit

circularArcTo

fun circularArcTo(through: Vector2, end: Vector2): Unit

close

Closes the contour, adds a line segment to anchor when needed

fun close(): Unit

continueTo

fun continueTo(end: Vector2, tangentScale: Double = 1.0): Unit
fun continueTo(x: Double, y: Double, tangentScale: Double = 1.0): Unit
fun continueTo(control: Vector2, end: Vector2, tangentScale: Double = 1.0): Unit
fun continueTo(cx: Double, cy: Double, x: Double, y: Double, tangentScale: Double = 1.0): Unit

curveTo

Quadratic curve to

fun curveTo(control: Vector2, position: Vector2): Unit
fun curveTo(cx: Double, cy: Double, x: Double, y: Double): Unit

Cubic curve to

fun curveTo(control0: Vector2, control1: Vector2, position: Vector2): Unit
fun curveTo(c0x: Double, c0y: Double, c1x: Double, c1y: Double, x: Double, y: Double): Unit

lineTo

Line to

fun lineTo(position: Vector2): Unit
fun lineTo(x: Double, y: Double): Unit

moveOrCurveTo

fun moveOrCurveTo(control: Vector2, position: Vector2): Unit
fun moveOrCurveTo(cx: Double, cy: Double, x: Double, y: Double): Unit
fun moveOrCurveTo(control0: Vector2, control1: Vector2, position: Vector2): Unit
fun moveOrCurveTo(c0x: Double, c0y: Double, c1x: Double, c1y: Double, x: Double, y: Double): Unit

moveOrLineTo

Move the pen or draw a line to the given coordinates. The pen is moved without drawing when to prior moveTo instructions have been given.

fun moveOrLineTo(position: Vector2): Unit
fun moveOrLineTo(x: Double, y: Double): Unit

moveTo

Move pen without drawing

fun moveTo(position: Vector2): Unit

Move the pen to the given coordinates without drawing

fun moveTo(x: Double, y: Double): Unit

reverse

Reverse all segments

fun reverse(): Unit

segment

fun segment(segment: Segment): Unit

undo

fun undo(): Segment?