BezierPatchBase

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

Represents a base class for a Bezier patch, a surface defined by control points with optional color assignments.

The Bezier patch is constructed from a 4x4 grid of control points and optionally a 4x4 grid of color values.

Parameters

C

The type of the color, which must implement the interfaces AlgebraicColor and ConvertibleToColorRGBa.

Throws

if the points matrix is not 4x4, or if colors is not empty and not 4x4.

Inheritors

Constructors

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

Types

Link copied to clipboard
object Companion

Properties

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

An optional 4x4 grid of colors associated with the corresponding control points.

Link copied to clipboard
val contour: ShapeContour
Link copied to clipboard
val points: List<List<Vector2>>

A 4x4 grid of control points representing 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): BezierPatchBase<C>
Link copied to clipboard
fun gradient(u: Double, v: Double): Vector2

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

Link copied to clipboard
fun horizontal(v: Double): ShapeContour
Link copied to clipboard
operator fun minus(right: BezierPatchBase<C>): BezierPatchBase<C>
Link copied to clipboard
operator fun plus(right: BezierPatchBase<C>): BezierPatchBase<C>
Link copied to clipboard
fun position(u: Double, v: Double): Vector2

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

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

Generate a random point on the path

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

Extract a sub-patch based on uv parameterization

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