Circle

class Circle(origin: Point, radius: Double = 1.0, vertices: Int = 20) : Path

A circular Path approximated by a regular polygon with vertices sides.

Higher vertices values produce smoother circles at the cost of more geometry. A minimum of 3 vertices is required; 20 (the default) is visually smooth for most use cases.

Parameters

origin

Center point of the circle in world space.

radius

Radius of the circle in world units. Must be positive.

vertices

Number of sides in the polygon approximation. Must be >= 3.

Constructors

Link copied to clipboard
constructor(origin: Point, radius: Double = 1.0, vertices: Int = 20)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Average depth of all points in this path, precalculated at construction time. Uses the default 30° angle.

Link copied to clipboard

Functions

Link copied to clipboard
fun closerThan(pathA: Path, observer: Point): Int

If pathB ("this") is closer from the observer than pathA, it must be drawn after. It is closer if one of its vertices and the observer are on the same side of the plane defined by pathA.

Link copied to clipboard
fun depth(angle: Double): Double

Average depth for an arbitrary engine angle.

Link copied to clipboard
fun reverse(): Path

Returns a new path with the points in reverse order

Link copied to clipboard
fun rotateX(origin: Point, angle: Double): Path

Rotate about origin on the X axis

Link copied to clipboard
fun rotateY(origin: Point, angle: Double): Path

Rotate about origin on the Y axis

Link copied to clipboard
fun rotateZ(origin: Point, angle: Double): Path

Rotate about origin on the Z axis

Link copied to clipboard
fun scale(origin: Point, dx: Double): Path
fun scale(origin: Point, dx: Double, dy: Double): Path

fun scale(origin: Point, dx: Double, dy: Double, dz: Double): Path

Scale about a given origin

Link copied to clipboard
fun translate(dx: Double, dy: Double, dz: Double): Path

Translate the path by the given deltas