rapid-sdk
    Preparing search index...

    Function geomGetDominantSurroundingRectangle

    • Return the Dominant Surrounding Rectangle for a given array of points

      Parameters

      Returns SurroundingRectangle | null

      The dominant-axis SurroundingRectangle, or null if the given points did not produce a valid hull.

      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 ------------- p1
      const 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