AlTesselate
 
 
 

Methods to tesselate geometry.

Synopsis

#include <AlTesselate.h>
class AlTesselate
	static statusCode uniform( AlDagNode* &, const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE, int = 2, int = 2);
	static statusCode adaptive(AlDagNode* &, const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE, int = 2, int = 4, double = 0.6, int = 2);
	static statusCode number(AlDagNode* &, const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE, int = 512, int = 32, double = 0.001);
	static statusCode rendererSettings( AlDagNode* &, const AlDagNode*, AlTesselateTypes = kTESSELATE_TRIANGLE );
	static statusCode chordHeightDeviation( AlDagNode * &, const AlDagNode*, double tolerance = .01 );
	static statusCode chordHeightDeviationFast( AlDagNode * &, const AlDagNode*, double tolerance = .01 );
	static statusCode chordHeightDeviationAccurate( AlDagNode * &, const AlDagNode*, double tolerance = .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 or meshes from the geometry directly below the AlDagNode. Meshes are composed entirely out of triangles. Polysets can be 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.

NoteThe first five methods generate polysets and are now deprecated. We recommend using only the last two methods which produce mesh objects, the only polygonal object type now recognized by Alias.

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

Description

This method 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 - The resulting dagnode for a polyset.

< dagNode - The AlDagNode above the geometry to tesselate.

< type - kTESSELATE_TRIANGLE or kTESSELATE_QUADRILATERAL.

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

< alongV - The 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

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

Arguments

>> outdag - The resulting dagnode for a polyset.

< dagNode - The AlDagNode above the geometry to tesselate.

< type - kTESSELATE_TRIANGLE or kTESSELATE_QUADRILATERAL.

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

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

< threshold - The accuracy of the approximation (between 0 and 1). Higer values give a better approximations.

< 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

This method repeatedly tesselates the surfaces with different adaptive subdivision parameters until settings are found that produce a total polygon count close to the requested number. If the requested polygon count cannot be satisfied within the given search tolerance, this function will return either the closest tesselation found that is below the requested total or 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. Further 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 - The resulting dagnode for a polyset.

< dagNode - The AlDagNode above the geometry to tesselate.

< type - kTESSELATE_TRIANGLE or kTESSELATE_QUADRILATERAL.

< total - The number of polygons desired (minimum of 1 ).

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

< curve_tol - The 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

This method causes the geometry below the AlDagNode to be subdivided into polygons in according to the current AlRender parameters.

Arguments

>> outdag - The resulting dagnode for a polyset.

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

statusCode AlTesselate::chordHeightDeviation( AlDagNode* &outdag, const AlDagNode* dagNode, double tolerance )

Description

This method tessellates a dag using a chord height deviation tolerance. The chord height deviation specifies the maximum distance that a triangle will be away from the surface boundary that it will be representing.

Arguments

>> outdag - The resulting dagnode for a polyset.

< dagNode - The dag node to triangulate.

< tolerance - Chord height deviation.

Return Codes

sSuccess - Tesselation succeeded.

sInvalidArgument - An argument was NULL or 'dagNode' is an invalid wrapper.

sFailure - Tesselation failed.

statusCode AlTesselate::chordHeightDeviationFast( AlDagNode* &outdag, const AlDagNode* dagNode, double tolerance )

Description

This method tessellates a dag node using a chord height deviation tolerance and the fast tessellator. The chord height deviation specifies the maximum distance that a triangle will be away from the surface boundary that it will be representing.

Arguments

>> outdag - The resulting dagnode for a mesh.

< dagNode - The dag node to triangulate.

< tolerance - Chord height deviation.

Return Codes

sSuccess - Tesselation succeeded.

sInvalidArgument - An argument was NULL or 'dagNode' is an invalid wrapper.

sFailure - Tesselation failed.

statusCode AlTesselate::chordHeightDeviationAccurate( AlDagNode* &outdag, const AlDagNode* dagNode, double tolerance )

Description

This method tessellates a dag node using a chord height deviation tolerance and the accurate tesselator. The chord height deviation specifies the maximum distance that a triangle will be away from the surface boundary that it will be representing.

Arguments

>> outdag - The resulting dagnode for a mesh.

< dagNode - The dag node to triangulate.

< tolerance - Chord height deviation.

Return Codes

sSuccess - Tesselation succeeded.

sInvalidArgument - An argument was NULL or 'dagNode' is an invalid wrapper.

sFailure - Tesselation failed.