BezierPatch3DBase

open class BezierPatch3DBase<C : AlgebraicColor<C>, ConvertibleToColorRGBa>(val points: List<List<Vector3>>, val colors: List<List<C>> = emptyList())(source)

Represents a 3D Bezier patch defined by a 4x4 grid of control points and optional color data. This class provides utilities for manipulation, transformation, and evaluation of the patch.

The control points and colors must be organized as a 4x4 grid. The patch supports operations including transformation, sub-patching, path extraction, and random point generation.

Parameters

C

The type of color data associated with the patch. It must implement both AlgebraicColor and ConvertibleToColorRGBa.

Throws

if points or colors, if provided, do not conform to the required 4x4 structure.

Inheritors

Constructors

Link copied to clipboard
constructor(points: List<List<Vector3>>, colors: List<List<C>> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val colors: List<List<C>>

A 4x4 grid of color data corresponding to the control points. This parameter is optional and defaults to an empty list.

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

A 4x4 grid of control points that define the shape of the Bezier patch.

Link copied to clipboard

Return a transposed version of the bezier path by transposing the points matrix

Functions

Link copied to clipboard
operator fun div(scale: Double): BezierPatch3DBase<C>
Link copied to clipboard
fun gradient(u: Double, v: Double): Vector3

Return a gradient vector on the patch by using its u,v parameterization

Link copied to clipboard
fun horizontal(v: Double): Path3D
Link copied to clipboard
operator fun minus(right: BezierPatch3DBase<C>): BezierPatch3DBase<C>
Link copied to clipboard
operator fun plus(right: BezierPatch3DBase<C>): BezierPatch3DBase<C>
Link copied to clipboard
fun position(u: Double, v: Double): Vector3

Return a point on the patch by using its u,v parameterization

Link copied to clipboard
fun randomPoint(random: Random = Random.Default): Vector3

Generate a random point on the path

Link copied to clipboard
fun sub(u0: Double, v0: Double, u1: Double, v1: Double): BezierPatch3DBase<C>

Extract a sub-patch based on uv parameterization

Link copied to clipboard
operator fun times(scale: Double): BezierPatch3DBase<C>
Link copied to clipboard
fun transform(transform: Matrix44): BezierPatch3DBase<C>
Link copied to clipboard
fun vertical(u: Double): Path3D
Link copied to clipboard
fun <K : AlgebraicColor<K>, ConvertibleToColorRGBa> withColors(colors: List<List<K>>): BezierPatch3DBase<K>