Pyramid

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

A pyramid shape with a rectangular base tapering to an apex.

The base is defined by position, width, and depth, and the apex is centered above the base at the given height.

Parameters

position

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

width

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

depth

The extent of the base along the y-axis (must be positive, default 1.0)

height

The height of the apex above the base 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): Pyramid

Translate the shape by the given deltas