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 Feb 26 16:10:45 2024 GMT+0.

Table of Contents


1 Introduction


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 <>

Home Page

https://git.mfiano.net/mfiano/cubic-bezier

License

MIT

Version

0.1.0

Dependencies
  • mfiano-utils (system).
  • origin (system).
Source

cubic-bezier.asd.

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

cubic-bezier.asd.

Parent Component

cubic-bezier (system).

ASDF Systems

cubic-bezier.


3.1.2 cubic-bezier/package.lisp

Source

cubic-bezier.asd.

Parent Component

cubic-bezier (system).

Packages

cubic-bezier.


3.1.3 cubic-bezier/cubic-bezier.lisp

Dependency

package.lisp (file).

Source

cubic-bezier.asd.

Parent Component

cubic-bezier (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cubic-bezier

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Ordinary functions

Function: add-points (curve points)

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

cubic-bezier.

Source

cubic-bezier.lisp.

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

cubic-bezier.

Source

cubic-bezier.lisp.

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

cubic-bezier.

Source

cubic-bezier.lisp.

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

cubic-bezier.

Source

cubic-bezier.lisp.

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

cubic-bezier.

Source

cubic-bezier.lisp.

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

cubic-bezier.

Source

cubic-bezier.lisp.

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

cubic-bezier.

Source

cubic-bezier.lisp.

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

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

Package

cubic-bezier.

Source

cubic-bezier.lisp.


5.1.2 Structures

Structure: curve
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: divisions
Type

fixnum

Initform

100

Readers

divisions.

Writers

(setf divisions).

Slot: geometry
Type

vector

Initform

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

Readers

geometry.

Writers

(setf geometry).

Slot: arc-lengths
Type

mfiano-utils:f32a

Initform

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

Readers

arc-lengths.

Writers

(setf arc-lengths).

Slot: arc-lengths-update
Type

boolean

Readers

arc-lengths-update.

Writers

(setf arc-lengths-update).


5.2 Internals


5.2.1 Constants

Constant: +matrix+
Package

cubic-bezier.

Source

cubic-bezier.lisp.


5.2.2 Ordinary functions

Function: %make-curve (&key divisions geometry arc-lengths arc-lengths-update)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Function: add-geometry (curve points)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Reader: arc-lengths (instance)
Writer: (setf arc-lengths) (instance)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Target Slot

arc-lengths.

Reader: arc-lengths-update (instance)
Writer: (setf arc-lengths-update) (instance)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Target Slot

arc-lengths-update.

Reader: divisions (instance)
Writer: (setf divisions) (instance)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Target Slot

divisions.

Function: ensure-point-list (points)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Function: estimate-arc-lengths (curve)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Reader: geometry (instance)
Writer: (setf geometry) (instance)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Target Slot

geometry.

Function: make-geometry (curve points)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Function: remap (curve parameter)
Package

cubic-bezier.

Source

cubic-bezier.lisp.

Function: verify-points (points)
Package

cubic-bezier.

Source

cubic-bezier.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   C   D   E   F   G   M   P   R   V  
Index Entry  Section

%
%make-curve: Private ordinary functions

(
(setf arc-lengths): Private ordinary functions
(setf arc-lengths-update): Private ordinary functions
(setf divisions): Private ordinary functions
(setf geometry): Private ordinary functions

A
add-geometry: Private ordinary functions
add-points: Public ordinary functions
arc-lengths: Private ordinary functions
arc-lengths-update: Private ordinary functions

C
collect-points: Public ordinary functions
collect-segments: Public ordinary functions

D
divisions: Private ordinary functions

E
edit-point: Public ordinary functions
ensure-point-list: Private ordinary functions
estimate-arc-lengths: Private ordinary functions
evaluate: Public ordinary functions

F
Function, %make-curve: Private ordinary functions
Function, (setf arc-lengths): Private ordinary functions
Function, (setf arc-lengths-update): Private ordinary functions
Function, (setf divisions): Private ordinary functions
Function, (setf geometry): Private ordinary functions
Function, add-geometry: Private ordinary functions
Function, add-points: Public ordinary functions
Function, arc-lengths: Private ordinary functions
Function, arc-lengths-update: Private ordinary functions
Function, collect-points: Public ordinary functions
Function, collect-segments: Public ordinary functions
Function, divisions: Private ordinary functions
Function, edit-point: Public ordinary functions
Function, ensure-point-list: Private ordinary functions
Function, estimate-arc-lengths: Private ordinary functions
Function, evaluate: Public ordinary functions
Function, geometry: Private ordinary functions
Function, make-curve: Public ordinary functions
Function, make-geometry: Private ordinary functions
Function, point-count-valid-p: Public ordinary functions
Function, point-index-present-p: Public ordinary functions
Function, remap: Private ordinary functions
Function, verify-points: Private ordinary functions

G
geometry: Private ordinary functions

M
make-curve: Public ordinary functions
make-geometry: Private ordinary functions

P
point-count-valid-p: Public ordinary functions
point-index-present-p: Public ordinary functions

R
remap: Private ordinary functions

V
verify-points: Private ordinary functions