chickadee » gts

gts

Bindings for GNU Triangulated Surface (GTS) library.

Usage

(require-extension gts)

Documentation

GTS is a library for constructing and manipulating triangulated surface meshes. The Chicken gts library provides bindings for the GTS API, as well as some additional convenience procedures.

File procedures

Glib procedures

Matrix procedures

matrix-new:procedure

Creates a new GTS 4x4 Matrix object and returns the pointer to it.

matrix-assign:procedure

Sets the contents of an existing GTS Matrix object.

matrix-destroy:procedure

Destroys a GTS Matrix object and frees the associated memory.

matrix-zero:procedure

Sets a GTS Matrix object to the zero matrix (if the given matrix is NULL a new one is allocated).

matrix-identity:procedure

Sets a GTS Matrix object to the identity matrix (if the given matrix is NULL a new one is allocated)

matrix-transpose:procedure

Transposes a GTS Matrix object and return the newly allocated matrix.

matrix-inverse:procedure

Inverts a GTS Matrix object and returns the newly allocated matrix or NULL if the matrix can't be inverted.

matrix-product:procedure

Calculates the product of two matrices and return the newly allocated matrix.

matrix-scale:procedure

Scales a GTS Matrix object in place.

matrix-translate:procedure

Translates the GTS Matrix object by the given SRFI-4 f64vector object (if the matrix is NULL a new one is allocated and translated).

matrix-rotate:procedure

Rotates the GTS Matrix object around the give SRFI-4 f64vector by the given angle (if the matrix is NULL a new one is allocated and rotated).

Point procedures

Triangle procedures

default-triangle-classprocedure

Default class descriptor for the GTS Triangle class (used by the triangle constructors below).

triangle-enclosing:procedure

Creates a GTS Triangle object that is guaranteed to enclose all the points in the list.

triangle-newprocedure

Creates a new GTS Triangle object from 3 edges.

triangle-setprocedure

Discards the existing edges of the given GTS Triangle object and replaces them with the new ones.

triangle-areaprocedure

Computes the area of the given triangle.

triangle-perimeterprocedure

Computes the perimeter of the given triangle.

triangle-qualityprocedure

Computes a measure of the quality of the given triangle (how close to equilateral it is).

triangle-normalprocedure

Computes the normal to the plane of the given triangle.

triangle-revertprocedure

Changes the orientation of the given triangle, turning it inside out.

triangle-orientationprocedure

Checks for the orientation of the plane (x,y) projection of the given triangle.

triangle-neighborsprocedure
triangle-vertices-edgesprocedure

Returns a pair of two vectors containing the vertices and edges of the given triangle, respectively. If the edge argument is not NULL, then it is identical to the first elements of the edges vector.

triangle-verticesprocedure

Returns a vector containing the vertices of the given triangle.

triangle-vertex-oppositeprocedure

Returns a vertex of the given triangle that does not belong to the given edge.

triangle-edge-oppositeprocedure

Returns the edge of the given triangle opposite to the given vertex.

triangle-is-okprocedure

Returns true if the given triangle is non-degenerate, non-duplicate triangle, false otherwise.

triangle-circumcircle-centerprocedure

Returns the center of the circumscribing circle of the given triangle.

triangle-interpolate-heightprocedure

Fills the z-coordinate of the given point belonging to the plane projection of the given triangle with the linearly interpolated value of the z-coordinates of the vertices of the triangle.

triangles-from-edgesprocedure

Returns a list of unique triangles which have one of their edges in the given list of edges.

Examples

(use gts)

(define s (cube))

(surface-rotate s dx: 1.0 dy: 1.0 dz: 1.0 angle: 45.0)

(let ((out (fopen "cube.gts" "w+")))

  (surface-write s out))

About this egg

Author

Ivan Raikov

Version history

1.4
Using pkg-config or gts-config to determine compilation flags
1.2
Additional flags for the surface intersection operation
1.0
Initial release

License

Copyright 2011-2012 Ivan Raikov and the Okinawa Institute of Science and Technology

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

A full copy of the GPL license can be found at
<http://www.gnu.org/licenses/>.

Contents »