Polygon

abstract class Polygon : Shape

A Shape defined by a set of line segments that connect to enclose a region.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val boundingRectangle: Rectangle

Gives the smallest Rectangle that fully contains this Polygon.

Link copied to clipboard
abstract val points: List<Point>

Points representing the vertices

Inherited properties

Link copied to clipboard
abstract val area: Double
Link copied to clipboard
abstract val empty: Boolean

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int

Inherited functions

Link copied to clipboard
abstract operator fun contains(point: Point): Boolean

Checks whether the Shape contains a given point.

abstract operator fun contains(rectangle: Rectangle): Boolean

Checks whether the Shape contains a given rectangle.

Link copied to clipboard
abstract infix fun intersects(rectangle: Rectangle): Boolean

Checks whether the Shape intersects a rectangle.

Link copied to clipboard
fun Polygon.rounded(config: (index: Int, Point) -> Double): Path
fun Polygon.rounded(radius: Double, filter: (index: Int, Point) -> Boolean = { _,_ -> true }): Path

Creates a rounded shape from a Polygon. The resulting shape is essentially a polygon with the vertices rounded using a semicircular curve.

Link copied to clipboard

Converts a Polygon to a Path.