On Mon, Jul 10, 2017, at 01:34, Jerome Kieffer wrote: > On Sun, 9 Jul 2017 23:35:58 +0200 > Mikhail V <mikhail...@gmail.com> wrote: > > > disclaimer: I am not a past contributor to numpy and I don't know > > much about github, and what pull request means. So I just put the > > examples here. > > > > So in short, the proposal idea is to add a library function which > > calculates the intersection > > area of two rectangles, generalized for any dimensions. > > I am using this kind of clipping as well but in the case you are > suggesting the boxes looks aligned to the axis which is limiting to me. > The general case is much more complicated (and interesting to me :) > > Moreover the scikit-image may be more interested for this algorithm.
We use rectangular clipping in scikit-image, but general polygon clipping is easy thanks to Matplotlib's wrapping of the AGG library. Here's how to do it: https://github.com/scikit-image/scikit-image/blob/master/skimage/_shared/_geometry.py#L6 Stéfan _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion