Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Weighted Alpha shapes

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Weighted Alpha shapes


Chronological Thread 
  • From: Kathi Oe <>
  • To: Mael <>,
  • Subject: Re: [cgal-discuss] Weighted Alpha shapes
  • Date: Tue, 19 Jun 2018 16:57:23 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:k7dJJBYOD3HAO364VpK2zQv/LSx+4OfEezUN459isYplN5qZoMq4bnLW6fgltlLVR4KTs6sC17KL9fi4EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCa9bL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPCTQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjmk8qxlSgLniD0fOjAk8G/ZlMJwgqFVrh2vqBNwwZLbbZqPO/ZiZK7QZ88WSGRDU8tXSidPApm8b4wKD+cZOOhXtZX9p1sPrRCjHAejGv7kxzhLhnDswa060+UhEQbY0wE7ENIOtXvVoM/zNKgMTeC41a/FxijNYfNR3Dfy8onIchY5rPGDXLJwbcrRyVQ0GA/fklqQronlMjWI3eoOq2iW9/RsWf+xh2I9tQ19vDqiyt0xhoTLnI4Z1E3I+T1kzIsxK9C0UlN3bNy4HJdKqi2XN5V6TtkjTmxsvisx16cItoShfCcQzZQq3x7fZOKDc4iP+h/jUeGRISpkhH5/d7K/ghmz/VKmyuLiSsm4yFdKrixbndnQrn0ByQHf5tadRvdj4Eus2yyD2x3R5+1eP0w4iLLXK5s7zb4xkpoTv17DHijzmEjuj6+ZbFkk+uip6+TgfLrrvZCcN4p7iw3kNKQhhNC/DfwiMgcSR2ib5fi81Lr78ELlT7VFlPk2nrDEv5DbPsQUurO5AxRO0os48Ba+DzKm0MwCknUdLVJFfgiHj4nzNF3ULvD4F6T3v1P5tT5mw7iSO7TsBtPXKWXTnbOneb934UN0xwc0yN1D/YNaA7odJ+jiHET2sYqcRhQ2Ogjxz+f8A8hmzasfX3iOC+mXKvD8q1iNs8EmP+mNLKgY8GL+IuQl5vnjpXA8iRkbcLX/jshfU2yxAvkzexbRWnHrmNpUST5b7Dp7d/TjjRi5aRAWYn+zW6wm4TRqWo2jHcHFS5z/2eXdjhf+JYVfYyV9Mn7JCW3hJteLXudKbi+OcJc4z240EIO5Qopk7imA8Q/3z70+crjR/TAE853mxJ5z6vGBzRw=

Hello,

The weighted alpha shape computation works now (on this basic example) with CGAL 4.12. Thanks for your help, Mael. :)
I just wanted to mention some problems I encountered on the way. Switching from CGAL 4.10 to 4.12, my code initially did not work any more and I found the following reason: The Triangulation_vertex_base_with_info_2 class (as a basis for Alpha shapes or Delaunay triangulations) combined with the Exact_predicates_exact_constructions_kernel results in segfaults (which I could trace to the Hilbert spatial sorting procedure). Not using vertices with info OR using the inexact_constructions_kernel OR inserting the points one after the other (so that no spatial sorting is done) would work. I thought this might be interesting for others too.

Best,
Kathi


Am 08.06.2018 um 15:20 schrieb Kathi Oe:

Hello,

My CGAL-Version was 4.10. I will try to upgrade to CGAL 4.12 and see if it works.

Thanks for your help!
Kathi


Am 07.06.2018 um 12:47 schrieb Mael:

Hello,

What is your version of CGAL? There was a bug in AS_2 till not so long ago where it failed to use weights sometimes. As far as I remember the bug fix came with CGAL 4.12. With master, and the following test code, I get the following output:

Alpha Shape computed
4 alpha shape edges
Optimal alpha: 11.7899

Faces...
    face:
        2.5 5 4
        3 3 0
        4 5.7 16
    squared radius directly from the kernel: 6.06026
    compute with AS, sq_r: 6.06026
   

    face:
        3 3 0
        8 3 0
        4 5.7 16
    squared radius directly from the kernel: 11.7899
    AS sq_r: 11.7899

Alpha values
    value: 0.57046
    value: 1.79264
    value: 3.82369
    value: 6.06026
    value: 11.7899

which seem to be what you expect.

Mael

On 06/04/2018 05:03 PM, Kathi Oe wrote:
Hello,

I want to compute Alpha shapes of weighted points in 2D (and later 3D).
When I compare my own implementation with CGAL, I get very different results for the alpha values of the simplices.

I tried this basic example:
point 0: 4 5.7 weight 16
point 1: 2.5 5 weight 4
point 2: 3 3
point 3: 6 4 weight -9
point 4: 8 3

We get the triangles 012 and 024, which is fine.
They should have squared radius 6.06 and 11.79, but CGAL gives me 2.15 and 6.62. I don't know where these numbers come from.

Just to be clear, my definition for the weighted Alpha shape is the following:
A simplex is contained in the Alpha shape of radius r if the smallest sphere orthogonal to all its points (AB orthogonal if d(A,B)^2-weight_A-weight_B=0) has weight <= r^2.

For triangle 012 I compute
solve (4 - x)^2 + (5.7 - y)^2 - 16 - w = 0, (2.5 - x)^2 + (5 - y)^2 -  4 - w = 0, (3 - x)^2 + (3 - y)^2 - 0 - w = 0
to get the center (x,y) and weight/radius^2 w of this weighted circumsphere, which indeed gives w=6.06...
Why is the alpha value in CGAL 2.15? The correct value does not even appear in the list of alpha values (which are 0.685 1.0625 2.15052 5.8225 6.25 6.6212).

Did I understand something wrong about how to use alpha shapes in CGAL?

Thanks for your help,
Kathi








Archive powered by MHonArc 2.6.18.

Top of Page