BezierVolume

class BezierVolume(val points: List<List<List<Vector3>>>)(source)

A tricubic Bezier volume: a 4x4x4 lattice of control points, indexed as points[w][v][u], that maps the unit cube of u, v and w to a deformed block of space. Moving its control points bends, twists or tapers whatever is placed in it, see org.openrndr.extra.shapes.distort.envelope.

Constructors

Link copied to clipboard
constructor(points: List<List<List<Vector3>>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val points: List<List<List<Vector3>>>

Functions

Link copied to clipboard
fun deform(basis: Box, position: Vector3): Vector3

The point of the volume for the point position of the basis box: the corner of the box goes to where u, v and w are 0, the opposite corner to where they are 1

fun deform(basis: Box, position: Vector3, normal: Vector3): Pair<Vector3, Vector3>

The point of the volume for the point position of the basis box, see deform, and the normal there mapped by the inverse transpose of the Jacobian of that mapping, of unit length; where the Jacobian is singular the normal is kept as it is. One pass over the control points for both.

Link copied to clipboard
fun du(u: Double, v: Double, w: Double): Vector3

the derivative of the volume along u at u, v, w

Link copied to clipboard
fun dv(u: Double, v: Double, w: Double): Vector3

the derivative of the volume along v at u, v, w

Link copied to clipboard
fun dw(u: Double, v: Double, w: Double): Vector3

the derivative of the volume along w at u, v, w

Link copied to clipboard
fun jacobian(u: Double, v: Double, w: Double): Matrix33

The Jacobian of the volume at u, v, w: the matrix whose columns are du, dv and dw, which maps small steps in u, v and w to the steps of the point they map to. Normals map by its inverse transpose.

Link copied to clipboard
fun map(transform: (Vector3) -> Vector3): BezierVolume

a volume with its control points moved by transform

Link copied to clipboard
fun position(u: Double, v: Double, w: Double): Vector3

the point of the volume at u, v and w, each from 0 to 1

Link copied to clipboard
fun positionAndJacobian(u: Double, v: Double, w: Double): Pair<Vector3, Matrix33>

The position and the jacobian of the volume at u, v, w together, in one pass over the control points