
TRoundedBox3D box( 200, 200, 20 ); box.Draw( thePort );

TGLoop contour( TGEllipse( TGRect( 0, 0, 200, 200 ) ) );
contour.ReverseDirection();
TGCurve3D trajectory( TGPoint3D( 100, 0, 100 ),
TGPoint3D( 100, 50, 100 ),
TGPoint3D( 100, 75, 100),
TGPoint3D( 100, 100, 100 ) );
TSweep3D simpleSweep( contour, trajectory, TGPoint3D( 1, 0, 0 ) );
simpleSweep.Draw( port );
Because the contour is created from an ellipse, the direction of the ellipse must be reversed with the ReverseDirection() statement because 2-D areaenclosing geometries are drawn in a counter-clockwise direction, while the contour has to go in a clockwise direction. Without the ReverseDirection function call, the sweep draws inside out as shown on the right side of Figure 170. The sweep on the left has a pink interior and a gray exterior. The sweep on the right is inside out with its pink interior on the outside and the gray exterior on the inside. The colors are, of course, easier to see online.To make the cylinder above rectangular, contruct the contour loop directly from the rectangle without passing the rectangle to an ellipse. However, you need to call the TGLoop::CloseLoop function on the loop to get a closed sweep; otherwise, the sweep is considered open and only three sides of the rectangle are swept.