- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Friends

# MTesselationParams Class Reference

# OpenMaya - API module for common classes

Search for all occurrences

## Detailed Description

Tesselation parameters.

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.

- kSurface3DDistance A set of isoparams over entire surface, a specified 3d-distance "udist" apart
- kSurface3DEquiSpaced A set of "unum" isoparams over entire surface, equally spaced in 3d
- kSurfaceEquiSpaced A set of "unum" isoparams over entire surface, equally spaced in u
- kSpanEquiSpaced A set of "unum" isoparams per surface u-span, equally spaced in u

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

- kTriangleCountFormat the specified triangle count is used as a rough estimate of the triangles produced in the tesselation.
- kGeneralFormat specify which subdivisions types are to be used in the tesselation. For each subdivision type the corresponding parameters must be set.
- kStandardFitFormat Tessellate surface with standard fit ratios. The parameters for this type of refinement are StdChordHeightRatio, StdFractionalTolerance, StdMinEdgeLength, and Std3DDelta.

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.

`#include <MTesselationParams.h>`

List of all members.

## Public Types
enum | TessFormat { kTriangleCountFormat, kStandardFitFormat, kGeneralFormat }
| Tesselation formats. More...
enum | PolyType { kTriangles, kQuads }
| Types of polygons to use in the result. More...
enum | IsoparmType { kSurface3DDistance, kSurface3DEquiSpaced, kSurfaceEquiSpaced, kSpanEquiSpaced }
| Isoparm types. More...
enum | SubdivisionType { kUseFractionalTolerance, kUseChordHeightRatio, kUseMinEdgeLength, kUseMaxEdgeLength, kUseMaxNumberPolys, kUseMaxSubdivisionLevel, kUseMinScreenSize, kUseMaxUVRectangleSize, kUseTriangleEdgeSwapping, kUseRelativeTolerance, kUseEdgeSmooth, kLastFlag }
| Subdivision flags. More...
## Public Member Functions
| MTesselationParams (TessFormat format=kStandardFitFormat, PolyType=kTriangles)
| Constructor.
| MTesselationParams (const MTesselationParams &)
| Copy Constructor.
| ~MTesselationParams ()
| Destructor.
void | setFormatType (TessFormat type)
| Sets the tesselation format.
void | setOutputType (PolyType type)
| Specifies the type of polygons in the tesselated object.
void | setTriangleCount (int)
| Sets the approximate number of triangles for the tesselated object when the format is kTriangleCountFormat.
void | setStdChordHeightRatio (double)
| Sets the chord height ratio which is used when the tesselation format is kStandardFitFormat.
void | setStdFractionalTolerance (double)
| Sets the fractional tolerance which is used when the tesselation format is kStandardFitFormat.
void | setStdMinEdgeLength (double)
| Sets the minimum edge length which is used when the tesselation format is kStandardFitFormat.
void | setSubdivisionFlag (SubdivisionType type, bool use)
| Sets the types of subdivision used when the tesselation format is general.
void | setFitTolerance (double)
| Sets the absolute fit tolerance.
void | setChordHeightRatio (double)
| Sets the chord height ratio.
void | setMinEdgeLength (double)
| Sets the minimum edge length.
void | setMaxEdgeLength (double)
| Sets the maximum edge length.
void | setMaxNumberPolys (int)
| Sets the maximum number of polygons.
void | setMaxSubdivisionLevel (double)
| Sets the maximum subdivision level.
void | setMinScreenSize (double, double)
| If polygons are smaller than the specified screen size then the subdivision will not proceed.
void | setWorldspaceToScreenTransform (MMatrix &)
| The transformation matrix used in the minimum screen size test for subdivision.
void | setMaxUVRectangleSize (double, double)
| Sets the maximum polygon size in uv-space for secondary tesselation.
void | setRelativeFitTolerance (double)
| Sets the relative fit tolerance.
void | setEdgeSmoothFactor (double)
| Sets the edge smoothness factor used for the Edge Smooth secondary tesselation criteria.
void | set3DDelta (double)
| 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.
void | setUIsoparmType (IsoparmType type)
| Sets the u-isoparm type to be used in the initial tesselation.
void | setVIsoparmType (IsoparmType type)
| Sets the v-isoparm type to be used in the initial tesselation.
void | setUNumber (int count)
| This is the number of u isoparms used in the initial tesselation.
void | setVNumber (int count)
| This is the number of v isoparms used in the initial tesselation.
void | setBoundingBoxDiagonal (double distance)
| Sets the diagonal distance of the bounding box of the surface.
void | setUDistanceFraction (double value)
| Sets the fraction of the 3D surface bounding box diagonal for the kSurface3DDistance isoparm type.
void | setVDistanceFraction (double value)
| Sets the fraction of the 3D surface bounding box diagonal for the kSurface3DDistance isoparm type.
MTesselationParams & | operator= (const MTesselationParams &rhs)
| Assignment operator.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.
## Friends
class | MFnNurbsSurface Search for all occurrences

