Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Alpha_shape_2 with info

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Alpha_shape_2 with info


Chronological Thread 
  • From: Asher Kamiraze <>
  • To:
  • Subject: Re: [cgal-discuss] Alpha_shape_2 with info
  • Date: Fri, 27 May 2011 15:06:27 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=R1kpeDclLFMSDszbWFab7NstB+Sk/vnJu+W7bnFYvJMelzvbA2hNPDXa+zelrvEHdj aNqzk41ZltHxvuaWkFbbJnQzA4DCgAywHw80tUTT5YF5b8c/s0E+muuf1qVt4dnPYy2o pO354CPE1JHCjt63uQTPlPD6vxLiiHIWGSc7E=

Thanks,

But ...

2011/5/27 Sebastien Loriot (GeometryFactory) <sloriot.ml@gmail.com>
Asher Kamiraze wrote:
Mariette, Sebastien,

Thank you, it works well. I am now facing another problem. I would like to iterate over the *ordered *boundary vertices of the computer alpha-shape, but I cannot figure how to do it.

You recently answered a similar question, but I do not understand your solution:

"Iterate over REGULAR edges and build the graph of vertices.
 From this you should be able to get the contour. You might also
might consider SINGULAR edges to get antennas".

How do you build the graph of vertices?
You have a set of vertices and a set of edges.

Use a std::map<Vertex_handle,std::vector<Vertex_handle> > or whatever
classical solution to build the graph.

How can I get a Vertex_handle from a REGULAR edge? I only found the segment(...) method in Triangulation_2.

Asher
 


>What if I want to build a 3D polyline with the boundary vertices?
A polyline is a 2D graph so I don't see the problem.

S.


Hope you could help.

Regards,

Asher

2011/5/19 Sebastien Loriot (GeometryFactory) <sloriot.ml <http://sloriot.ml>@gmail.com <http://gmail.com>>

   Sorry this is this that I posted in my first
   mail + setting Infinity to -1 and UNDEFINED to -2
   (that you are missing here).

   S.


   Asher Kamiraze wrote:

       Thank you Sebastien

       I finally did that and it seems to work:

        Alpha_shape_2(Dt& dt, NT alpha = 0, Mode m = REGULARIZED)
            :_alpha(alpha), _mode(m),       use_vertex_cache(false),
       use_edge_cache(false)
        {
            Dt::swap(dt);
            if (dimension() == 2)
            {
                // Compute the associated _interval_face_map
                initialize_interval_face_map();

                // Compute the associated _interval_edge_map
                initialize_interval_edge_map();

                // Compute the associated _interval_vertex_map
                initialize_interval_vertex_map();

                // merge the two maps
                initialize_alpha_spectrum();
            }
        }

       Thank you for your help.

       Regards,

       Asher

       2011/5/19 Sebastien Loriot (GeometryFactory) <sloriot.ml
       <http://sloriot.ml> <http://sloriot.ml>@gmail.com
       <http://gmail.com> <http://gmail.com>>



          Asher Kamiraze wrote:

              OK. May this simple hack inspired from the 3D version
       will work?


          That's what I did too.


          S.


               Alpha_shape_2(Dt& dt, NT alpha = 0, Mode m = REGULARIZED)
                 :_alpha(alpha), _mode(m),     use_vertex_cache(false),
              use_facet_cache(false)
                 {
                   Dt::swap(dt);
                   if (dimension() == 2) initialize_alpha();
                 }

              Regards,

              Asher

              2011/5/19 Mariette Yvinec <
       <mailto:>
              <mailto:
       <mailto:>>
              <mailto:
       <mailto:>
       <mailto:
       <mailto:>>>>



                 I see ...
                 In 3D you may construct  the Alpha_shape from the
       Triangulation
                 so that you can enter your vertices wih their info
                 in the triangulation and then build the Alpha_shape
       from the
                 triangulation.

                 In 2D, such a constructor does not seem to exist.
                 Obviously, we should add it.

                 Regards,
                 Mariette


                 Le 19/05/11 15:52, Asher Kamiraze a écrit :

                     Hi,

                     2011/5/19 Mariette Yvinec
       < <mailto:>
                  <mailto:
       <mailto:>>
                     <mailto:
       <mailto:>
                  <mailto:
       <mailto:>>>>


                         push_back should be private too.


                     Yes, that's what I thought.
                                        If you use push_back,
                          the triangulation will be updated but not the
                  alpha_shapes...

                         I don't see any problem in what you propose.


                     Since I can use neither push_back nor insert, how
       can I
                  attach
                     info to a vertex?
                     If it is a triangulation, I add a point and get
       the returned
                     vertex, then attach the info on it. With alpha
       shapes, I
                  have to
                     give as input a range of points, and do not know
       how to
                  attach
                     info of the resulting vertices.

                     Regards,

                     Asher



                         Le 19/05/11 12:46, Asher Kamiraze a écrit :

                             Hi all,

                             Is there a way to build an alpha_shape_2
       with info?
                             Something similar to a triangulation with
       info.
                             I have also noticed that insert() is
       private in
                             alpha_shape_2, but, push_back is not.
       Isn't it a
                  problem?

                             Here is what I am trying to do:


                                typedef
                                    CGAL::Exact_predicates_exact_constructions_kernel
                                                   K;

                                struct vertex_info { Point point3d; };
                                struct face_info {};

                                typedef
                                               CGAL::Triangulation_vertex_base_with_info_2<vertex_info,K>
                                          Vb_2;
                                typedef
                                               CGAL::Constrained_triangulation_face_base_with_info_2<face_info,K>
                                  Fb_2;

                                typedef CGAL::Alpha_shape_vertex_base_2<K,
                  Vb_2> Vb;
                                typedef
       CGAL::Alpha_shape_face_base_2<K, Fb_2>
                   Fb;

                                typedef
                  CGAL::Triangulation_data_structure_2<Vb,Fb>                                                      TDS_2;
                                typedef CGAL::Delaunay_triangulation_2<K  ,
                  TDS_2>                                         DT_2;

                                typedef CGAL::Alpha_shape_2<DT_2>
       Alpha_shape_2;


                                        Alpha_shape_2 alpha_shape(0.5);
                                        // How to insert points in
       alpha_shape
                  with
                             attached info?

                             Hope you could help

                             Best regards

                             Asher


                         --         Mariette Yvinec
                         Geometrica project team
                         INRIA  Sophia-Antipolis




                         --         You are currently subscribed to
       cgal-discuss.
                         To unsubscribe or access the archives, go to
                         https://lists-sop.inria.fr/wws/info/cgal-discuss



                 --     Mariette Yvinec
                 Geometrica project team
                 INRIA  Sophia-Antipolis  



          --     You are currently subscribed to cgal-discuss.
          To unsubscribe or access the archives, go to
          https://lists-sop.inria.fr/wws/info/cgal-discuss




   --     You are currently subscribed to cgal-discuss.
   To unsubscribe or access the archives, go to
   https://lists-sop.inria.fr/wws/info/cgal-discuss




--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss





Archive powered by MHonArc 2.6.16.

Top of Page