geom.poly.next.poly

Syntax

pn = geom.poly.next.poly(p,i)

Get the next polygon connected to an edge. This can be used to iterate through all polygons connected to an edge using the geom.poly.next.index function.

Returns:

pn - next polygon pointer

Arguments:

p - polygon pointer

i - edge index with 1 \(\le\) i \(\le\) geom.poly.size

Get the next polygon connected to the edge with local index i within the source polygon p. This can be used to iterate through all polygons connected to an edge using the geom.poly.next.index function.

Returns:

pn - next polygon pointer

Arguments:

p - source polygon pointer

i - edge index with 1 \(\le\) i \(\le\) geom.poly.size

Usage Example

The following example illustrates how geom.poly.next.poly can be used to iterate through all polygons connected to an edge.

    ; Test edge to poly loop
    global test25 = 0
    local edge_pnt = geom.edge.find(setpnt,1)
    local poly_pnt = geom.edge.start.poly(edge_pnt)
    local edge_ind = geom.edge.start.index(edge_pnt)
    loop while poly_pnt # null
        test25 = test25 + 1
        local next_pnt = geom.poly.next.poly(poly_pnt,edge_ind)
        edge_ind = geom.poly.next.index(poly_pnt,edge_ind)
        poly_pnt = next_pnt
    end_loop