# The cubic-bezier Reference Manual

This is the cubic-bezier Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon May 15 04:45:12 2023 GMT+0.

## 2 Systems

The main system appears first, followed by any subsystem dependency.

### 2.1 `cubic-bezier`

A library for constructing and evaluating cubic Bézier curve paths.

Author

Michael Fiano <>

MIT

Version

0.1.0

Dependencies
• `mfiano-utils` (system).
• `origin` (system).
Source
Child Components

## 3 Files

Files are sorted by type and then listed depth-first from the systems components trees.

### 3.1 Lisp

#### 3.1.1 `cubic-bezier/cubic-bezier.asd`

Source
Parent Component

`cubic-bezier` (system).

ASDF Systems

#### 3.1.2 `cubic-bezier/package.lisp`

Source
Parent Component

`cubic-bezier` (system).

Packages

## 4 Packages

Packages are listed by definition order.

## 5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.

### 5.1 Public Interface

#### 5.1.1 Ordinary functions

Append the specified ‘points‘ to ‘curve‘. ‘points‘ should be a sequence of 3-dimensional vectors as constructed with ‘#’origin.vec3:vec‘. NOTE: It is an error to add less than a segment worth of points. A cubic Bézier curve is defined by 4 points for the first segment, and three points for each successive segment (since the first point of a segment is shared with the last point of the previous segment.)

Package
Source
Function: collect-points (curve count &key even-spacing-p)

Evaluate ‘count‘ points along curve, returning a list of 3-dimensional vectors. If ‘even-spacing-p‘ is supplied, arc-length re-parameterization is applied: see the documentation for ‘#’evaluate‘ for more information.

Package
Source
Function: collect-segments (curve count &key even-spacing-p)

Collect a list of ‘count‘ segments of ‘curve‘. A segment is a list of two 3-dimensional vectors. If ‘even-spacing-p‘ is supplied, arc-length re-parameterization is applied: see the documentation for ‘#’evaluate‘ for more information.

Package
Source
Function: edit-point (curve index value)

Edit the point of ‘curve‘ at index ‘index‘ with ‘value‘. ‘value‘ should be a 3-dimensional vector as constructed with ‘#’origin.vec3:vec‘.

Package
Source
Function: evaluate (curve parameter &key even-spacing-p)

Evaluate ‘curve‘ at parameter ‘parameter‘. If ‘even-spacing-p‘ is non-NIL, arc-length re-parameterization is applied, which evenly spaces points along the curve. The number of points is defined by the ‘divisions‘ argument supplied when constructing the curve with ‘#’make-curve‘. Arc-length re-parameterization is a remapping of ‘parameter‘ before evaluating the curve, in order to allow for uses such as animation along a curve with a constant velocity.

Package
Source
Function: make-curve (points &key divisions)

Create a cubic Bézier curve path from the given sequence of ‘points‘. ‘points‘ is a sequence of 3-dimensional vectors as constructed with ‘#’origin.vec3:vec‘. ‘divisions‘ is the number of sub-divisions to use when estimating the arc-length of the curve path: see the documentation for ‘#’evaluate‘ for more information.

Package
Source
Function: point-count-valid-p (point-count)

Check whether the integer ‘point-count‘ is a valid number of points for a cubic Bézier curve path. To be valid, there must be at least 4 points, any increment of 3 thereafter: (4, 7, 10, 13, ...).

Package
Source
Function: point-index-present-p (curve index)

Check if ‘curve‘ has a point at index ‘index‘.

Package
Source

#### 5.1.2 Structures

Structure: curve
Package
Source
Direct superclasses

`structure-object`.

Direct slots
Slot: divisions
Type

`fixnum`

Initform

`100`

Writers
Slot: geometry
Type

`vector`

Initform

`(make-array 0 :adjustable t :fill-pointer 0)`

Writers
Slot: arc-lengths
Type

`mfiano-utils:f32a`

Initform

`(mfiano-utils:make-f32-array 0)`

Writers
Slot: arc-lengths-update
Type

`boolean`

Writers

### 5.2 Internals

#### 5.2.1 Constants

Constant: +matrix+
Package
Source

#### 5.2.2 Ordinary functions

Function: %make-curve (&key divisions geometry arc-lengths arc-lengths-update)
Package
Source
Package
Source
Writer: (setf arc-lengths) (instance)
Package
Source
Target Slot
Writer: (setf arc-lengths-update) (instance)
Package
Source
Target Slot
Writer: (setf divisions) (instance)
Package
Source
Target Slot
Function: ensure-point-list (points)
Package
Source
Function: estimate-arc-lengths (curve)
Package
Source
Writer: (setf geometry) (instance)
Package
Source
Target Slot
Function: make-geometry (curve points)
Package
Source
Function: remap (curve parameter)
Package
Source
Function: verify-points (points)
Package
Source