findDualGraph

Finds the dual graph of this, as described in https://www.mattkeeter.com/projects/contours/: one point per leaf cell (its center), and one polygon for every grid vertex shared by two or more leaves -- a quad where four same-depth leaves meet, or a triangle at a "hanging" T-junction where one coarser leaf borders two finer ones.

This only depends on this's shape, not on any ShapeFunction: every leaf cell -- whether QuadTree.isFull, QuadTree.isEmpty or a genuine boundary-straddling leaf -- contributes a point and participates in polygons the same way.

Return

a list of points (one per leaf cell that borders at least one other, at its center) and a list of polygons, each a list of indices into that point list, wound counter-clockwise