## gts

Bindings for GNU Triangulated Surface (GTS) library.

## TOC »

## 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:`procedureCreates a new GTS 4x4 Matrix object and returns the pointer to it.

`matrix-assign:`procedureSets the contents of an existing GTS Matrix object.

`matrix-destroy:`procedureDestroys a GTS Matrix object and frees the associated memory.

`matrix-zero:`procedureSets a GTS Matrix object to the zero matrix (if the given matrix is NULL a new one is allocated).

`matrix-identity:`procedureSets a GTS Matrix object to the identity matrix (if the given matrix is NULL a new one is allocated)

`matrix-transpose:`procedureTransposes a GTS Matrix object and return the newly allocated matrix.

`matrix-inverse:`procedureInverts a GTS Matrix object and returns the newly allocated matrix or NULL if the matrix can't be inverted.

`matrix-product:`procedureCalculates the product of two matrices and return the newly allocated matrix.

`matrix-scale:`procedureScales a GTS Matrix object in place.

`matrix-translate:`procedureTranslates 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:`procedureRotates 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-class`procedureDefault class descriptor for the GTS Triangle class (used by the triangle constructors below).

`triangle-enclosing:`procedureCreates a GTS Triangle object that is guaranteed to enclose all the points in the list.

`triangle-new`procedureCreates a new GTS Triangle object from 3 edges.

`triangle-set`procedureDiscards the existing edges of the given GTS Triangle object and replaces them with the new ones.

`triangle-area`procedureComputes the area of the given triangle.

`triangle-perimeter`procedureComputes the perimeter of the given triangle.

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

`triangle-normal`procedureComputes the normal to the plane of the given triangle.

`triangle-revert`procedureChanges the orientation of the given triangle, turning it inside out.

`triangle-orientation`procedureChecks for the orientation of the plane (x,y) projection of the given triangle.

`triangle-neighbors`procedure

`triangle-vertices-edges`procedureReturns 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-vertices`procedureReturns a vector containing the vertices of the given triangle.

`triangle-vertex-opposite`procedureReturns a vertex of the given triangle that does not belong to the given edge.

`triangle-edge-opposite`procedureReturns the edge of the given triangle opposite to the given vertex.

`triangle-is-ok`procedureReturns true if the given triangle is non-degenerate, non-duplicate triangle, false otherwise.

`triangle-circumcircle-center`procedureReturns the center of the circumscribing circle of the given triangle.

`triangle-interpolate-height`procedureFills 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-edges`procedureReturns 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

### 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/>.