monotone

Description

monotone reads a two-column polygon vertex file and checks whether the polygon is valid, simple, and xy-monotone. If no polygon file is supplied, vertices are read from standard input.

Without -M, the module reports whether the polygon is xy-monotone. With -M, non-xy-monotone polygons are modified and written to standard output. Messages, including the original and final vertex counts, are written to standard error.

Usage

blend monotone - Check or enforce xy-monotone polygon boundaries

usage: blend monotone [<polygonfile>] [-M<method>] [-G<nx>[/<ny>]] [-V[q|e|w|t|i|c|d]]

Read a two-column polygon vertex file and check whether the polygon is simple
and xy-monotone. If <polygonfile> is omitted, vertices are read from standard
input. Default check mode writes a short status message to standard output.

OPTIONAL ARGUMENTS:

  -M<method>, --monotone=<method>
     Convert a non-xy-monotone polygon using the selected method and write the
     resulting polygon vertices to standard output. If the input polygon is
     already xy-monotone, it is written unchanged.
       e  Use the xy-monotone envelope (i.e., convex hull) method.
       b  Use the highest-IoU (Intersection over Union) piecewise envelope from both traversal directions.
          This is sampled on the -G grid [Default is 256/256] to compute the IoU.

       E  Use the strict xy-monotone envelope method.
          Here the nondecreasing condition is replaced with a strictly increasing condition.
       B  Use the strict highest-IoU piecewise envelope from both traversal
          directions, sampled on the -G grid [Default is 256/256].
          Here the nondecreasing condition is replaced with a strictly increasing condition.

  -G<nx>[/<ny>], --grid=<nx>[/<ny>]
     Set the grid used to estimate IoU for -Mb or -MB. nx and ny must be positive
     integers. If ny is omitted then ny = nx [Default is 256/256].

  -V[level], --verbose=<level>
     Select verbosity level [w]. Choose among q, e, w, t, i, c, and d:
       q  Quiet; suppress all diagnostic messages.
       e  Error messages only.
       w  Warnings and errors [Default].
       t  Timings, warnings, and errors.
       i  Informational messages, timings, warnings, and errors.
       c  Compatibility messages and all lower verbosity messages.
       d  Debug messages and all lower verbosity messages.

  -?, --help
     Print this usage message and exit.

EXAMPLES:

  blend monotone polygon.txt
     Check whether polygon.txt is simple and xy-monotone.

  blend monotone polygon.txt -MB -G512/512 > polygon_monotone.txt
     Convert polygon.txt using the strict highest-IoU piecewise method and write the result.

  cat polygon.txt | blend monotone
     Read polygon vertices from standard input and check monotonicity.