class MTesselationParams

Jump to documentation

Tesselation parameters. (OpenMaya) (OpenMaya.py)

public members:

enum TessFormat
Tesselation format
kTriangleCountFormat
kStandardFitFormat
kGeneralFormat
enum PolyType
Output Types
kTriangles
kQuads
enum IsoparmType
IsoparmType
kSurface3DDistance
kSurface3DEquiSpaced
kSurfaceEquiSpaced
kSpanEquiSpaced
enum SubdivisionType
Subdivision flags
kUseFractionalTolerance
kUseChordHeightRatio
kUseMinEdgeLength
kUseMaxEdgeLength
kUseMaxNumberPolys
kUseMaxSubdivisionLevel
kUseMinScreenSize
kUseMaxUVRectangleSize
kUseTriangleEdgeSwapping
kUseRelativeTolerance
kUseEdgeSmooth
kLastFlag
MTesselationParams ( TessFormat format = kStandardFitFormat , PolyType = kTriangles )
~MTesselationParams ()
void setFormatType ( TessFormat type )
void setOutputType ( PolyType type )
void setTriangleCount ( int )
void setStdChordHeightRatio ( double )
void setStdFractionalTolerance ( double )
void setStdMinEdgeLength ( double )
void setSubdivisionFlag ( SubdivisionType type, bool use )
void setFitTolerance ( double )
void setChordHeightRatio ( double )
void setMinEdgeLength ( double )
void setMaxEdgeLength ( double )
void setMaxNumberPolys ( int )
void setMaxSubdivisionLevel ( double )
void setMinScreenSize ( double, double )
void setWorldspaceToScreenTransform ( MMatrix & )
void setMaxUVRectangleSize ( double, double )
void setRelativeFitTolerance ( double )
void setEdgeSmoothFactor ( double )
void set3DDelta ( double )
void setUIsoparmType ( IsoparmType type )
void setVIsoparmType ( IsoparmType type )
void setUNumber ( int count )
void setVNumber ( int count )
void setBoundingBoxDiagonal ( double distance )
void setUDistanceFraction ( double value )
void setVDistanceFraction ( double value )
MTesselationParams &operator= ( const MTesselationParams &rhs)
static MTesselationParams fsDefaultTesselationParams

Documentation

Description

This class provides control over the tesselation operation. This class is meant to be used in conjunction with the tesselate method of MFnNurbsSurface.

The tesselation operation works by building an initial mesh and then refining that mesh until certain subdivision criteria are met. This class provides control over both the method of construction of the initial mesh and also the criteria for subsequent refinement. The initial tesselation is specified by the polygon output type, and the isoparm type. The secondary tesselation (or subdivision) is specified by the tesselation format.

Output types
The output type can be specified as either kTriangles or kQuads. If triangles are specified then all the polygons in the initial mesh will be triangles. If quads are specified then whenever possible the polygons will be quads.

Isoparm type
The isoparm type specifies how the initial mesh is to be built.

Tesselation format
The subdivision criteria for refinement of the initial mesh is specified as one of three formats;

Subdivision flags
If the tesselation format is general then you can choose which criteria you would like to use in the tesselation. For each criterion, there is an "use" flag (in other words, is this used?) together with the data for the criterion.

Functions

MTesselationParams MTesselationParams:: fsDefaultTesselationParams

MTesselationParams:: MTesselationParams ( MTesselationParams::TessFormat format, MTesselationParams::PolyType outputType )

Description

Constructor. Creates a tesselation parameter object.

The default values for an MTesselationParam object are as follows:

  • tesselation format kStandardFit
  • output type kTriangles
  • Standard Fit defaults
    • StdChordHeightRatio = 0.1
    • StdFractionalTolerance = 0.01
    • StdMinEdgeLength = 0.001
    • Std3DDelta = 0.1
  • U,V isoparm based parameters
    • UIsoParmType = kSurface3DDistance;
    • VIsoParmType = kSurface3DDistance;
    • UNumber = 4.0;
    • VNumber = 4.0;
    • fUDistanceFraction = 0.1;
    • fVDistanceFraction = 0.1;

