Return the Dominant Surrounding Rectangle for a given array of points
The dominant-axis SurroundingRectangle, or null if the given points did not produce a valid hull.
SurroundingRectangle
null
Uses the outline edge lengths to find the dominant orthogonal axis, then returns the surrounding rectangle aligned to that axis.
p5 --- p4| || p3 ------ p2| |p0 ------------- p1const footprint = [[0, 0], [8, 0], [8, 2], [3, 2], [3, 6], [0, 6], [0, 0]];const points = geomRotate(footprint, Math.PI / 6, [0, 0]);const dsr = geomGetDominantSurroundingRectangle(points);// dsr.angle == Math.PI / 6 Copy
p5 --- p4| || p3 ------ p2| |p0 ------------- p1const footprint = [[0, 0], [8, 0], [8, 2], [3, 2], [3, 6], [0, 6], [0, 0]];const points = geomRotate(footprint, Math.PI / 6, [0, 0]);const dsr = geomGetDominantSurroundingRectangle(points);// dsr.angle == Math.PI / 6
Return the Dominant Surrounding Rectangle for a given array of points