| OCR Text |
Show 38 conventional approaches: 1. to sort the data into a file of edges; 2. to merge the edges into an intermediate file; and 3. to read the intermediate file and generate polygons.a If enough data were retained at state 2, which is generating the intermediate file, then the third pass would be as simple as traversing a linked list of finished geometries. Another attempt at applying the same philosophy is in the trapezoid decomposition. If the notion of inside and outside can be preserved by pairing geometry edges without first decomposing the geometries to trapezoids, then the work spent on the scanline can be localized to those areas that are event areas without the price of making trapezoids first. This algorithm explains how to perform this scheduling on whole geometries and how to assemble the resultant geometries on the fly, beginning with the sorting stage of Figure 3.8. In the second stage of this scan line merge, the scanline sweeps from left to right. With each entry of a particular X, the Y value is noted along with the Y value of the adjacent side (maintained by the double links). These two Y values are given to the scheduler, so that it knows to sweep across this part of the scan line. The scheduler is responsible · for scheduling work in regions of the scan line that have overlapping or abutting Y ranges. When all the values of a particular X have been loaded into the scan line, the Scheduler directs the work on the scan line to those regions where changes could have occurred. As the scan line works from bottom to top in the areas directed by the scheduler, output polygons are created that are also doubly linked, and maintained i~ a list that accumulates them (with possible duplication). The second stage of the plane |