The cubic-bezier Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cubic-bezier Reference Manual

This is the cubic-bezier Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 15:47:52 2021 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

cubic-bezier

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

Install

(ql:quickload :cubic-bezier)

Usage

(make-curve points &key (divisions 100))

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.

(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.)

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

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

(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, ...).

(point-index-present-p curve index)

Check if curve has a point at index index.

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

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

License

Copyright © Michael Fiano mail@mfiano.net.

Licensed under the MIT Lice


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 cubic-bezier

Author

Michael Fiano <mail@mfiano.net>

Home Page

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

License

MIT

Description

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

Dependencies
Source

cubic-bezier.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cubic-bezier.asd

Location

/home/quickref/quicklisp/dists/quicklisp/software/cubic-bezier-20210411-git/cubic-bezier.asd

Systems

cubic-bezier (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cubic-bezier/package.lisp

Parent

cubic-bezier (system)

Location

package.lisp

Packages

cubic-bezier


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cubic-bezier/cubic-bezier.lisp

Dependency

package.lisp (file)

Parent

cubic-bezier (system)

Location

cubic-bezier.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cubic-bezier

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 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 (file)

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 (file)

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 (file)

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 (file)

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 (file)

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 (file)

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 (file)

Function: point-index-present-p CURVE INDEX

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

Package

cubic-bezier

Source

cubic-bezier.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Structures

Structure: curve ()
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: divisions
Type

fixnum

Initform

100

Readers

divisions (function)

Writers

(setf divisions) (function)

Slot: geometry
Type

vector

Initform

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

Readers

geometry (function)

Writers

(setf geometry) (function)

Slot: arc-lengths
Type

golden-utils:f32a

Initform

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

Readers

arc-lengths (function)

Writers

(setf arc-lengths) (function)

Slot: arc-lengths-update
Type

boolean

Readers

arc-lengths-update (function)

Writers

(setf arc-lengths-update) (function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: +matrix+
Package

cubic-bezier

Source

cubic-bezier.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: %make-curve &key (DIVISIONS DIVISIONS) (GEOMETRY GEOMETRY) (ARC-LENGTHS ARC-LENGTHS) (ARC-LENGTHS-UPDATE ARC-LENGTHS-UPDATE)
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: add-geometry CURVE POINTS
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: arc-lengths INSTANCE
Function: (setf arc-lengths) VALUE INSTANCE
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: arc-lengths-update INSTANCE
Function: (setf arc-lengths-update) VALUE INSTANCE
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: divisions INSTANCE
Function: (setf divisions) VALUE INSTANCE
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: ensure-point-list POINTS
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: estimate-arc-lengths CURVE
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: geometry INSTANCE
Function: (setf geometry) VALUE INSTANCE
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: make-geometry CURVE POINTS
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: remap CURVE PARAMETER
Package

cubic-bezier

Source

cubic-bezier.lisp (file)

Function: verify-points POINTS
Package

cubic-bezier

Source

cubic-bezier.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cubic-bezier.asd: The cubic-bezier․asd file
cubic-bezier/cubic-bezier.lisp: The cubic-bezier/cubic-bezier․lisp file
cubic-bezier/package.lisp: The cubic-bezier/package․lisp file

F
File, Lisp, cubic-bezier.asd: The cubic-bezier․asd file
File, Lisp, cubic-bezier/cubic-bezier.lisp: The cubic-bezier/cubic-bezier․lisp file
File, Lisp, cubic-bezier/package.lisp: The cubic-bezier/package․lisp file

L
Lisp File, cubic-bezier.asd: The cubic-bezier․asd file
Lisp File, cubic-bezier/cubic-bezier.lisp: The cubic-bezier/cubic-bezier․lisp file
Lisp File, cubic-bezier/package.lisp: The cubic-bezier/package․lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

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

%
%make-curve: Internal functions

(
(setf arc-lengths): Internal functions
(setf arc-lengths-update): Internal functions
(setf divisions): Internal functions
(setf geometry): Internal functions

A
add-geometry: Internal functions
add-points: Exported functions
arc-lengths: Internal functions
arc-lengths-update: Internal functions

C
collect-points: Exported functions
collect-segments: Exported functions

D
divisions: Internal functions

E
edit-point: Exported functions
ensure-point-list: Internal functions
estimate-arc-lengths: Internal functions
evaluate: Exported functions

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

G
geometry: Internal functions

M
make-curve: Exported functions
make-geometry: Internal functions

P
point-count-valid-p: Exported functions
point-index-present-p: Exported functions

R
remap: Internal functions

V
verify-points: Internal functions

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

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
A   C   D   G   S  
Index Entry  Section

+
+matrix+: Internal constants

A
arc-lengths: Exported structures
arc-lengths-update: Exported structures

C
Constant, +matrix+: Internal constants

D
divisions: Exported structures

G
geometry: Exported structures

S
Slot, arc-lengths: Exported structures
Slot, arc-lengths-update: Exported structures
Slot, divisions: Exported structures
Slot, geometry: Exported structures

Jump to:   +  
A   C   D   G   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cubic-bezier: The cubic-bezier system
cubic-bezier: The cubic-bezier package
curve: Exported structures

P
Package, cubic-bezier: The cubic-bezier package

S
Structure, curve: Exported structures
System, cubic-bezier: The cubic-bezier system

Jump to:   C   P   S