Arguments

  • format The type of tesselation to be performed
  • outputType Specifies whether polygons will all be triangles

MTesselationParams:: MTesselationParams ( const MTesselationParams &params )

Description

Copy Constructor.

Arguments

MTesselationParams:: ~MTesselationParams ()

Description

Destructor.

void MTesselationParams:: setFormatType ( MTesselationParams::TessFormat format )

Description

Sets the tesselation format. The tesselation format is used in the secondary tesselation stage to specify the subdivision criteria used in refining the initial mesh.

Arguments

  • format the subdivision format. See the class description for list of format types and descriptions.

void MTesselationParams:: setOutputType ( MTesselationParams::PolyType outputType )

Description

Specifies the type of polygons in the tesselated object.

The output type can be specified as either triangles or quads. If triangles are specified then all the polygons in the tesselated object will be triangles. If quads are specified then whenever possible the polygons will be quads.

Arguments

  • outputType the type of polygon in the tesselated object

void MTesselationParams:: setTriangleCount ( int count )

Description

Sets the approximate number of triangles for the tesselated object when the format is kTriangleCountFormat.

Arguments

  • count The approximate number of triangular polygons in the tesselated object

void MTesselationParams:: setStdChordHeightRatio ( double value )

Description

Sets the chord height ratio which is used when the tesselation format is kStandardFitFormat.

Arguments

  • value the chord height ration value to be set

void MTesselationParams:: setStdFractionalTolerance ( double value )

Description

Sets the fractional tolerance which is used when the tesselation format is kStandardFitFormat.

The fractional tolerance is the fraction of box diagonal to be used as absolute 3-d fit tolerance. Suggested value: 0.01

Arguments

  • value the fractional tolerance value to be set

void MTesselationParams:: setStdMinEdgeLength ( double value )

Description

Sets the minimum edge length which is used when the tesselation format is kStandardFitFormat.

min_edge_fraction Fraction of box diagonal to be used as minimum 3-d edge length. Suggested value: 0.0001

Arguments

  • value the minimum edge length to be set

void MTesselationParams:: setSubdivisionFlag ( MTesselationParams::SubdivisionType subType, bool use )

Description

Sets the types of subdivision used when the tesselation format is general. This method allows you to set the types of subdivision to be performed after the initial mesh is created. The use flag specifies whether to use the given subdivision type in the secondary tesselation.

Arguments

  • subType the subdivision type to be specified
  • use specifies whether to use subType subdivision

void MTesselationParams:: setFitTolerance ( double value )

Description

Sets the absolute fit tolerance. This value is used when the subdivision criteria kUseFractionalTolerance has been set.

NOTE: The maya renderer uses this subdivision criteria for chord height.

Arguments

  • value the new absolute fit tolerance value to be set

void MTesselationParams:: setChordHeightRatio ( double value )

Description

Sets the chord height ratio. This value is used when the subdivision criteria kUseChordHeightRatio has been set.

NOTE: The maya renderer uses relative fit tolerance for the chord height ration subdivision criteria.

Arguments

  • value the new chord height ratio value to be set

void MTesselationParams:: setMinEdgeLength ( double value )

Description

Sets the minimum edge length. This value is used when the subdivision criteria kUseMinEdgeLength has been set.

Arguments

  • value the new minimum edge length value to be set

void MTesselationParams:: setMaxEdgeLength ( double value )

Description

Sets the maximum edge length. This value is used when the subdivision criteria kUseMaxEdgeLength has been set.

Arguments

  • value the new maximum edge length value to be set

void MTesselationParams:: setMaxNumberPolys ( int value )

Description

Sets the maximum number of polygons. This value is used when the subdivision criteria kUseMaxNumberPolys has been set.

Arguments

  • value the new maximum number of polygons value to be set

void MTesselationParams:: setMaxSubdivisionLevel ( double value )

Description

Sets the maximum subdivision level. This value is used when the subdivision criteria kUseMaxSubdivisionLevel has been set.

Arguments

  • value the new maximum subdivision level value to be set

void MTesselationParams:: setMinScreenSize ( double x, double y )

Description

