Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL alpha shape example - segmentation fault

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL alpha shape example - segmentation fault


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL alpha shape example - segmentation fault
  • Date: Sun, 20 Nov 2016 19:09:22 +0100 (CET)

On Sun, 20 Nov 2016, irene89 wrote:

Hi everybody, I'm new to C++ and CGAL. I'm tryng to obtain an alpha shape
from a point set in the plane and to do that I was first trying to run the
following example:

http://doc.cgal.org/latest/Alpha_shapes_2/Alpha_shapes_2_2ex_alpha_shapes_2_8cpp-example.html

with this set of point:
(0,2), (-0.5,1), (0,1), (0.5,1), (-2,0), (-1,0), (0,0), (1,0), (2,0),
(-0.5,-1), (0,-1), (0.5,-1), (0,-2)

The points are saved in a file data.txt with the same exact format above and
this file is in the same directory of the .cpp. Obviously I changed the line
in the example

std::ifstream is("./data/fin", std::ios::in);

with the line

std::ifstream is("data.txt", std::ios::in);

Did you look at the file data/fin that you are replacing? It is formatted completely differently from your file...
"Reading 0 points from file" is a strong hint that you need to take a closer look at the file. It should look like:

13
0 2
-0.5 1
...

--
Marc Glisse



Archive powered by MHonArc 2.6.18.

Top of Page