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:41:18 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:uFcOaRKp4fmEyhftRNmcpTZWNBhigK39O0sv0rFitYgXKvT9rarrMEGX3/hxlliBBdydt6sVzbOG+Pm7ASRAuc/H7CldNsQUFlcssoY/p0QYGsmLCEn2frbBThcRO4B8bmJj5GyxKkNPGczzNBX4q3y26iMOSF2kbVImbuv6FZTPgMupyuu854PcYxlShDq6fLh+MAi6oR/eu8ULhYZuMLs9xxjGrndVdela2X5jKVaPkxrh/Mu984Nv/iZKt/4968JMVLjxcrglQ7BfEDkoKX0+6tfxtRnEQwuP538cXXsTnxFVHQXL7wz0U4novCfiueVzxCeVPcvtTbApQjui9LtkSAXpiCgcKTE09nzch9Fqg6JapBKhoAF/w5LRbYqIOvdyYr/RcNUHTmdHQ81fVTFOApmkYoQAAeoOP+ZWoYf+qVUTsxWxGRKhBPnzxjJSnHL6wbE23uYnHArb3AIgBdUOsHHModv7M6cST/2+wqjSzTXEdPxW1iny6IzVfRs8pvyDQLVwcdTLxUkgDQPFiU6fqYP7MDORy+sAqGeb7+96WuKuj24rsR1+oj+qxso1jITCm40axEze+ypj3IY1OcO3SFR9YdO8EpZdsy6UOYRyT80sQ29lvDg2xqAGt5O0cyUH1pspywPBZvKHc4WF/g/uWfuNLDp3h39oZa+yihau/EagyODwSM+520tEoCpCl9nDrHEN1xrL58edVvRx5Eah2TKX2wDc6+FEPUA0lbfAJJI73rEwkZ8TvVzCHi/wgkX2jbWZel8q+uiy7ensf7bopoeEOoNqlg3zNr4il8+/DOgiLAQCQXaX9f6z2bDg+0DyXa9EgecskqbDtZDXPcQbqbC9Aw9Syosj7gywDzai0NgBgHkINk9JdAuJj4XmOFzCOv/4DfC4g1SjlDdk2erKMaHmApXINnTDkbHhcqhh60NE1gY/0dRS64hXB7wBOv7/RFH9uMLCAhI2MAG42+PnB8981oMaV2KPGKiZMKbKvFCV4eIvPfOAZIAPuDb6MPcl6ODhjXskllIGcqmp2IEYaHG8Hvh8P0qZZn/sjs8bEWgWpgo+UPDqiFqaXDFPaHa9RaY86igmB4KnFofMWp2tgKea3CqgBZ1XZmVGCkiWHnvydoWEXe0MaCOILcN7nDwET+vpdok6yBv7tBPm06E1aa3P6ygAvNTi0sJ07qvdj1Yp5DlsBoOc1W+KCGp7l2dNSz4t171kuh9AzEye24hkhvgNFcBP/+gbFUAhJJvExqp7DcrzU0TPZJCSWVO+S5KnBz82Cdk+yttLb0dmEMi5lUP+2TG3CYMYh6DeBIAo6rmOmD/qNsNlwjDH0rMghh8oWIxUJGi+j+l+8QbUQIXGmkHcm6exfrkHx33x8zKIwmOK+U1ZSwVtSr7tXHYFZ0KQo86qyFnFSuqCDqpvHRFGw8GPLqcCPtHukxNJXvDpN9nab0q+nm6xAVCDwbbaP9miQHkUwCiIUBtMqAsU53vTbVFjVBfkmHrXCXlVLXyqY07o9rMj+nayT0tx0gjTKkM9h/y6/RkagfHaQPQWjOpd6XUR7g5sFVP45Or4Tt+Jpg5vZqJZOIpv71JO1GafvAt4bMX5c/JSw2UGegEyhHvAkg1tA9wZw8cvpXIuigF1LPDA3Q==

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