## Member Enumeration Documentation

enum TessFormat

Search for all occurrences

Tesselation formats.

Enumerator:

  kTriangleCountFormat | Search for all occurrences
  kStandardFitFormat | Search for all occurrences
  kGeneralFormat | Search for all occurrences

enum PolyType

Search for all occurrences

Types of polygons to use in the result.

Enumerator:

  kTriangles | Search for all occurrences
  kQuads | Search for all occurrences

enum IsoparmType

Search for all occurrences

Isoparm types.

Enumerator:

  kSurface3DDistance | Search for all occurrences
  kSurface3DEquiSpaced | Search for all occurrences
  kSurfaceEquiSpaced | Search for all occurrences
  kSpanEquiSpaced | Search for all occurrences

enum SubdivisionType

Search for all occurrences

Subdivision flags.

Enumerator:

  kUseFractionalTolerance | Search for all occurrences
  kUseChordHeightRatio | Search for all occurrences
  kUseMinEdgeLength | Search for all occurrences
  kUseMaxEdgeLength | Search for all occurrences
  kUseMaxNumberPolys | Search for all occurrences
  kUseMaxSubdivisionLevel | Search for all occurrences
  kUseMinScreenSize | Search for all occurrences
  kUseMaxUVRectangleSize | Search for all occurrences
  kUseTriangleEdgeSwapping | Search for all occurrences
  kUseRelativeTolerance | Search for all occurrences
  kUseEdgeSmooth | Search for all occurrences
  kLastFlag | Search for all occurrences

## Constructor & Destructor Documentation

MTesselationParams | ( | MTesselationParams::TessFormat | format = `kStandardFitFormat`,
|  | MTesselationParams::PolyType | outputType = `kTriangles`
| ) |  |

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;

Parameters:

  [in] | format | The type of tesselation to be performed
  [in] | outputType | Specifies whether polygons will all be triangles

## Member Function Documentation

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

Search for all occurrences

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.

Parameters:

  [in] | format | the subdivision format. See the class description for list of format types and descriptions.

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

Search for all occurrences

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.

Parameters:

  [in] | outputType | the type of polygon in the tesselated object

void setTriangleCount | ( | int | count | ) |

Search for all occurrences

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

Parameters:

  [in] | count | The approximate number of triangular polygons in the tesselated object

void setStdChordHeightRatio | ( | double | value | ) |

Search for all occurrences

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

Parameters:

  [in] | value | the chord height ration value to be set

void setStdFractionalTolerance | ( | double | value | ) |

Search for all occurrences

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

Parameters:

  [in] | value | the fractional tolerance value to be set

void setStdMinEdgeLength | ( | double | value | ) |

Search for all occurrences

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

Parameters:

  [in] | value | the minimum edge length to be set

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

Search for all occurrences

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.

Parameters:

  [in] | subType | the subdivision type to be specified
  [in] | use | specifies whether to use subType subdivision

void setFitTolerance | ( | double | value | ) |

Search for all occurrences

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.

Parameters:

  [in] | value | the new absolute fit tolerance value to be set

void setChordHeightRatio | ( | double | value | ) |

Search for all occurrences

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.

Parameters:

  [in] | value | the new chord height ratio value to be set

void setMinEdgeLength | ( | double | value | ) |

Search for all occurrences

Sets the minimum edge length.

This value is used when the subdivision criteria kUseMinEdgeLength has been set.

Parameters:

  [in] | value | the new minimum edge length value to be set

void setMaxEdgeLength | ( | double | value | ) |

Search for all occurrences

Sets the maximum edge length.

This value is used when the subdivision criteria kUseMaxEdgeLength has been set.

Parameters:

  [in] | value | the new maximum edge length value to be set

void setMaxNumberPolys | ( | int | value | ) |

Search for all occurrences

Sets the maximum number of polygons.

This value is used when the subdivision criteria kUseMaxNumberPolys has been set.

Parameters:

  [in] | value | the new maximum number of polygons value to be set

void setMaxSubdivisionLevel | ( | double | value | ) |

Search for all occurrences

Sets the maximum subdivision level.

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

Parameters:

  [in] | value | the new maximum subdivision level value to be set

void setMinScreenSize | ( | double | x,
|  | double | y
| ) |  |

Search for all occurrences

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.

Parameters:

  [in] | x | the width value to compare against
  [in] | y | the height value to compare against

void setWorldspaceToScreenTransform | ( | MMatrix & | value | ) |

Search for all occurrences

The transformation matrix used in the minimum screen size test for subdivision.

This value is used when the subdivision criteria kUseMinScreenSize has been set.

Parameters:

  [in] | value | The world-space transformation matrix

void setMaxUVRectangleSize | ( | double | u,
|  | double | v
| ) |  |

Search for all occurrences

Sets the maximum polygon size in uv-space for secondary tesselation.

Polygons will be greater than the specified size.

Parameters:

  [in] | u | horizontal screen space size
  [in] | v | vertical screen space size

void setRelativeFitTolerance | ( | double | value | ) |

Search for all occurrences

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.

Parameters:

  [in] | value | the new relative fit tolerance value to be set

void setEdgeSmoothFactor | ( | double | smoothness | ) |

Search for all occurrences

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.

Parameters:

  [in] | smoothness | a factor from 0(not smooth) to 1(very smooth) indicating nurbs-edge smoothness

void set3DDelta | ( | double | delta | ) |

Search for all occurrences

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.

Parameters:

  [in] | delta | the fractional spacing factor, a value between 0 and 1

void setUIsoparmType | ( | IsoparmType | uValue | ) |

Search for all occurrences

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

Parameters:

  [in] | uValue | the u-isoparm type

void setVIsoparmType | ( | IsoparmType | vValue | ) |

Search for all occurrences

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

Parameters:

  [in] | vValue | the v-isoparm type

void setUNumber | ( | int | count | ) |

Search for all occurrences

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.

Parameters:

  [in] | count | the number of u isoparms

void setVNumber | ( | int | count | ) |

Search for all occurrences

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.

Parameters:

  [in] | count | the number of v isoparms

void setBoundingBoxDiagonal | ( | double | distance | ) |

Search for all occurrences

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

Parameters:

  [in] | distance | the diagonal bounding box distance

void setUDistanceFraction | ( | double | value | ) |

Search for all occurrences

Sets the fraction of the 3D surface bounding box diagonal for the kSurface3DDistance isoparm type.

The value is 0.0 for other types.

Parameters:

  [in] | value | the bounding box distance fraction to set

void setVDistanceFraction | ( | double | value | ) |

Search for all occurrences

Sets the fraction of the 3D surface bounding box diagonal for the kSurface3DDistance isoparm type.

The value is 0.0 for other types.

Parameters:

  [in] | value | the bounding box distance fraction to set

MTesselationParams & operator= | ( | const MTesselationParams & | rhs | ) |

Assignment operator.

Parameters:

  [in] | rhs | the tesselation parameter to copy

Returns:
  A reference to the copied tesselation parameter.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  Name of this class.

MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams
MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams MTesselationParams