ConvexPolygon

abstract class ConvexPolygon : Polygon

A Polygon with internal angles all <= 180°

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val area: Double
Link copied to clipboard
open override val empty: Boolean

Inherited 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

Functions

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

Uses winding-number approach https://en.wikipedia.org/wiki/Point_in_polygon

open operator override fun contains(rectangle: Rectangle): Boolean
Link copied to clipboard
open infix override fun intersects(rectangle: Rectangle): Boolean

Checks whether the Shape intersects a rectangle.

Inherited functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun ConvexPolygon.map(transform: (Point) -> Point): ConvexPolygon

Create a new ConvexPolygon with each point transformed by transform.

Link copied to clipboard

Create a new ConvexPolygon with the same points, but in reversed order.

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.