Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Bugs in Alpha_shape_2 computation
- Date: Thu, 12 Aug 2010 09:01:57 +0200
If I remember correctly, the range
[alpha_shape_edges_begin,_end] is over regular edges in Regularized mode,
and singular and regular edges in general mode (it gives you the alpha-shape which is the boundary of the alpha-complex)
So interior edges are not displayed.
You this function so get the classifications:
void
alpha_edges( const Alpha_shape_2& A)
{
int r=0,s=0,i=0,e=0;
for(Alpha_shape_2::Finite_edges_iterator it = A.finite_edges_begin();
it != A.finite_edges_end();
++it)
{
switch ( A.classify(*it) )
{
case Alpha_shape_2::REGULAR: ++r; break;
case Alpha_shape_2::SINGULAR: ++s; break;
case Alpha_shape_2::EXTERIOR: ++e; break;
case Alpha_shape_2::INTERIOR: ++i; break;
}
}
std::cout << "EIRS " << e << " " << i << " "<< r << " " << s << std::endl;
}
S.
Benoît Presles wrote:
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>
- [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/11/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/12/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Sebastien Loriot (GeometryFactory), 08/12/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/12/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Sebastien Loriot (GeometryFactory), 08/13/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/13/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Sebastien Loriot (GeometryFactory), 08/16/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/16/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/17/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Sebastien Loriot (GeometryFactory), 08/17/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/18/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Sebastien Loriot (GeometryFactory), 08/16/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/13/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Sebastien Loriot (GeometryFactory), 08/13/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/12/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Sebastien Loriot (GeometryFactory), 08/12/2010
- Re: [cgal-discuss] Bugs in Alpha_shape_2 computation, Benoît Presles, 08/12/2010
Archive powered by MHonArc 2.6.16.