Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Prune loops from self intersecting curves

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Prune loops from self intersecting curves


Chronological Thread 
  • From: Dov Grobgeld <>
  • To:
  • Subject: Re: [cgal-discuss] Prune loops from self intersecting curves
  • Date: Sat, 23 Jan 2021 22:43:05 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:xFKMdh1ciWZv3iWJsmDT+DRfVm0co7zxezQtwd8ZsesWIvrxwZ3uMQTl6Ol3ixeRBMOHsqMC0rqd6vu4ESxYuNDd6S9EKMQNHzY+yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9Kev6AJPdgNqq3O6u5ZLTfx9IhD2gar9uMRm6twrcutQSjId4N6o8yRTFrmZGduhK2GhkIU6fkwvm6sq/4ZJu8T5ct+49+8JFTK73Y7k2QbtEATo8Lms7/tfrtR7NTQuO4nsTTGAbmQdWDgbG8R/3QI7/vjP1ueRh1iaaO9b2Ta0vVjS586hrUh7ohzwZODM/7Wral9Z/jKNfoBKmuhx/34vZa5ybOfZiYq/Qe84RSGxcVchTSiNBGJuxYIQBD+UDPehWoYrzqUYQoxSiHgSsHv/jxyVSi3PqwaE30eIsGhzG0gw6GNIOtWzZotvyNKcMTOu7zbPIzTLYYPNZxzj97JXHeQ0mrP6RWrJwb9DdyUY1FwPClVqQppLqPzeI2ekWvGib6vBvVeOri2I9tw5xpT2vy94qh4LUiY0b1krK+j9lwIYpO9K4Ukh7bMamHZZUuC+UOI97TM0iTWxspio2170ItJG0cSUUx5or2gDSZfyHfoWU/x/uSfqcLDh7iX94Zb+yhwq//0iix+HiUMS/zVhEri1AktbWt3AN0QTe5dKbRfdn/0eh3S6D1w/S6uFYIUA0iLHUJ4Q9zb43k5ofqUXDHinsmEX3lqCabEsk+vKu5u/6YbvmvoeRO5Fohgz6KKgjmcyyDf4mPgQTXWWX4+Sx2KHl8EbkWrtFlOc2nbPcsJ3CJcQUuKq5AwhN34Ym8Rm/DjOm3M0GnXkcMV5JYRyHgoj1N13UL/D4CvC/g1uokDh13fzJIrrhApDVInjClrfuY6p95lZCxAYvyd1T/ZFZB7EbLP7tR0P8tsbUAx8lPwCsxuboEtR91ocQWWKVBa+ZNbvfvkKP5uIxOeWMa5UVuDHmJPgq+fHuiWI2lEQSfamsx5QXaXS4Eu56LEWeZHrgms0BHnsSvgoiUOzqj0WPXiJcZ3moW6Iw/yw0CIO9DYjfW4Ctm6eB0TygHpxWY2BGEkqDHW3pd4WCQfcMaTidLtVvkjweBvCcTZQ830SuqBPi0OggafHF/zUR85Plztl8oePJ0goj8CR9SMWb3WbKRG59miYERiQ9wbtk8nF70UqJ8bR9h6lYCcBL/KEOFRwrMIbVie18EdH7HAzbOcyYTU6vBdSgDzZ2Rd04x5oCYl12Bs653S3FxDegP7IFi+mLGIAs6fCbmGPgIt50jXfAzqgoyVc8BdBeMHWvwa95+Q+UDIHAlwCVlr2haL8HjxLKoWyMxG7LsEBDWxNrSo3EW2oebw3Yt4fX/ETHGpOpF/wIKAxLxsOGJuMeZtr3y1pcQ/3sNdDSS220kma0Qx2Pw+XfP8LRZ2wB0XCFWwA/mAcJ8CPebFRsNmKau2vbSQdWOxf3eUq1qLtxrXq6Sgk/yATYNxQwhYrwwQYcgLmnc91W27sFvCk7rDAtRQSy2tvXD5yLoA8zJfwBM+N4209O0CfijyI4PpGkKPo/1FsXcgAyoVi3khsqUsNPls8lqH5sxw13e/qV

Sorry, I forgot to include the input dat file of the path of my previous email.

12
30 0
130 0
130 30
100 70
100 30
130 70
130 100
30 100
30 70
0 30
0 70
30 30


On Sat, Jan 23, 2021 at 10:41 PM Dov Grobgeld <> wrote:
Thanks! That helped, and indeed I'm able to use the winding number to get rid of the red loop in my previous post, which gets a negative winding number, and can easily be filtered. But I'm still stumped by another problem of arrangements.

Consider the following closed self intersecting path:

input.png
If I run the book example chapter6/polygon_repairing.png on the above path I get the following separated paths:

res.png
The green path is however still self intersecting! Why does the Arrangement return self intersecting paths in the outer_ccb? I guess I would have to access the holes of the unbounded face to get the non-intersecting outer curves. But will that work with the winding number class? I admit that I'm quite confused by this.

Thanks!


On Fri, Jan 22, 2021 at 1:59 PM Sebastien Loriot <> wrote:
I think in the arrangement book:
http://acg.cs.tau.ac.il/cgal-arrangement-book

there is some code to fix self-intersecting polygons using winding numbers.

The code of the example is also available at the URL above.

Best,

Sebastien.

On 1/21/21 6:10 PM, Dov Grobgeld ( via
cgal-discuss Mailing List) wrote:
> Hi all,
>
> In my efforts to deal with a large variety of fonts in my text to glyph
> generator, https://github.com/dov/pomelo
> <https://github.com/dov/pomelo>, have I encountered several cases of
> "bad" contours that I need to clean. One of the problems can be seen in
> the following figure:
>
> foo.png
> The input is the purple polyline on the left. My desired output are the
> blue and the green polylines on the right, while dropping the red
> polyline. My idea of how to do this was to use arrangements.After doing
> an arrangement, so I thought, the generated separated polylines, would
> keep the segment orientations of the input. Since I know the desired
> direction of the polyline, (I know whether I'm looking for an outer
> boundary or on a hole), I can drop polylines whose orientations are not
> as expected.
>
> Unfortunately this doesn't work. I found that boundaries of the faces
> that Arrangement_2 generate are all the in the same direction.
>
> Am I missing something?  How can I prune the red polyline?
>
> Here are the input coordinates of the input as a svg d path:
>
> m 457.2054,532.00482 -2.16634,-106.13373 2.48438,-79.73047
> 4.94872,-58.86624 15.90675,0.0928 -9.17579,50.94531 -7.96093,57.34766
> -3.03516,15.03515 -5.07812,10.16406 -7.16537,4.46318 -9.10807,1.23214
> 8.85783,1.10863 7.45076,4.90699 5.07032,10.11328 3.01562,14.85157
> 8.83504,74.12725 z
>
> Thanks!
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>

--
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.19+.

Top of Page