openrndr / org.openrndr.shape

Package org.openrndr.shape

code related to 2d shapes

Types

Circle

class Circle

Color

class Color : CompositionColor

Composition

class Composition

CompositionColor

sealed class CompositionColor

CompositionDrawer

class CompositionDrawer

A Drawer-like interface for the creation of Compositions This should be easier than creating Compositions manually

CompositionNode

sealed class CompositionNode

CompositionStrokeWeight

sealed class CompositionStrokeWeight

Compound

class Compound

CompoundBuilder

class CompoundBuilder

ContourBuilder

class ContourBuilder

ContourProjection

class ContourProjection

GroupNode

open class GroupNode : CompositionNode

GroupNodeStop

class GroupNodeStop : GroupNode

IndexedTriangulation

class IndexedTriangulation

Indexed triangulation consisting of a list of vertices and triangle indices.

InheritColor

object InheritColor : CompositionColor

InheritStrokeWeight

object InheritStrokeWeight : CompositionStrokeWeight

IntRectangle

class IntRectangle

LineSegment

data class LineSegment

Rectangle

data class Rectangle

Segment

class Segment

Segment describes a linear or bezier path between two points

SegmentJoin

enum class SegmentJoin

SegmentProjection

class SegmentProjection

Shape

class Shape

ShapeBuilder

class ShapeBuilder

ShapeContour

data class ShapeContour

ShapeNode

class ShapeNode : CompositionNode

StrokeWeight

class StrokeWeight : CompositionStrokeWeight

TextNode

class TextNode : CompositionNode

Winding

enum class Winding

Extensions for External Classes

kotlin.collections.List

Functions

compound

fun compound(f: CompoundBuilder.() -> List<Shape>): List<Shape>

contour

fun contour(f: ContourBuilder.() -> Unit): ShapeContour

difference

fun difference(from: ShapeContour, subtract: ShapeContour): List<Shape>
fun difference(from: Shape, subtract: ShapeContour): List<Shape>
fun difference(from: Shape, subtract: Shape): List<Shape>
fun difference(from: List<Shape>, subtract: ShapeContour): List<Shape>
fun difference(from: List<Shape>, subtract: Shape): List<Shape>
fun difference(from: List<Shape>, subtract: List<Shape>): List<Shape>
fun difference(from: List<Shape>, subtract: List<List<Shape>>): List<Shape>

filter

fun CompositionNode.filter(filter: (CompositionNode) -> Boolean): CompositionNode?

intersection

fun intersection(a: LineSegment, b: LineSegment, eps: Double = 0.01): Vector2
fun intersection(a0: Vector2, a1: Vector2, b0: Vector2, b1: Vector2, eps: Double = 0.01): Vector2
fun intersection(from: ShapeContour, with: ShapeContour): List<Shape>
fun intersection(from: Shape, with: ShapeContour): List<Shape>
fun intersection(from: ShapeContour, with: Shape): List<Shape>
fun intersection(from: Shape, with: Shape): List<Shape>
fun intersection(from: List<Shape>, with: ShapeContour): List<Shape>
fun intersection(from: List<Shape>, with: Shape): List<Shape>
fun intersection(from: List<Shape>, with: List<Shape>): List<Shape>
fun intersection(from: List<Shape>, with: List<List<Shape>>): List<Shape>

intersects

fun intersects(a: Rectangle, b: Rectangle): Boolean

determines of a and b intersect

map

fun CompositionNode.map(mapper: (CompositionNode) -> CompositionNode): CompositionNode

rectangleBounds

fun rectangleBounds(rectangles: List<Rectangle>): Rectangle

calculates Rectangle-bounds for a list of Rectangle instances

sampleEquidistant

fun sampleEquidistant(pieces: List<Vector2>, count: Int): List<Vector2>

shape

fun shape(f: ShapeBuilder.() -> Unit): Shape

split

fun split(shape: Shape, line: LineSegment): Pair<List<Shape>, List<Shape>>

triangulate

fun triangulate(shape: Shape, distanceTolerance: Double = 0.5): List<Vector2>

triangulates a Shape into a list of triangles

triangulateIndexed

fun triangulateIndexed(shape: Shape, distanceTolerance: Double = 0.5): IndexedTriangulation

triangulates a Shape into a list of indexed triangles

union

fun union(from: ShapeContour, add: ShapeContour): List<Shape>
fun union(from: Shape, add: ShapeContour): List<Shape>
fun union(from: Shape, add: Shape): List<Shape>
fun union(from: List<Shape>, add: ShapeContour): List<Shape>
fun union(from: List<Shape>, add: Shape): List<Shape>
fun union(from: List<Shape>, add: List<Shape>): List<Shape>
fun union(from: List<Shape>, add: List<List<Shape>>): List<Shape>

vector2Bounds

fun vector2Bounds(points: List<Vector2>): Rectangle

calculates Rectangle-bounds for a list of Vector2 instances