Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Splitting (and simplifying) complex polygon with holes

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Splitting (and simplifying) complex polygon with holes


Chronological Thread 
  • From: Efi Fogel <>
  • To:
  • Subject: Re: [cgal-discuss] Splitting (and simplifying) complex polygon with holes
  • Date: Thu, 30 Mar 2017 19:37:43 +0300
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:PhFEdhVSZfbxKLN9M0T3afq1JtTV8LGtZVwlr6E/grcLSJyIuqrYYxyOt8tkgFKBZ4jH8fUM07OQ6PG8HzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjSwbLd9IRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmijoINyQh/W7VhMx+jKxVrhG8qRJh34HZe5uaOOZkc67HYd8WWWhMU8BMXCJBGIO8aI4PAvIOM+ZWron2ulsArRyxBQayAOPk1zhFiWH43a073eQhFg7G0xIkH98Vv3TUqc/6NKYWUeyv0KbIyjDDYupQ1Dzg5obIdRUhruuNXbJ2acfRyE8vFxnEjlqKs4DlMSmV2vwRvGiU9eVgUfiji2k9qwF+pDWk28QiipHRi44L1lzJ8T91zYU1KNGiVkJ3fN2pHIFQui2EMYZ9X9ksTHtyuCkgz70LoZ67czYOyJQg3xPfbuaIc4mM4h76U+aRICt0iGtreL+/mRq+60egyur7Vsm71FZFsDBJncXLtnAIzxDT686HReVh/kq5xzqDywTe5vtHLE00j6bXNYMtz70qmpcTr0jPBir2l1/3jK+SeEUk4O+o6+H/b7r4qJ+cNoF0igbxMqswnsyyGus4Mg0UUGia/eSwzqHs/Ur8QLlSlP05jrHZsIzGJcQcvqO2HwBV3Zwn6xqmEjim0c8YkmUaLFJeYxKKlJPpOlHLIPDgF/izmVWskDFxx/DHJLLtGJvNLmKQ2IrnZqt3vk5A1BIon5cY/INRErhHIfTpW0a3usafFQ48KwXzwuDpD5J22YoaHG6OGaSEK7iBjVjd7e0mJ6yAZZQepS3mA/kj/f/ny3EjynEHeqz88JUWIF6/EfliaxGUb3vihdgMFU8FuwM/SKrhj1jUAm0bXGq7Q69pvmJzM4mhF4qWHo0=

Check out vertical decomposition; see http://doc.cgal.org/latest/Minkowski_sum_2/classCGAL_1_1Polygon__vertical__decomposition__2.html.

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/



On 30 March 2017 at 17:13, Ch'Gans <> wrote:
Hi there,

I am using an R-Tree (Boost.Geometry) to do spatial queries, my
geomtric items range from small rectangle to long "thick" lines and
complex polygon with holes.

Some of my polygons have a bounding box that nearly covers the whole
set of items my rtree have to deal with, and I need to efficiently do
collision detection b/w the small items and the big polygons. Since
the rtree works with bounding box, I gain nothing when inserting such
"huge" items (their bounding box collides with everyone else's
bounding box).
See attached picture showing a layer of 254 polygons with holes for a
total of ca 70000 points: green are polygon outer boundaries, yellow
are inner boundaries, blue are outer boundary bounding box and magenta
inner boundary bounding box.

I would first like to split these big polygons into a set of smaller
polygons (or rectangles), so that i can take advantage of my rtree. I
don't care about how optimal the partitioning is, my definition of
optimum is: generate quickly sub-polygons that have a small-enough
bounding box.

I looked at CGAL polygon partitioning algos, and the optimal convex
partition looks sexy, but with complexity such as O(n^4) I think it is
no-go for me. The approximate convex partitioning has better
performance, but it seems that in my case it will produce sub-polygons
which will potentially have "big" bounding boxes.

Then there's the triangulation, but given the (very) detailed
"coast-line" of my polygon, it might not be efficient and will
certainly produce a massive amount of triangles. Maybe if i combine
this with multi-polyline simplification it might work... But this
sounds like requiring lot of CPU ...

A simple algo I had in mind is spliting a polygon according to a
coarse grid: lay out a polygon on a grid, then insert a grid cell in
the rtree, iff the cells overlaps the polygon. I thing it's a classic
approach in graphics toolkit (Qt has QRegion for this if i'm not
wrong). this could potentially be refined using a dichotomy
approach... Maybe i could use a CGAL arrangement and monitor face
splitting as i insert horizontal/vertical grid lines...

Anyhow, I thought i would send a word to this mailing list, and see is
someone has an opinion about these sort of problem, maybe i've missed
an awesome CGAL super-weapon, or maybe i'm trying to be too
clever/complicated.

Thanks,
Chris

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss






Archive powered by MHonArc 2.6.18.

Top of Page