Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] 3D Alpha Shape crash
- Date: Mon, 02 Dec 2013 09:57:24 +0100
- Organization: GeometryFactory
Could you provide a minimal example showing the pb so that I can try to reproduce the issue?
Also what is your platform and your compiler?
Sebastien.
On 11/29/2013 04:09 PM, mytien wrote:
Hello again,
today I tried the 5.1 and 5.3 examples of the 3D Alpha Shape documentation:
http://doc.cgal.org/latest/Alpha_shapes_3/index.html.
They worked fine for me. But when I use alpha shapes in my program, it
crashes as soon as execution reaches alpha shape code. Here is my relevant
code:
typedef CGAL::Exact_predicates_inexact_constructions_kernel Gt;
typedef CGAL::Alpha_shape_vertex_base_3<Gt> Vb;
typedef CGAL::Alpha_shape_cell_base_3<Gt> Fb;
typedef CGAL::Triangulation_data_structure_3<Vb,Fb> Tds;
typedef CGAL::Delaunay_triangulation_3<Gt,Tds> Triangulation_3;
typedef CGAL::Alpha_shape_3<Triangulation_3> AlphaShape;
typedef Gt::Point_3 CGAL_Point;
typedef AlphaShape::Facet CGAL_Facet;
typedef AlphaShape::Cell_handle Cell_handle;
typedef AlphaShape::Triangle CGAL_Triangle;
typedef AlphaShape::Alpha_iterator Alpha_iterator;
[...]
std::vector<floatCoordinate> pointCloud = pointCloudAsVector();
std::vector<CGAL_Point> points;
std::vector<floatCoordinate>::iterator piter;
for(piter = pointCloud.begin(); piter != pointCloud.end(); ++piter) {
CGAL_Point p = CGAL_Point(piter->x, piter->y, piter->z);
points.push_back(p);
}
AlphaShape as(points.begin(), points.end());
if(as.is_valid() == false) {
return false;
}
Alpha_iterator opt = as.find_optimal_alpha(1);
as.set_alpha(*opt); // CRASH
Also, if I omit the part of finding the optimal alpha and simply go on to
retrieving facets, it crashes too:
std::vector<CGAL_Facet> facets;
as.get_alpha_shape_facets(std::back_inserter(facets),
AlphaShape::SINGULAR); // CRASH
I know that my pointCloud and the conversion to CGAL points works, because I
can create 3D delaunay triangulations with them. Can you help me to fix this
problem?
kind regards
My-Tien
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/3D-Alpha-Shape-crash-tp4658493.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- Re: [cgal-discuss] 3D Alpha Shape crash, Sebastien Loriot (GeometryFactory), 12/02/2013
Archive powered by MHonArc 2.6.18.