# Procedures to split rivers of a raster fill into small enough blocks. # Last edited on 2021-07-28 12:09:45 by jstolfi import raster_splitrivers_IMP def doit(OPHS, Delta, Gamma): # Assumes that the parameter {OPHS} is a list of oriented paths, each # consisting of a single trace, all parallel to some unit direction # vector {xdir}. # # Also assumes that the paths have been classified into /rivers/ as # define in the paper by E. Santos et al. (2021). e.g. by # {raster_regroupp.split_at_forks}. The procedure will split each # river (group) into smaller /sections/ by horizontal /cut-lines/ that # run between scan-lines. Then it will re-assign the group indices # (consecutively, starting from 0) to identify these sections, even # if none of the original groups was split. # # The paths in {OPHS} must be pairwise disjoint. They must be sorted # in /scanline order/, which is defined by increasing projection on an # axis {ydir} perpendicular to {xdir}, ignoring roundoff errors; with # ties broken by increasing projection along {xdir}. The orientations # of the paths and traces are ignored by these procedures. # # This procedure uses the contact information of each path as accessed # by {path_hp.get_contacts} and {path_hp.set_contacts}. These lists # must have all contacts which have both sides on paths of {OPHS}, and # only those. Contacts between {OPHS} and other paths (such as # contours) should not be in those lists. return raster_splitrivers_IMP.doir(OPHS, Delta, Gamma)