Recreate the heightmap generator using facets.  It is not quick,  but it functions. Also, there was a problem with Rect2i.contains(...) not matching Rect2i.max(), allowing index out of range even after ensuring range with Rect2i.contains(...).