geom.node.start.index

Syntax

i = geom.node.start.index(n)

Index of the first edge connected to a node. This can be used to iterate through all edges attached to a node with the geom.node.start.edge, geom.edge.next.edge and geom.edge.next.index functions.

Returns:i - edge index
Arguments:n - node pointer

Get local index i of point n within the first edge attached to the point. This can be used to iterate through all edges attached to a node with the geom.node.start.edge, geom.edge.next.edge and geom.edge.next.index functions.

Returns:i - node index with 1 \(\le\) i \(\le\) 2
Arguments:n - node pointer

Usage Example

The following example illustrates how geom.node.start.index can be used to iterate through all edges attached to a node, counting the number of edges.

    ; Test node to edge loop
    global test23 = 0
    local node_pnt = geom.node.find(setpnt,1)
    local edge_pnt = geom.node.start.edge(node_pnt)
    local node_ind = geom.node.start.index(node_pnt)
    io.out(edge_pnt)
    io.out(node_ind)
    loop while edge_pnt # null
        test23 = test23 + 1
        local next_pnt = geom.edge.next.edge(edge_pnt,node_ind)
        node_ind = geom.edge.next.index(edge_pnt,node_ind)
        edge_pnt = next_pnt
        io.out(edge_pnt)
        io.out(node_ind)
    end_loop