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 23:02:32 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:QPEDGR9jN1FG3f9uRHKM819IXTAuvvDOBiVQ1KB+0+IQIJqq85mqBkHD//Il1AaPAdyKrasUwLON6+igATVGvc/e9ihaMdRlbFwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfQV6Kf7oFYHMks+5y/69+4HJYwVPmTGxfa5+IA+5oAnMssQam5ZuJ6U+xhfUrHZEZ/ldyWd0KV6OhRrx6dq88Zx5/yhMp/4t8tNLXLnncag/UbFWFiktPXov5M3suxnDTA+P6WUZX24LjBdGABXL4Q/jUJvpvST0quRy2C+BPc3rVr80Qiit771qSBDzligKMSMy/XzNhcxxiKJbpw+hpwB6zoXJboyZKOZyc6XAdt4cWGFPXNteVzZZD4yzYYsADeoPM+hboYfguVUBsQCzBROwCO710DJEmmP60K883u88EQ/GxgsgH9cWvXraq9X1KroZX+GvzKnP1jrDYO1Z2TPg54PVdR0uvPaMXaxqfcre00kvEBjKjlqOpozhIjyYzesNs22B4OphUeKjkXIoqwZ0ojW2wMonl4bGiJ4PxF/e6SV53Jg6Jce+SENjY9OpFJReuS6eOoV4Qs0vR39ktDs6xLAJtpO2YicExIk5yhDfa/GKb5WF7w//WeueIjp1mW9odbKjihiy80Ws1OvxXdS63lZNqypKiNjMtnYV2hPJ9seLUPp9/kO51TaA1gDT9uFEIV0vmqbBN5EhxbswmoISsUTFBC/2mV/5gLWYdkU+/OWj9ufpYq3+q5OCK4N5jhvyP6cul8ClH+g0LwoDU3KU9Om/0rDo4Ff3T69QjvIsl6nUqJDaKtofpq6+GwJV15ws6xe7Dzu/ztQYhmQLIEtLeB+IjIXlIV7OIPf/Dfewh1Sjji1nyOzBPr3kGpnNL37Dn6n9fbtl9UJQ1A4+wcpc6p9UEL0NPu//V03ruNHXDRI1Kwm0zPzmCNV52IMeQ2WPAqqBPazPtl+I+PgjI+aWZI8Sozn9JOYq5/rzgnIill8deLOm3ZoTaHyiAvtmJECZbWL2gtgdCWcKohY+TOvyhVKeXj5cfXKyU7sh6TE6E4KpEZrDRpu2gLGaxye6HphWZnhcBVyWEHfocZ+EW/YWZy6ILM9hiG9MaL66VoV01Q2yrBSojP18P+/M82sZs4ji3Z57/arIhBQq/Ht1CcqalGqCRmUxkmITTCItx/NCp1dgwHef1Kwtg+BEDccBoLRSQwIiPNjdyfZ7Apb8QEXab9KRQRGnRNuhRjo+R9Z0z94VaFtmAIafiAve1RanE6NAl6CXHIdmteXHzn3pLoB8zWzH3e8vlR49U85XPCqngKB4sAPcDoqMn0SCnLuxbvcg23vG+26HiGaPp0pFSxVYUKPfXHlZaFGFg87+4xbuSKHmJq4gOARMzcLKfqdNdJvml1JMS/rnNPzRZmuwnyG7AhPeleDEV5bjZ2hIhHaVM0MDiQ1GpS/aZzh7PT+opiflNBIrDUjmOhq+/ux3qXf9RUgxnVnTPh9RkoGt8xtQvsSyDvYa37YKoiAk8mwmE1O03taQAN2F9VM4IfdsJOgl6VIC7lr38gxwOpv6cvJnj18aNhps5gbgi0UxBYJHnswn6ngtyVgqJA==

Here's another followup. Here is the single hole of the unbounded face of the same arrangement code from polygon_repairing:

unbounded_hole.png
It is also self intersecting. Again, I don't understand why I don't get two non self-intersecting holes.

On Sat, Jan 23, 2021 at 10:43 PM Dov Grobgeld <> wrote:
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