The marching-cubes Reference Manual

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

The marching-cubes Reference Manual

This is the marching-cubes Reference Manual, version 1.0, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:17:04 2018 GMT+0.

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

Marching-Cubes

A marching cubes algorithm implementation in Common Lisp based on Paul Bourke's (http://paulbourke.net/geometry/polygonise/)

API

[Function] marching-cubes

``````MARCHING-CUBES density-function min-position max-position delta isolevel => triangles
``````

Extracts a surface from density field represented with `density-function` and returns `triangles` which is a list of triangles. `density-function` is a function that takes three arguments representing the position of a point and returns density as a scalar at the point. `min-position` and `max-position` are `vec3` values and specify the minimun point and the maximun point of a grid to be processed. `delta` is a scalar that specifies the size of a cell in a grid to be processed. `isolevel` is a scalar that specifies the threshold of mesh construction.

[Function] marching-cubes-smooth

``````MARCHING-CUBES-SMOOTH density-function normal-function min-position max-position delta isolevel => smooth-triangles
``````

Same as `marching-cubes` except that `marching-cubes-smooth` returns a list of smooth triangles which have normal vectors at each vertex. `normal-function` is a function that takes three arguments representing the position of a point and returns a normal vector at the point. Other arguments are same as `marching-cubes`'s.

Example

See example/ directory.

Author

• Masayuki Takagi (kamonama@gmail.com)

Copyright (c) 2012 Masayuki Takagi (kamonama@gmail.com)

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

Author

Masayuki Takagi

LLGPL

Description

