# Request for a function oriented bounding rectangle numpy

**URL:** <https://forum.compas-framework.org/t/request-for-a-function-oriented-bounding-rectangle-numpy/713>\
**Category:** compas\
**Created:** [May 14, 2023, 11:51am UTC](https://forum.compas-framework.org/t/request-for-a-function-oriented-bounding-rectangle-numpy/713 "2023-05-14T11:51:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zac\_Zhuo\_Zhang](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/zac_zhuo_zhang/32/433_2.png) [@Zac\_Zhuo\_Zhang](https://forum.compas-framework.org/u/Zac_Zhuo_Zhang)\
**Post date:** [May 14, 2023, 11:51am UTC](https://forum.compas-framework.org/t/request-for-a-function-oriented-bounding-rectangle-numpy/713/1 "2023-05-14T11:51:51Z")

</div>

Hi,

Thanks to many good functions like `compas.geometry.oriented_bounding_box_numpy` which is irreplaceable by `Rhino. Geometry`.

To rich the functionality of COMPAS, I wish there will be any possibility of adding a function called `oriented_bounding_rectangle_numpy` or similar to enhance the 2D bounding calculation.

Currently the `oriented_bounding_box_numpy` can be used for 2D cases, but an independent oriented bounding rectangle function could be more inexpensive for the computation and easy to use.

Thanks!

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [June 14, 2023, 6:20am UTC](https://forum.compas-framework.org/t/request-for-a-function-oriented-bounding-rectangle-numpy/713/2 "2023-06-14T06:20:01Z")

</div>

hi,

could you add this as a feature request on the issue tracker?  
here it will be forgotten…

thanks!

---

<div class="post-metadata">

**Author:** ![Zac\_Zhuo\_Zhang](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/zac_zhuo_zhang/32/433_2.png) [@Zac\_Zhuo\_Zhang](https://forum.compas-framework.org/u/Zac_Zhuo_Zhang)\
**Post date:** [June 14, 2023, 7:03pm UTC](https://forum.compas-framework.org/t/request-for-a-function-oriented-bounding-rectangle-numpy/713/3 "2023-06-14T19:03:23Z")

</div>

Hi,

Thanks for the reply!

Absolutely! the feature request is created [here](https://github.com/compas-dev/compas/issues/1159).

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [July 10, 2023, 2:45pm UTC](https://forum.compas-framework.org/t/request-for-a-function-oriented-bounding-rectangle-numpy/713/4 "2023-07-10T14:45:34Z")

</div>

hi,

while working on the geometry refactor, i realised that this function actually already exists. see here [https://github.com/compas-dev/compas/blob/5d6e68d55a98f0fe051afe3f461c7503dd1331b7/src/compas/geometry/bbox/bbox\_numpy.py#L162](https://github.com/compas-dev/compas/blob/5d6e68d55a98f0fe051afe3f461c7503dd1331b7/src/compas/geometry/bbox/bbox_numpy.py#L162)

or is this not what you are looking for?

it also uses the convex hull of the points in the background, but only the 2D coordinates…

---

<div class="post-metadata">

**Author:** ![Zac\_Zhuo\_Zhang](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/zac_zhuo_zhang/32/433_2.png) [@Zac\_Zhuo\_Zhang](https://forum.compas-framework.org/u/Zac_Zhuo_Zhang)\
**Post date:** [July 10, 2023, 3:07pm UTC](https://forum.compas-framework.org/t/request-for-a-function-oriented-bounding-rectangle-numpy/713/5 "2023-07-10T15:07:44Z")

</div>

oh, thanks! some how didn’t find it before. That works!

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [July 10, 2023, 3:15pm UTC](https://forum.compas-framework.org/t/request-for-a-function-oriented-bounding-rectangle-numpy/713/6 "2023-07-10T15:15:56Z")

</div>

i am still testing the functionality on different data sets but soonish a reliable version of the functions should be available…
