| OCR Text |
Show 71 Foreach with One Edge The 'foreach' iterator may be used to get the edges or centerline segments of polygons or paths. The format for one polygon or path geometry is: "foreach(edge( <geometry>) <edge>)." This would be nested within a 'foreach ' statement that brought <geometry> into scope and qualified it to be a path or polygon and not a text object. If the geometry were named 'geom_cca' and the edge was to be called 'edge_cca', the form would be: " foreach ( edge ( geom_cca ) edge_cca)." Edge methods would then be available for 'edge_cca' in the following statement. Nesting the 'foreach' iterators is necessary to get to the individual edges in the graphical data set. Foreach with Two Edges To apply the 'foreach' iterator to pairs of edges, the following form is used: "foreach(edge(<geom_1>, <geom_2>) <edge_1>, <edge_2>)." The two geometries are 'geom_1' and 'geom_2', and the edges 'edge_1' and 'edge_2' are returned when they are within the same search_distance value that applied to geometries. This is the mechanism for culling pairs of edges in a search. If this iterator is applied to pairs of edges on one geometry, it tracks them so that the same edge pair is not returned twice and the same edge is not returned as a pair. The edges returned might not be parallel or have coincident X or Y values because the distance algorithm simply computes the distance separating edges at their closest point. One small example illustrates the use of this functionality to find reflection |