Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Bugs in Alpha_shape_2 computation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Bugs in Alpha_shape_2 computation


Chronological Thread 
  • From: Benoît Presles <>
  • To:
  • Cc: "Sebastien Loriot (GeometryFactory)" <>
  • Subject: Re: [cgal-discuss] Bugs in Alpha_shape_2 computation
  • Date: Thu, 12 Aug 2010 01:48:37 +0200

Hello Everybody,

In my last email, I submitted you 2 problems I had with the "Alpha_shape_2" class. I still have the first problem but after some tests I realised that the results I obtained about the second problem were OK.
However, I still get some wrong results for some list of points (cf. attached file):
First test:
- I compute the alpha shape (GENERAL) with the optimal alpha value found with the function "find_optimal_alpha(1)" and I display on the screen the alpha edges. With such a value of alpha I should get a closed boundary, but instead I get this result:
Reading 13 points from file
Alpha Shape computed
Optimal alpha: 0.01
Nb of solid components: 1
0.3 0.2 0.2 0.2
0 0 0.1 0
0 0.2 0 0.1
0 0.1 0 0
0.2 0.2 0.1 0.2
0.1 0.2 0 0.2
0.1 0 0.1 0.1
0.4 0.1 0.4 0.2
0.4 0 0.4 0.1
0.3 0.1 0.3 0
0.4 0.2 0.3 0.2
0.3 0 0.4 0

Second test:
- I compute the alpha shape (GENERAL) with alpha=0.0025 and I display on the screen the alpha edges. With such a value of alpha I should get much more edges but instead I get this result:
Reading 13 points from file
Alpha Shape computed
Optimal alpha: 0.01
Nb of solid components: 0
0.3 0.2 0.2 0.2

Third test:
- I compute the alpha shape (GENERAL) with alpha=0.0026 and I display on the screen the alpha edges. With such a value of alpha I get too much edges:
Reading 13 points from file
Alpha Shape computed
Optimal alpha: 0.01
Nb of solid components: 0
0.3 0.2 0.2 0.2
0.3 0.1 0.3 0.2
0 0 0.1 0
0 0.2 0 0.1
0 0.1 0 0
0.2 0.2 0.1 0.2
0.1 0.2 0 0.2
0.1 0.1 0 0.1
0.1 0.1 0.1 0.2
0.1 0 0.1 0.1
0.4 0.1 0.4 0.2
0.4 0 0.4 0.1
0.3 0.1 0.3 0
0.4 0.2 0.3 0.2
0.4 0.1 0.3 0.1
0.3 0 0.4 0


Thank you for your help,
Best Regards,
Ben_P



Le 11 août 10 à 19:07, Benoît Presles a écrit :

Hello Everybody,

I use the latest patched version of CGAL and I think some bugs could be present in the "Alpha_shape_2" class (all problems can be reproduced by using the list of points "fin" attached in this email).

First problem:
- First, I use the function "find_optimal_alpha" to find the best alpha to get 1 connected component.
- Second, I set this alpha.
- Third, I use the function "number_of_solid_components" to get the number of solid components of A.
- Fourth, I compute the alpha edges which I display on the screen.

When I do this last step, I get a "CGAL::Assertion_exception":
Reading 6 points from file
Alpha Shape computed
Optimal alpha: 380.5
Nb of solid components: 1
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: (classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) == REGULAR)
File: /appli/include/CGAL/Alpha_shape_2.h
Line: 1170
Aborted

Second problem:
- First, I compute the alpha shape with alpha=50.
- Second, I compute the alpha edges which I display on the screen.

With such a value of alpha I should get the convex hull of the points, but instead I get this result:
Reading 6 points from file
0 0 1 0
1 0 2.5 0
2.5 0 4.5 0
4.5 0 7 0


Attached, you can fine the c++ code (basically the same as in the example) and a list of points for which the program doesn't work as expected (both problems).



Thank you for your help,
Best Regards,
Ben_P

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

<fin.txt><alphaShape.cpp>

Attachment: alphaShape.cpp
Description: Binary data

Attachment: fin
Description: Binary data




Archive powered by MHonArc 2.6.16.

Top of Page