A marching cubes algorithm implementation in Common Lisp based on Paul Bourke’s (http://paulbourke.net/geometry/polygonise/)

Long Description

# Marching-Cubes

A marching cubes algorithm implementation in Common Lisp based on Paul Bourke’s (http://paulbourke.net/geometry/polygonise/)

## API

### [Function] marching-cubes

MARCHING-CUBES density-function min-position max-position delta isolevel => triangles

Extracts a surface from density field represented with ‘density-function‘ and returns ‘triangles‘ which is a list of triangles. ‘density-function‘ is a function that takes three arguments representing the position of a point and returns density as a scalar at the point. ‘min-position‘ and ‘max-position‘ are ‘vec3‘ values and specify the minimun point and the maximun point of a grid to be processed. ‘delta‘ is a scalar that specifies the size of a cell in a grid to be processed. ‘isolevel‘ is a scalar that specifies the threshold of mesh construction.

### [Function] marching-cubes-smooth

MARCHING-CUBES-SMOOTH density-function normal-function min-position max-position delta isolevel => smooth-triangles

Same as ‘marching-cubes‘ except that ‘marching-cubes-smooth‘ returns a list of smooth triangles which have normal vectors at each vertex. ‘normal-function‘ is a function that takes three arguments representing the position of a point and returns a normal vector at the point. Other arguments are same as ‘marching-cubes‘’s.

## Example

See example/ directory.

## Author

* Masayuki Takagi (kamonama@gmail.com)

Copyright (c) 2012 Masayuki Takagi (kamonama@gmail.com)

Version

1.0

Source

marching-cubes.asd (file)

Component

src (module)

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

3 Modules

Modules are listed depth-first from the system components tree.

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

3.1 marching-cubes/src

Parent

marching-cubes (system)

Location

src/

Components

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

4 Files

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

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

4.1 Lisp

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

4.1.1 marching-cubes.asd

Location

marching-cubes.asd

Systems

marching-cubes (system)

Packages

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

Parent

src (module)

Location

src/package.lisp

Packages

4.1.3 marching-cubes/src/tables.lisp

Dependency

package.lisp (file)

Parent

src (module)

Location

src/tables.lisp

Internal Definitions

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

4.1.4 marching-cubes/src/marching-cubes.lisp

Dependency

tables.lisp (file)

Parent

src (module)

Location

src/marching-cubes.lisp

Exported Definitions
Internal Definitions

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

5 Packages

Packages are listed by definition order.

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

5.1 marching-cubes-asd

Source

marching-cubes.asd

Use List
• asdf/interface
• common-lisp

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

5.2 marching-cubes

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

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

6 Definitions

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

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

6.1 Exported definitions

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

6.1.1 Macros

Macro: smooth-triangle-normal TRI I
Package
Source

marching-cubes.lisp (file)

Macro: smooth-triangle-vertex TRI I
Package
Source

marching-cubes.lisp (file)

Macro: triangle-vertex TRI I
Package
Source

marching-cubes.lisp (file)

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

6.1.2 Functions

Function: make-smooth-triangle VERTEX-0 NORMAL-0 VERTEX-1 NORMAL-1 VERTEX-2 NORMAL-2
Package
Source

marching-cubes.lisp (file)

Function: make-triangle VERTEX-0 VERTEX-1 VERTEX-2
Package
Source

marching-cubes.lisp (file)

Function: make-vec3 X Y Z
Package
Source

marching-cubes.lisp (file)

Function: marching-cubes FN MIN MAX DELTA ISOLEVEL
Package
Source

marching-cubes.lisp (file)

Function: marching-cubes-smooth FN-VALUE FN-NORMAL MIN MAX DELTA ISOLEVEL
Package
Source

marching-cubes.lisp (file)

Function: normalize-vec3 V
Package
Source

marching-cubes.lisp (file)

Function: smooth-triangle= A B
Package
Source

marching-cubes.lisp (file)

Function: triangle= A B
Package
Source

marching-cubes.lisp (file)

Function: vec3-x INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: vec3-y INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: vec3-z INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: vec3= A B
Package
Source

marching-cubes.lisp (file)

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

6.2 Internal definitions

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

6.2.1 Special variables

Special Variable: *vertex-offsets*
Package
Source

marching-cubes.lisp (file)

Special Variable: +edge-table+
Package
Source

tables.lisp (file)

Special Variable: +tri-table+
Package
Source

tables.lisp (file)

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

6.2.2 Macros

Macro: grid-cell-value GRID I
Package
Source

marching-cubes.lisp (file)

Macro: grid-cell-vertex GRID I
Package
Source

marching-cubes.lisp (file)

Macro: inc-logior X VAL
Package
Source

marching-cubes.lisp (file)

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

6.2.3 Functions

Function: copy-grid INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: copy-grid-cell INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: copy-smooth-triangle INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: copy-triangle INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: copy-vec3 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: degenerate-triangle TRI
Package
Source

marching-cubes.lisp (file)

Function: grid-cell GRID I J K
Package
Source

marching-cubes.lisp (file)

Function: grid-cell-p OBJECT
Package
Source

marching-cubes.lisp (file)

Function: grid-cell-values GRID I J K
Package
Source

marching-cubes.lisp (file)

Function: grid-cell-values% INSTANCE
Function: (setf grid-cell-values%) VALUE INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: grid-cell-vertices GRID I J K
Package
Source

marching-cubes.lisp (file)

Function: grid-cell-vertices% INSTANCE
Function: (setf grid-cell-vertices%) VALUE INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: grid-delta INSTANCE
Function: (setf grid-delta) VALUE INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: grid-max INSTANCE
Function: (setf grid-max) VALUE INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: grid-min INSTANCE
Function: (setf grid-min) VALUE INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: grid-p OBJECT
Package
Source

marching-cubes.lisp (file)

Function: grid-point GRID I J K
Package
Source

marching-cubes.lisp (file)

Function: grid-size-x INSTANCE
Function: (setf grid-size-x) VALUE INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: grid-size-y INSTANCE
Function: (setf grid-size-y) VALUE INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: grid-size-z INSTANCE
Function: (setf grid-size-z) VALUE INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: grid-value GRID I J K
Package
Source

marching-cubes.lisp (file)

Function: grid-values% INSTANCE
Function: (setf grid-values%) VALUE INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: make-grid FN MIN MAX DELTA
Package
Source

marching-cubes.lisp (file)

Function: make-grid-cell VERTICES% VALUES%
Package
Source

marching-cubes.lisp (file)

Function: make-grid-values FN I J K ORIGIN DELTA
Package
Source

marching-cubes.lisp (file)

Function: make-raw-grid MIN MAX SIZE-X SIZE-Y SIZE-Z DELTA VALUES%
Package
Source

marching-cubes.lisp (file)

Function: polygonise GRID ISOLEVEL
Package
Source

marching-cubes.lisp (file)

Function: reduce-grid GRID FN
Package
Source

marching-cubes.lisp (file)

Function: remove-degenerate-triangles TRIS
Package
Source

marching-cubes.lisp (file)

Function: smooth-triangle-normal-0 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: smooth-triangle-normal-1 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: smooth-triangle-normal-2 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: smooth-triangle-p OBJECT
Package
Source

marching-cubes.lisp (file)

Function: smooth-triangle-vertex-0 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: smooth-triangle-vertex-1 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: smooth-triangle-vertex-2 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: to-smooth-triangle TRI FN
Package
Source

marching-cubes.lisp (file)

Function: triangle-p OBJECT
Package
Source

marching-cubes.lisp (file)

Function: triangle-vertex-0 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: triangle-vertex-1 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: triangle-vertex-2 INSTANCE
Package
Source

marching-cubes.lisp (file)

Function: vec3-p OBJECT
Package
Source

marching-cubes.lisp (file)

Function: vertex-interop ISOLEVEL P1 P2 VAL1 VAL2
Package
Source

marching-cubes.lisp (file)

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

6.2.4 Structures

Structure: grid ()
Package
Source

marching-cubes.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: min

grid-min (function)

Writers

(setf grid-min) (function)

Slot: max

grid-max (function)

Writers

(setf grid-max) (function)

Slot: size-x

grid-size-x (function)

Writers

(setf grid-size-x) (function)

Slot: size-y

grid-size-y (function)

Writers

(setf grid-size-y) (function)

Slot: size-z

grid-size-z (function)

Writers

(setf grid-size-z) (function)

Slot: delta

grid-delta (function)

Writers

(setf grid-delta) (function)

Slot: values%

grid-values% (function)

Writers

(setf grid-values%) (function)

Structure: grid-cell ()
Package
Source

marching-cubes.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: vertices%

grid-cell-vertices% (function)

Writers

(setf grid-cell-vertices%) (function)

Slot: values%

grid-cell-values% (function)

Writers

(setf grid-cell-values%) (function)

Structure: smooth-triangle ()
Package
Source

marching-cubes.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: vertex-0

smooth-triangle-vertex-0 (function)

Writers

(setf smooth-triangle-vertex-0) (function)

Slot: normal-0

smooth-triangle-normal-0 (function)

Writers

(setf smooth-triangle-normal-0) (function)

Slot: vertex-1

smooth-triangle-vertex-1 (function)

Writers

(setf smooth-triangle-vertex-1) (function)

Slot: normal-1

smooth-triangle-normal-1 (function)

Writers

(setf smooth-triangle-normal-1) (function)

Slot: vertex-2

smooth-triangle-vertex-2 (function)

Writers

(setf smooth-triangle-vertex-2) (function)

Slot: normal-2

smooth-triangle-normal-2 (function)

Writers

(setf smooth-triangle-normal-2) (function)

Structure: triangle ()
Package
Source

marching-cubes.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: vertex-0

triangle-vertex-0 (function)

Writers

(setf triangle-vertex-0) (function)

Slot: vertex-1

triangle-vertex-1 (function)

Writers

(setf triangle-vertex-1) (function)

Slot: vertex-2

triangle-vertex-2 (function)

Writers

(setf triangle-vertex-2) (function)

Structure: vec3 ()
Package
Source

marching-cubes.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: x
Initform

0

vec3-x (function)

Writers

(setf vec3-x) (function)

Slot: y
Initform

0

vec3-y (function)

Writers

(setf vec3-y) (function)

Slot: z
Initform

0

vec3-z (function)

Writers

(setf vec3-z) (function)

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

Appendix A Indexes

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

A.1 Concepts

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

A.2 Functions

Jump to: (   C   D   F   G   I   M   N   P   R   S   T   V
Jump to: (   C   D   F   G   I   M   N   P   R   S   T   V

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

A.3 Variables

Jump to: *   +   D   M   N   S   V   X   Y   Z
Jump to: *   +   D   M   N   S   V   X   Y   Z

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