Segment Intersection to form cell decomposition

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Segment Intersection to form cell decomposition

Anne
HI,

Could you please give a suggestion for the task that:
- I have a list of line segments. I need to find out faces (cells) generated
by intersecting the segments. Could you suggest me which functions should I
use to implement the cell decomposition by intersecting lines and get
information of the cells (faces, vertices, edges) .

- Is it possible to achieve adjacent relation between cells (for instance,
cells i is in adjacent (neighbour) with ceill j,k, m etc)?

Could you please suggest which package and function should I use to complete
this task? I am new to CGAL. Thank you so much. I appreciate any comment &
suggestion.

Best regards,
Anne



--
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


Reply | Threaded
Open this post in threaded view
|

Re: Segment Intersection to form cell decomposition

Sebastien Loriot (GeometryFactory)
IIUC your problem you can use the arrangement package:

https://doc.cgal.org/latest/Arrangement_on_surface_2/

by considering the unbounded face.

Here is a small example on how to iterator over halfedges of the holes
of the unbounded face.

https://gist.github.com/sloriot/5a2f69951c8902948392c9368cc23ab4

Sebastien.



On 06/11/2018 04:15 PM, Anne wrote:

> HI,
>
> Could you please give a suggestion for the task that:
> - I have a list of line segments. I need to find out faces (cells) generated
> by intersecting the segments. Could you suggest me which functions should I
> use to implement the cell decomposition by intersecting lines and get
> information of the cells (faces, vertices, edges) .
>
> - Is it possible to achieve adjacent relation between cells (for instance,
> cells i is in adjacent (neighbour) with ceill j,k, m etc)?
>
> Could you please suggest which package and function should I use to complete
> this task? I am new to CGAL. Thank you so much. I appreciate any comment &
> suggestion.
>
> Best regards,
> Anne
>
>
>
> --
> 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


Reply | Threaded
Open this post in threaded view
|

Re: Segment Intersection to form cell decomposition

Anne
I got it. I give it a try. Thank you so much.



--
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


Reply | Threaded
Open this post in threaded view
|

Re: Segment Intersection to form cell decomposition

Anne
This post was updated on .
In reply to this post by Sebastien Loriot (GeometryFactory)
Is there anyway to extract the vertices (in order clockwise or counter
clockwise) for each of the holes (cells)? I have tried the code with five
segments (as given in the code sample) and it just produce only one hole (As
I imagine, it should produce ~ 7 holes in total) (please refer to the Figure 1).

For example, I insert an image here for better explanation about my problem,
could you suggest the way to get the vertices & edges for each bounded faces
(e.g., F1, F2,F3,F4) which formed by intersecting the line Segments (1, 2,
...,6) (Please refer to the Figure 2)
Thank you.
Figure 1:

Figure 2:
<http://cgal-discuss.949826.n4.nabble.com/file/t375966/cell_decomposition.jpg



--
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


Reply | Threaded
Open this post in threaded view
|

Re: Segment Intersection to form cell decomposition

Sebastien Loriot (GeometryFactory)
I understood that you were only interested in the unbounded face.
But if you iterator over all the faces of the arrangement you can also
get bounded faces.

Something like:

   Face_const_iterator fit;
   std::cout << arr.number_of_faces() << " faces:" << std::endl;
   for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit)
   {

   }

Sebastien.

On 06/13/2018 05:06 AM, Anne wrote:

> Is there anyway to extract the vertices (in order clockwise or counter
> clockwise) for each of the holes (cells)? I have tried the code with five
> segments (as given in the code sample) and it just produce only one hole (As
> I imagine, it should produce ~ 7 holes in total).
>
> For example, I insert an image here for better explanation about my problem,
> could you suggest the way to get the vertices & edges for each bounded faces
> (e.g., F1, F2,F3,F4) which formed by intersecting the line Segments (1, 2,
> ...,6)
> Thank you.
> <http://cgal-discuss.949826.n4.nabble.com/file/t375966/cell_decomposition.jpg>
>
>
>
> --
> 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


Reply | Threaded
Open this post in threaded view
|

Re: Segment Intersection to form cell decomposition

Anne
This post was updated on .
Thanks. any function in CGAL can directly extract the adjacent relation
between the bounded faces?  I appreciate your help.



--
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


Reply | Threaded
Open this post in threaded view
|

Re: Segment Intersection to form cell decomposition

Sebastien Loriot (GeometryFactory)
It is based on a halfedge data structure. So the boundary of each face
is a sequence of halfedges and adjacent faces share opposite halfedges.
Everything is written in the manual.

Sebastien.

On 06/15/2018 10:01 AM, Anne wrote:
> Thanks. any function in CGAL can help to extract the adjacent relation
> between the bounded faces? I appreciate your help.
>
>
>
> --
> 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