If polygons are smaller than the specified screen size then the subdivision will not proceed. These values are used when the subdivision criteria kUseMinScreenSize has been set.

Arguments

  • x the width value to compare against
  • y the height value to compare against

void MTesselationParams:: setWorldspaceToScreenTransform ( MMatrix & value )

Description

The transformation matrix used in the minimum screen size test for subdivision. This value is used when the subdivision criteria kUseMinScreenSize has been set.

Arguments

  • value The world-space transformation matrix

void MTesselationParams:: setMaxUVRectangleSize ( double u, double v )

Description

Sets the maximum polygon size in uv-space for secondary tesselation. Polygons will be greater than the specified size.

Arguments

  • u horizontal screen space size
  • v vertical screen space size

void MTesselationParams:: setRelativeFitTolerance ( double value )

Description

Sets the relative fit tolerance. This value is used when the subdivision criteria kUseRelativeTolerance has been set.

NOTE: The maya renderer uses this subdivision criteria for chord height ratio. To match the value that the render tesselator uses, use 1.0 - value.

Arguments

  • value the new relative fit tolerance value to be set

void MTesselationParams:: setEdgeSmoothFactor ( double smoothness )

Description

Sets the edge smoothness factor used for the Edge Smooth secondary tesselation criteria.

The value should be 0 (not smooth) to 1 (very smooth).

NOTE: the maya renderer uses a value of 0.95 as the edge smoothness factor.

Arguments

  • smoothness a factor from 0(not smooth) to 1(very smooth) indicating nurbs-edge smoothness

void MTesselationParams:: set3DDelta ( double delta )
Description

Sets the fraction of the box diagonal to be used as 3-d spacing for u- and v-isoparams on face/surface to make up the initial grid for the mesh. This is used when the tesselation format is kStandardFitFormat.

NOTE: the maya renderer uses a default value of 0.1 for this value.

Arguments

  • delta the fractional spacing factor, a value between 0 and 1

void MTesselationParams:: setUIsoparmType ( IsoparmType uValue )

Description

Sets the u-isoparm type to be used in the initial tesselation.

Arguments

  • uValue the u-isoparm type

void MTesselationParams:: setVIsoparmType ( IsoparmType vValue )

Description

Sets the v-isoparm type to be used in the initial tesselation.

Arguments

  • vValue the v-isoparm type

void MTesselationParams:: setUNumber ( int count )

Description

This is the number of u isoparms used in the initial tesselation. This value is only used for kSurface3DEquiSpaced, kSurfaceEquiSpaced, and kSpanEquiSpaced isoparm types.

Note that in the resultant tessellation, any duplicate vertices and edges (eg at periodic boundaries) will be replaced with shared common vertices and edges.

Arguments

  • count the number of u isoparms

void MTesselationParams:: setVNumber ( int count )

Description

This is the number of v isoparms used in the initial tesselation. This value is only used for kSurface3DEquiSpaced, kSurfaceEquiSpaced, and kSpanEquiSpaced isoparm types.

Note that in the resultant tessellation, any duplicate vertices and edges (eg at periodic boundaries) will be replaced with shared common vertices and edges.

Arguments

  • count the number of v isoparms

void MTesselationParams:: setBoundingBoxDiagonal ( double distance )

Description

Sets the diagonal distance of the bounding box of the surface.

Arguments

  • distance the diagonal bounding box distance

void MTesselationParams:: setUDistanceFraction ( double value )

Description

Sets the fraction of the 3D surface bounding box diagonal for the kSurface3DDistance isoparm type. The value is 0.0 for other types.

Arguments

  • value the bounding box distance fraction to set

void MTesselationParams:: setVDistanceFraction ( double value )

Description

Sets the fraction of the 3D surface bounding box diagonal for the kSurface3DDistance isoparm type. The value is 0.0 for other types.

Arguments

  • value the bounding box distance fraction to set

MTesselationParams & MTesselationParams:: operator= ( const MTesselationParams &rhs )
Description

Assignment operator.

Arguments

  • other the tesselation parameter to copy

Return Value

  • A reference to the copied tesselation parameter.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright