Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Sweep algorithm return intersecting segments

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Sweep algorithm return intersecting segments


Chronological Thread 
  • From: Efi Fogel <>
  • To: Benjamin Streitz <>
  • Cc:
  • Subject: Re: [cgal-discuss] Sweep algorithm return intersecting segments
  • Date: Thu, 12 Jul 2018 17:32:36 +0300
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:Y6BO4RTWu4qHNpzZzwufwPYKd9psv+yvbD5Q0YIujvd0So/mwa6yZxWN2/xhgRfzUJnB7Loc0qyK6/6mATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfbJ/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlSgHLSY0/2PZisJwgqxVow+vqQJjzIPPeo6ZKOBzc7nBcd8GR2dMWNtaWSxbAoO7aosCF+UPPehZr4Lgp1UOqhS+CheoBOjyzTJHmHH23aw00+QmHgHJwgggEskBsHTRttr1NaMSXfqpw6nPyDXOdvVb0irz5ojPdxAuu/CMXbRofMrX00YgDBjKjlGOpoD/IzyV0eENv3Ca7+pmT+KvinQopxt/oji13ssjlobJiZgRylze8iV52ok1KNulQ0B4ed6pCIVcuz2eOodsQc4vQ3tktDs7x7Eao5K2cywHxZI6zBDFcfOHaZKH4hf7WeaRPzh4gHVldaq6hxmo8EigzvTwVtGw0FpWtyZFnNbBu3QX2xzc7ciHTfR9/kO/1jqVyw/T7eRELVg1lardNZEh3qY9moQPvUnHBCP7m0X7gLWLekgl5uSk8evqb7H+qp+ZLYB0iwX+Mqo0msy4BOQ1KhYBX2aa+eSy073j8lP2QLFRg/05l6nWqpHaJcABqqGlBA9V154v6wyjADe+zNQYgX4HIUpZdxKIlYfpP0jCL+35Dfekn1usjSxrx+vdM736ApTNK2DDn637cbZ87U5c0gszwspF65JaELFSaM/1QVL74dzEEgciYUvz2PfiENw714UEWGvJDLXeK7LXqVbP5+QhJK6Ha4YR/Tr8MPM4/OW9sXhss1Ibf6Cs3J1fU2yiE/V6MQ3Na3fqhMYpEWAQpA0kV+HwllyJXHhfaiDhcbg742QWBoPuI4DMS4Tl1LGP3Sm8EZBSTm9DA1GIV3zvctPXCL83dCuOL5o5wXQ/Xr+7Rtp5jED8hErB07Nia9Hs1GgdvJPn2sJy4rSKxx43/D1wSc+a1jPUFj0mriYzXzYzmZtHjwll0F7aiPp3hvVZEZpY4PYbCl5nZ66Z9PRzDpXJYiyEftqNTwz7ENCvADV0VtZphtFSMgByHNKtih2F1C2vUecY

It uses the sweep, so its complexity is O((n+k)log(n))
The single insert uses the zone, so its complexity is O(n^2).

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



On 12 July 2018 at 17:14, Benjamin Streitz <> wrote:
Thx. I think https://doc.cgal.org/latest/Arrangement_on_surface_2/Arrangement_on_surface_2_2curve_history_8cpp-example.html is an even better example which I found originating from your example, assuming one doesn't want to define an observer.

One more question about performance. Does this approach have the same performance of O((n+k)log(n)) as the sweep algorithm itself or is that only true for a single insert() operation?

> Efi Fogel <> hat am 12. Juli 2018 um 12:29 geschrieben:
>
>
> Consider constructing a 2d-arrangement induced by the curves (using the
> aggregate insert() free function, which is based on the surface-sweep
> framework).
> In particular, construct an object the type of which is an instance of
> Arrangement_with_history_2, or extend the arrangement to your needs and use
> an observer to update the extended data (see, e.g., the face_extension.cpp
> example of the Arrangement_on_surface_2 package).
> All the information you mention can be extracted from the arrangement
> object.
>
> ____ _ ____ _
> /_____/_) o /__________ __ //
> (____ ( ( ( (_/ (_/-(-'_(/
> _/
>
>
>
> On 12 July 2018 at 13:14, brainslush <> wrote:
>
> > I have a list of segments and want to determine where and with what
> > other segments they are intersecting unsing the sweep algorithm.
> > The part for obtaining the intersection positions is straight forward
> > from the tutorial / example.
> > https://doc.cgal.org/latest/Surface_sweep_2/index.html
> >
> > What steps would I have to take to obtain the the segments/curves
> > involed in the intersection?
> >
> > Kind Regards,
> > Benjamin
> >
> >
> >
> >
> > --
> > Sent from: http://cgal-discuss.949826.n4.nabble.com/
> >
> > --
> > 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.18.

Top of Page