Fill algorithm for loops and polygons

Loops and polygons have a Boolean EOFill flag to determine the fill algorithm. A fill algorithm is necessary for loops and polygons because when a polygon or a loop is added to an area, the fill algorithm indicated by the fill flag affects the shape of the area. If portions of the interior of the geometry are not filled, those portions are cut out when the geometry is added to the area. Since only a geometry is passed into an area, the fill flag property belongs to the geometry.

Figure 37 shows two polygons on the top and two loops on the bottom. The left polygon and loop have their EOFill flag set to True, and the right polygon and loop have their EOFill flag set to False. If the EOFill flag is True, the polygon or loop is filled with an evenodd rule, and if the EOFill flag is False, a nonzero winding rule is used. These rules are described below.


Top-left polygon

    aPolygonGeometry.SetEOFill( TRUE ); thePort.Draw( aPolygonGeometry, aBundle );

Top-right polygon

    aPolygonGeometry2.SetEOFill( FALSE ); thePort.Draw( aPolygonGeometry2, aBundle );

Bottom-left loop

    TGLoop aLoop( 2, aLoopArray, TRUE ); thePort.Draw( aLoop, aBundle );

Bottom-right loop

    TGLoop aLoop2( 2, aLoopArray, FALSE); thePort.Draw( aLoop2, aBundle );
The points used in aPointArray for the first polygon are the same points that were used to create the star polygon in Chapter 2. Values are added to the x and y coordinates as needed to position the polygons and loops in the view so that you can see them together.

The loops are created with a curve order of 3. If the curve order were 2, the loops would appear identical to the polygons because polygons have a curve order of 2. Giving the loops a curve order of 3 makes them appear round. Increasing the curve order increases the roundness. See the heading "Curves, loops, and knot vectors" on page 79 for details on curve order.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker