Bookshelf Contents Previous Next Glossary Index Search

AlTesselate

All the methods to tesselate geometry.

Synopsis

#include <AlTesselate.h>
class AlTesselate
static statusCode uniform(AlDagNode* &outdag, const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE, int = 2, int = 2);
static statusCode adaptive(AlDagNode* &outdag, const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE, int = 2, int = 4, double = 0.6, int = 2);
static statusCode number(AlDagNode* &outdag, const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE, int = 512, int = 32, double = 0.001);
static statusCode rendererSettings( AlDagNode* &outdag, const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE );
// OBSOLETE - do not use
static AlDagNode* uniform( const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE, int = 2, int = 2);
static AlDagNode* adaptive( const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE, int = 2, int = 4, double = 0.96);
static AlDagNode* number( const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE, int = 512, int = 32, double = 0.01);

Description

This is a static class in that all of its member functions are static. It provides the functionality to tesselate geometry.

The methods in this library will generate polysets from the geometry below the AlDagNode, composed of either triangles or quadrilaterals based on the type argument to the method (either kTESSELATE_TRIANGLE or kTESSELATE_QUADRILATERAL).

Note that when tesselating a trimmed surface, some triangles may be created along the trim edge even though quadrilateral tesselation was selected.

Summary

statusCode AlTesselate::uniform( AlDagNode* &outdag, const AlDagNode* dagNode, AlTesselateTypes type, int alongU, int alongV )

Description

Causes the geometry below the AlDagNode to be subdivided into polygons in a uniform manner. That is, each spline patch will be converted into a fixed number of polygons. This method should not be used on trimmed geometry as it will fail. Instead you should use the adaptive method below.

Arguments

> outdag - resulting dagnode structure

< dagNode - the AlDagNode above the geometry to tesselate

< type - kTESSELATE_TRIANGLE or kTESSELATE_QUADRILATERAL

< alongU - number of subdivisions in the U direction (minimum of 1)

< alongV - number of subdivisions in the V direction (minimum of 1)

Return Codes

sSuccess - tesselation succeeded

sInvalidArgument - an argument was NULL or alongU or alongV was less than 1

sFailure - tesselation failed

statusCode AlTesselate::adaptive( AlDagNode* &outdag, const AlDagNode* dagNode, AlTesselateTypes type, int min, int max, double threshold, int uniformUV )

Description

Causes geometry below the AlDagNode to be subdivided into polygons depending on the amount of curvature the surface has. Each spline patch will be converted into the minimum allowable number of polygons that satisfy the threshold parameter. If the threshold cannot be satisfied by subdividing within the maximum number of subdivisions then the maximum subdivisions value will be used. When converting facenodes, adaptive subdivision cannot be used. Uniform subdivision is used with a spacing of 'uniformUV'.

Arguments

> outdag - output dagnode

< dagNode - the AlDagNode above the geometry to tesselate

< type - kTESSELATE_TRIANGLE or kTESSELATE_QUADRILATERAL

< min - minimum number of times the surface will be subdivided to meet the threshold (minimum of 1 )

< max - maximum number of times the surface will be subdivided to meet the threshold (minimum of 1 )

< threshold - how close an approximation to the original surface the tesselation must be (between 0 and 1). Higher values give a better approximation.

< uniformUV - uniform value used when handing FaceNodes

Return Codes

sSuccess - tesselation succeeded

sInvalidArgument - an argument was NULL, or min or max was less than 1, or threshold was not in 0..1

sFailure - tesselation failed

statusCode AlTesselate::number( AlDagNode* &outdag, const AlDagNode* dagNode, AlTesselateTypes type, int total, int count_tol, double curve_tol)

Description

Repeatedly tesselates the surfaces with different adaptive subdivision parameters until settings are found that produce a total polygon count close to the requested number of polygons. If the requested polygon count cannot be satisfied within the given search tolerance this function will return with either the closest tesselation that it found below the requested total, or with the minimum number of polygons that it can possibly create. Unlike the interactive method there is no way to abandon this process prematurely.

Since the number of polygons that a spline surface may be tesselated into is not a continuous function; it may not be possible to achieve the desired number of polygons exactly. To prevent the search from continuing infinitely, there are tolerances that limit the tesselation. When a test tesselation finds parameter settings that give a polygon count that is between total - count_tol and total + count_tol, the search is stopped. Furthermore, since it may not be possible to find a tesselation that satisfies the requested total within the given count tolerance, this parameter allows the search to be ended when the changes the function makes to the adaptive subdivision curvature threshold parameter falls below curve_tol.

Arguments

> outdag - output DAG node structure

< dagNode - the AlDagNode above the geometry to tesselate

< type - kTESSELATE_TRIANGLE or kTESSELATE_QUADRILATERAL

< total - number of polygons to try for (minimum of 1 )

< count_tol - how close to the total is acceptable (minimum of 0)

< curve_tol - adaptive subdivision tolerance (between 0 and 1). Lower values give a better approximation.

Return Codes

sSuccess - tesselation succeeded

sInvalidArgument - NULL argument or total < 1, count_tol < 0, or curve_tol was not in 0..1

sFailure - tesselation failed

statusCode AlTesselate::rendererSettings( AlDagNode* &outdag, const AlDagNode* dagNode, AlTesselateTypes type )

Description

Causes the geometry below the AlDagNode to be subdivided into polygons according to the current AlRender parameters.

Arguments

> outdag - output DAG node structure

< dagNode - the AlDagNode above the geometry to tesselate

< type - kTESSELATE_TRIANGLE or kTESSELATE_QUADRILATERAL

Return Codes

sSuccess - tesselation succeeded

sInvalidArgument - an argument was NULL

sFailure - tesselation failed



Bookshelf Contents Previous Next Glossary Index Search

[email protected]
Copyright © 1998, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved.