Curves and curved surfaces need to be tessellated—broken up into lines and polygons—in order to be displayed. The degree of tessellation determines how accurate the displayed curve will be (how close it will approximate the mathematical “true” curve) and how much performance overhead is required to generate the graphics for a curve. A very small circle may require only a single pixel to display it. A large circle may require hundreds of small line segments to be calculated and displayed to create a smooth appearance.
The deviation() functions provided by the AcGiWorldDraw and AcGiViewportDraw classes return the deviation, which is the allowable maximum difference in world space between a true mathematical surface and the tessellated surface, as shown in the following figure:
Access to this value allows custom entities to tune their tessellation to the VIEWRES command's zoom percent option, which is set by the user. The result is that custom entities are tessellated to relatively the same smoothness as built-in entities.
The deviation() function returns the suggested maximum deviation in world space, given the type of deviation to calculate and a point in world space for perspective scaling if required. The signature for the deviation() function is
virtual double AcGiWorldDraw::deviation( const AcGiDeviationType devType, const AcGePoint3d&) const = 0;
The deviation types are