The glu-tessellate Reference Manual

Table of Contents

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 2.3 "Robert April" on Tue Feb 20 08:45:22 2018 GMT+0.


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

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.


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

Author

Andrew Lyon <orthecreedence@gmail.com>

License

MIT

Description

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

Version

0.1.0

Dependency

cffi

Source

glu-tessellate.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 glu-tessellate.asd

Location

glu-tessellate.asd

Systems

glu-tessellate (system)


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

3.1.2 glu-tessellate/package.lisp

Parent

glu-tessellate (system)

Location

package.lisp

Packages

glu-tessellate


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

3.1.3 glu-tessellate/tessellate.lisp

Dependency

package.lisp (file)

Parent

glu-tessellate (system)

Location

tessellate.lisp

Exported Definitions

tessellate (function)

Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 glu-tessellate

Source

package.lisp (file)

Nickname

tess

Use List
Exported Definitions

tessellate (function)

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


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

5.1.1 Functions

Function: tessellate POINTS &key HOLES WINDING-RULE CW

Tessellate a polygon into triangles.

Package

glu-tessellate

Source

tessellate.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Constants

Constant: +begin+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +ccw+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +cw+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +edge-flag+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +end+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +exterior+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +interior+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +line-loop+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +line-strip+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +lines+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +points+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +polygon+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +quad-strip+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +quads+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-begin+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-begin-data+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-boundary-only+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-combine+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-combine-data+
Package

glu-tessellate

Source

tessellate.lisp (file)

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

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-edge-flag+
Package

glu-tessellate

Source

tessellate.lisp (file)

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

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-end+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-end-data+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error-1+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error-2+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error-3+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error-4+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error-5+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error-6+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error-7+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error-8+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-error-data+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-max-coord+
Package

glu-tessellate

Source

tessellate.lisp (file)

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

glu-tessellate

Source

tessellate.lisp (file)

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

glu-tessellate

Source

tessellate.lisp (file)

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

glu-tessellate

Source

tessellate.lisp (file)

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

glu-tessellate

Source

tessellate.lisp (file)

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

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-tolerance+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-vertex+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-vertex-data+
Package

glu-tessellate

Source

tessellate.lisp (file)

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

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-winding-negative+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-winding-nonzero+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-winding-odd+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-winding-positive+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +tess-winding-rule+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +triangle-fan+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +triangle-strip+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +triangles+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +unknown+
Package

glu-tessellate

Source

tessellate.lisp (file)

Constant: +vertex+
Package

glu-tessellate

Source

tessellate.lisp (file)


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

5.2.2 Special variables

Special Variable: *created-points*
Package

glu-tessellate

Source

tessellate.lisp (file)

Special Variable: *cur-triangle*
Package

glu-tessellate

Source

tessellate.lisp (file)

Special Variable: *cur-triangle-wind*
Package

glu-tessellate

Source

tessellate.lisp (file)

Special Variable: *cur-type*
Package

glu-tessellate

Source

tessellate.lisp (file)

Special Variable: *polygons*
Package

glu-tessellate

Source

tessellate.lisp (file)

Special Variable: *triangles*
Package

glu-tessellate

Source

tessellate.lisp (file)


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

5.2.3 Macros

Macro: def-c-callback NAME &rest ARGS
Package

glu-tessellate

Source

tessellate.lisp (file)


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

5.2.4 Functions

Function: begin-polygon TESS
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: delete-tess TESS
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: do-tess-begin TYPE

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

Package

glu-tessellate

Source

tessellate.lisp (file)

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

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

Function: do-tess-error ERR

Error!!!!

Package

glu-tessellate

Source

tessellate.lisp (file)

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

Function: end-polygon TESS
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: error-string CODE
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: get-tess-property TESS WHICH DATA
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: get-winding-rule WIND-KEYWORD

Get the global winding rule for the keyword passed in.

Package

glu-tessellate

Source

tessellate.lisp (file)

Function: new-tess ()
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: next-contour TESS TYPE
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: polygon-clockwise-p POLYGON-POINTS

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

Package

glu-tessellate

Source

tessellate.lisp (file)

Function: tess-begin-contour TESS
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: tess-begin-polygon TESS DATA
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: tess-callback TESS WHICH CALLBACKFUNC
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: tess-end-contour TESS
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: tess-end-polygon TESS
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: tess-normal TESS VALUEX VALUEY VALUEZ
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: tess-property TESS WHICH VALUE
Package

glu-tessellate

Source

tessellate.lisp (file)

Function: tess-vertex TESS LOCATION DATA
Package

glu-tessellate

Source

tessellate.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   G   L  
Index Entry  Section

F
File, Lisp, glu-tessellate.asd: The glu-tessellate<dot>asd file
File, Lisp, glu-tessellate/package.lisp: The glu-tessellate/package<dot>lisp file
File, Lisp, glu-tessellate/tessellate.lisp: The glu-tessellate/tessellate<dot>lisp file

G
glu-tessellate.asd: The glu-tessellate<dot>asd file
glu-tessellate/package.lisp: The glu-tessellate/package<dot>lisp file
glu-tessellate/tessellate.lisp: The glu-tessellate/tessellate<dot>lisp file

L
Lisp File, glu-tessellate.asd: The glu-tessellate<dot>asd file
Lisp File, glu-tessellate/package.lisp: The glu-tessellate/package<dot>lisp file
Lisp File, glu-tessellate/tessellate.lisp: The glu-tessellate/tessellate<dot>lisp file

Jump to:   F   G   L  

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: Internal functions

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

E
end-polygon: Internal functions
error-string: Internal functions

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

G
get-tess-property: Internal functions
get-winding-rule: Internal functions

M
Macro, def-c-callback: Internal macros

N
new-tess: Internal functions
next-contour: Internal functions

P
polygon-clockwise-p: Internal functions

T
tess-begin-contour: Internal functions
tess-begin-polygon: Internal functions
tess-callback: Internal functions
tess-end-contour: Internal functions
tess-end-polygon: Internal functions
tess-normal: Internal functions
tess-property: Internal functions
tess-vertex: Internal functions
tessellate: Exported 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*: Internal special variables
*cur-triangle*: Internal special variables
*cur-triangle-wind*: Internal special variables
*cur-type*: Internal special variables
*polygons*: Internal special variables
*triangles*: Internal special variables

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

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

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

Jump to:   *   +  
C   S  

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

A.4 Data types

Jump to:   G   P   S  
Index Entry  Section

G
glu-tessellate: The glu-tessellate system
glu-tessellate: The glu-tessellate package

P
Package, glu-tessellate: The glu-tessellate package

S
System, glu-tessellate: The glu-tessellate system

Jump to:   G   P   S