Prism

class Prism @JvmOverloads constructor(val position: Point = Point.ORIGIN, val width: Double = 1.0, val depth: Double = 1.0, val height: Double = 1.0) : Shape

A rectangular prism (box) shape composed of six quad faces.

Parameters

position

The minimum-corner origin point of the prism (default Point.ORIGIN)

width

The extent along the x-axis (must be positive, default 1.0)

depth

The extent along the y-axis (must be positive, default 1.0). Note that this is a geometric dimension and is unrelated to Path.depth, which is a sorting metric.

height

The extent along the z-axis (must be positive, default 1.0)

Constructors

Link copied to clipboard
constructor(position: Point = Point.ORIGIN, width: Double = 1.0, depth: Double = 1.0, height: Double = 1.0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Sort the list of faces by distance then return the ordered paths

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

Rotate about origin on the X axis

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

Rotate about origin on the Y axis

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

Rotate about origin on the Z axis

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

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

Scale about a given origin

Link copied to clipboard
open override fun translate(dx: Double, dy: Double, dz: Double): Prism

Translate the shape by the given deltas