Cylinder

class Cylinder @JvmOverloads constructor(val position: Point = Point.ORIGIN, val radius: Double = 1.0, val height: Double = 1.0, val vertices: Int = 20) : Shape

A cylindrical shape created by extruding a circular cross-section along the z-axis.

The circular base is approximated as a regular polygon; the vertices parameter controls the resolution of that approximation. Higher values produce a smoother appearance at the cost of more polygons.

Parameters

position

The center of the base circle (default Point.ORIGIN)

radius

The radius of the circular cross-section (must be positive, default 1.0)

height

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

vertices

The number of sides used to approximate the circle (minimum 3, default 20). Higher values produce a smoother cylinder but generate more polygons.

Constructors

Link copied to clipboard
constructor(position: Point = Point.ORIGIN, radius: Double = 1.0, height: Double = 1.0, vertices: Int = 20)

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): Cylinder

Translate the shape by the given deltas