Swept polygons - Sketch
Description: Sketch

Next: Swept blocks, Previous: Swept lines, Up: Sweeps

##### 3.2.6.3 Swept polygons

If swept_object is a polygon, the `sweep` connects n+1 successive copies of the closed polyline border of the polygon to form body polygons exactly as though the border were a swept polyline as described in Swept lines. If there are m points in the original polygon, then mn body polygons are formed by this sweep. The body polygons form an extrusion of the boundary of the original polygon with two holes at the open ends.

Finally, the sweep adds two copies of the original polygon to cover the holes. We call these hole-filling polygons ends. In this manner, `sweep` forms the boundary of a three-dimensional object from a two-dimensional polygon.

The order of vertices of end polygons is important for correct culling as described above. An exact copy of the original polygon with vertex order intact forms the first end polygon. The other end polygon results from transforming and the reversing the order of vertices in the original. The transform places the original polygon at the uncovered hole; it is

         T_1^n then T_2^n then ... then T_r^n.

If there are no options on the swept polygon, then the sweep options are copied to each output polygon. If the swept polygon does have options, these are copied to the ends; the sweep options are copied to the body polygons. In this manner, body and ends may be drawn with different characteristics such as `fillcolor`.