The glu-tessellate Reference Manual

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

The glu-tessellate Reference Manual

This is the glu-tessellate Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Tue Nov 15 05:54:46 2022 GMT+0.

Table of Contents


1 Introduction

glu-tessellate

This is a triangulation library that wraps around GLU's tessellation routines to make turning vectors of point data into triangles stupid easy.

Yes, it supports concave polygons, and yes it supports holes. It also allows you to specify which winding rule you use to triangulate.

It also returns every triangle it produces in counter-clockwise order. You can change this to clockwise by passing :cw t.

Usage

The library has one public function (don't you love simplicity?) which takes a vector points (a point being an '(x y) list) into a list of triangles:

;; returns two triangles making up this square
(glu-tessellate:tessellate #( (0 0) (0 10) (10 10) (10 0) ))  ->
    (((10.0d0 10.0d0) (0.0d0 10.0d0) (0.0d0 0.0d0))
	 ((10.0d0 0.0d0) (10.0d0 10.0d0) (0.0d0 0.0d0)))

It also supports polygons with holes. Holes are specified as a list of point vectors:

;; a square with a hole returns quite a few more triangles
(glu-tessellate:tessellate #( (0 0) (0 10) (10 10) (10 0) ) :holes '( #((3 3) (3 7) (7 7) (7 3)) )) ->
    (((10.0d0 10.0d0) (0.0d0 10.0d0) (3.0d0 7.0d0))
     ((0.0d0 0.0d0) (3.0d0 7.0d0) (0.0d0 10.0d0))
     ((3.0d0 7.0d0) (0.0d0 0.0d0) (3.0d0 3.0d0))
     ((10.0d0 0.0d0) (3.0d0 3.0d0) (0.0d0 0.0d0))
     ((3.0d0 3.0d0) (10.0d0 0.0d0) (7.0d0 3.0d0))
     ((10.0d0 10.0d0) (7.0d0 3.0d0) (10.0d0 0.0d0))
     ((7.0d0 3.0d0) (10.0d0 10.0d0) (7.0d0 7.0d0))
     ((3.0d0 7.0d0) (7.0d0 7.0d0) (10.0d0 10.0d0)))

Arguments

The one function this library uses takes the following keyword arguments:

:holes           ; a list of point vectors describing the holes in the polygon
:winding-rule    ; a keyword describing the winding rule: (:odd :nonzero :positive :negative :abs-geq-two)
:cw              ; if T, produced triangles will be in CW order instead of CCW

Limitations

GLU tessellation normally allows you to store arbitrary data with each point and also merge this point data when new points are created. This library doesn't currently allow this, and is only used for triangulation of points. If you need to attach colors to your triangles, it must be done so outside of the library...unless, of course, you wish to add arbitrary data support and issue a pull request ;).

The only other limitation I can think of is that it relies on GLU being on the system. Show me a system without GLU and I'll show you a computer from an alternate universe where Microsoft finally did away with all competition and DirectX rules o'er the land with an iron fist.


2 Systems

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


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

2.1 glu-tessellate

A simple triangulation engine that wraps around GLU’s tessellation system.

Author

Andrew Lyon <orthecreedence@gmail.com>

License

MIT

Version

0.1.0

Dependency

cffi (system).

Source

glu-tessellate.asd.

Child Components

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   [Contents][Index]

3.1.1 glu-tessellate/glu-tessellate.asd

Source

glu-tessellate.asd.

Parent Component

glu-tessellate (system).

ASDF Systems

glu-tessellate.


3.1.2 glu-tessellate/package.lisp

Source

glu-tessellate.asd.

Parent Component

glu-tessellate (system).

Packages

glu-tessellate.


3.1.3 glu-tessellate/tessellate.lisp

Dependency

package.lisp (file).

Source

glu-tessellate.asd.

Parent Component

glu-tessellate (system).

Public Interface

tessellate (function).

Internals

4 Packages

Packages are listed by definition order.


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

4.1 glu-tessellate

Source

package.lisp.

Nickname

tess

Use List
  • cffi.
  • common-lisp.
Public Interface

tessellate (function).

Internals

5 Definitions

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


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

5.1 Public Interface


5.1.1 Ordinary functions

Function: tessellate (points &key holes winding-rule cw)

Tessellate a polygon into triangles.

Package

glu-tessellate.

Source

tessellate.lisp.


5.2 Internals


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

5.2.1 Constants

Constant: +begin+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +ccw+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +cw+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +edge-flag+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +end+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +exterior+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +interior+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +line-loop+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +line-strip+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +lines+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +points+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +polygon+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +quad-strip+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +quads+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-begin+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-begin-data+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-boundary-only+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-combine+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-combine-data+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-coord-too-large+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-edge-flag+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-edge-flag-data+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-end+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-end-data+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error-1+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error-2+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error-3+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error-4+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error-5+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error-6+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error-7+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error-8+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-error-data+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-max-coord+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-missing-begin-contour+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-missing-begin-polygon+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-missing-end-contour+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-missing-end-polygon+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-need-combine-callback+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-tolerance+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-vertex+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-vertex-data+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-winding-abs-geq-two+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-winding-negative+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-winding-nonzero+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-winding-odd+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-winding-positive+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +tess-winding-rule+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +triangle-fan+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +triangle-strip+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +triangles+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +unknown+
Package

glu-tessellate.

Source

tessellate.lisp.

Constant: +vertex+
Package

glu-tessellate.

Source

tessellate.lisp.


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

5.2.2 Special variables

Special Variable: *created-points*
Package

glu-tessellate.

Source

tessellate.lisp.

Special Variable: *cur-triangle*
Package

glu-tessellate.

Source

tessellate.lisp.

Special Variable: *cur-triangle-wind*
Package

glu-tessellate.

Source

tessellate.lisp.

Special Variable: *cur-type*
Package

glu-tessellate.

Source

tessellate.lisp.

Special Variable: *polygons*
Package

glu-tessellate.

Source

tessellate.lisp.

Special Variable: *triangles*
Package

glu-tessellate.

Source

tessellate.lisp.


5.2.3 Macros

Macro: def-c-callback (name &rest args)
Package

glu-tessellate.

Source

tessellate.lisp.


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

5.2.4 Ordinary functions

Function: begin-polygon (tess)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: delete-tess (tess)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: do-tess-begin (type)

Called when a tessellation shape begins. Stores the shape type for later reference.

Package

glu-tessellate.

Source

tessellate.lisp.

Function: do-tess-combine (coords vertex-data weights data-out)

Called when tessellation must create a new point. Ideally this is where user data would be merged into a new point, but since we don’t support user data, there’s nothing to do but create the point and return =].

Package

glu-tessellate.

Source

tessellate.lisp.

Function: do-tess-end ()

Called with tessellation finishes with a shape. Saves all relevant data and sets up for another shape to come its way.

Package

glu-tessellate.

Source

tessellate.lisp.

Function: do-tess-error (err)

Error!!!!

Package

glu-tessellate.

Source

tessellate.lisp.

Function: do-tess-vertex (vertex)

Called when tessellation sends us a vertex. Uses the current shape type to figure out how the vertex will be processed/stored.

Package

glu-tessellate.

Source

tessellate.lisp.

Function: end-polygon (tess)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: error-string (code)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: get-tess-property (tess which data)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: get-winding-rule (wind-keyword)

Get the global winding rule for the keyword passed in.

Package

glu-tessellate.

Source

tessellate.lisp.

Function: new-tess ()
Package

glu-tessellate.

Source

tessellate.lisp.

Function: next-contour (tess type)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: polygon-clockwise-p (polygon-points)

Determine if the points of a polygon are in clockwise order.

Package

glu-tessellate.

Source

tessellate.lisp.

Function: tess-begin-contour (tess)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: tess-begin-polygon (tess data)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: tess-callback (tess which callbackfunc)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: tess-end-contour (tess)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: tess-end-polygon (tess)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: tess-normal (tess valuex valuey valuez)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: tess-property (tess which value)
Package

glu-tessellate.

Source

tessellate.lisp.

Function: tess-vertex (tess location data)
Package

glu-tessellate.

Source

tessellate.lisp.


Appendix A Indexes


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

A.1 Concepts


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

A.2 Functions

Jump to:   B   D   E   F   G   M   N   P   T  
Index Entry  Section

B
begin-polygon: Private ordinary functions

D
def-c-callback: Private macros
delete-tess: Private ordinary functions
do-tess-begin: Private ordinary functions
do-tess-combine: Private ordinary functions
do-tess-end: Private ordinary functions
do-tess-error: Private ordinary functions
do-tess-vertex: Private ordinary functions

E
end-polygon: Private ordinary functions
error-string: Private ordinary functions

F
Function, begin-polygon: Private ordinary functions
Function, delete-tess: Private ordinary functions
Function, do-tess-begin: Private ordinary functions
Function, do-tess-combine: Private ordinary functions
Function, do-tess-end: Private ordinary functions
Function, do-tess-error: Private ordinary functions
Function, do-tess-vertex: Private ordinary functions
Function, end-polygon: Private ordinary functions
Function, error-string: Private ordinary functions
Function, get-tess-property: Private ordinary functions
Function, get-winding-rule: Private ordinary functions
Function, new-tess: Private ordinary functions
Function, next-contour: Private ordinary functions
Function, polygon-clockwise-p: Private ordinary functions
Function, tess-begin-contour: Private ordinary functions
Function, tess-begin-polygon: Private ordinary functions
Function, tess-callback: Private ordinary functions
Function, tess-end-contour: Private ordinary functions
Function, tess-end-polygon: Private ordinary functions
Function, tess-normal: Private ordinary functions
Function, tess-property: Private ordinary functions
Function, tess-vertex: Private ordinary functions
Function, tessellate: Public ordinary functions

G
get-tess-property: Private ordinary functions
get-winding-rule: Private ordinary functions

M
Macro, def-c-callback: Private macros

N
new-tess: Private ordinary functions
next-contour: Private ordinary functions

P
polygon-clockwise-p: Private ordinary functions

T
tess-begin-contour: Private ordinary functions
tess-begin-polygon: Private ordinary functions
tess-callback: Private ordinary functions
tess-end-contour: Private ordinary functions
tess-end-polygon: Private ordinary functions
tess-normal: Private ordinary functions
tess-property: Private ordinary functions
tess-vertex: Private ordinary functions
tessellate: Public ordinary functions

Jump to:   B   D   E   F   G   M   N   P   T  

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

A.3 Variables

Jump to:   *   +  
C   S  
Index Entry  Section

*
*created-points*: Private special variables
*cur-triangle*: Private special variables
*cur-triangle-wind*: Private special variables
*cur-type*: Private special variables
*polygons*: Private special variables
*triangles*: Private special variables

+
+begin+: Private constants
+ccw+: Private constants
+cw+: Private constants
+edge-flag+: Private constants
+end+: Private constants
+exterior+: Private constants
+interior+: Private constants
+line-loop+: Private constants
+line-strip+: Private constants
+lines+: Private constants
+points+: Private constants
+polygon+: Private constants
+quad-strip+: Private constants
+quads+: Private constants
+tess-begin+: Private constants
+tess-begin-data+: Private constants
+tess-boundary-only+: Private constants
+tess-combine+: Private constants
+tess-combine-data+: Private constants
+tess-coord-too-large+: Private constants
+tess-edge-flag+: Private constants
+tess-edge-flag-data+: Private constants
+tess-end+: Private constants
+tess-end-data+: Private constants
+tess-error+: Private constants
+tess-error-1+: Private constants
+tess-error-2+: Private constants
+tess-error-3+: Private constants
+tess-error-4+: Private constants
+tess-error-5+: Private constants
+tess-error-6+: Private constants
+tess-error-7+: Private constants
+tess-error-8+: Private constants
+tess-error-data+: Private constants
+tess-max-coord+: Private constants
+tess-missing-begin-contour+: Private constants
+tess-missing-begin-polygon+: Private constants
+tess-missing-end-contour+: Private constants
+tess-missing-end-polygon+: Private constants
+tess-need-combine-callback+: Private constants
+tess-tolerance+: Private constants
+tess-vertex+: Private constants
+tess-vertex-data+: Private constants
+tess-winding-abs-geq-two+: Private constants
+tess-winding-negative+: Private constants
+tess-winding-nonzero+: Private constants
+tess-winding-odd+: Private constants
+tess-winding-positive+: Private constants
+tess-winding-rule+: Private constants
+triangle-fan+: Private constants
+triangle-strip+: Private constants
+triangles+: Private constants
+unknown+: Private constants
+vertex+: Private constants

C
Constant, +begin+: Private constants
Constant, +ccw+: Private constants
Constant, +cw+: Private constants
Constant, +edge-flag+: Private constants
Constant, +end+: Private constants
Constant, +exterior+: Private constants
Constant, +interior+: Private constants
Constant, +line-loop+: Private constants
Constant, +line-strip+: Private constants
Constant, +lines+: Private constants
Constant, +points+: Private constants
Constant, +polygon+: Private constants
Constant, +quad-strip+: Private constants
Constant, +quads+: Private constants
Constant, +tess-begin+: Private constants
Constant, +tess-begin-data+: Private constants
Constant, +tess-boundary-only+: Private constants
Constant, +tess-combine+: Private constants
Constant, +tess-combine-data+: Private constants
Constant, +tess-coord-too-large+: Private constants
Constant, +tess-edge-flag+: Private constants
Constant, +tess-edge-flag-data+: Private constants
Constant, +tess-end+: Private constants
Constant, +tess-end-data+: Private constants
Constant, +tess-error+: Private constants
Constant, +tess-error-1+: Private constants
Constant, +tess-error-2+: Private constants
Constant, +tess-error-3+: Private constants
Constant, +tess-error-4+: Private constants
Constant, +tess-error-5+: Private constants
Constant, +tess-error-6+: Private constants
Constant, +tess-error-7+: Private constants
Constant, +tess-error-8+: Private constants
Constant, +tess-error-data+: Private constants
Constant, +tess-max-coord+: Private constants
Constant, +tess-missing-begin-contour+: Private constants
Constant, +tess-missing-begin-polygon+: Private constants
Constant, +tess-missing-end-contour+: Private constants
Constant, +tess-missing-end-polygon+: Private constants
Constant, +tess-need-combine-callback+: Private constants
Constant, +tess-tolerance+: Private constants
Constant, +tess-vertex+: Private constants
Constant, +tess-vertex-data+: Private constants
Constant, +tess-winding-abs-geq-two+: Private constants
Constant, +tess-winding-negative+: Private constants
Constant, +tess-winding-nonzero+: Private constants
Constant, +tess-winding-odd+: Private constants
Constant, +tess-winding-positive+: Private constants
Constant, +tess-winding-rule+: Private constants
Constant, +triangle-fan+: Private constants
Constant, +triangle-strip+: Private constants
Constant, +triangles+: Private constants
Constant, +unknown+: Private constants
Constant, +vertex+: Private constants

S
Special Variable, *created-points*: Private special variables
Special Variable, *cur-triangle*: Private special variables
Special Variable, *cur-triangle-wind*: Private special variables
Special Variable, *cur-type*: Private special variables
Special Variable, *polygons*: Private special variables
Special Variable, *triangles*: Private special variables

Jump to:   *   +  
C   S