Cannot read my data file in off format

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot read my data file in off format

Shrabani Ghosh
Hi Users,

I am edge_collapse_surface_mesh to decimate triangles , I tried with few
data from cgal it works properly.
size 07338
Finished...
7338 edges removed.
999 final edges.


But when I am using one of my skull data which I converted from vtk to off
format using meshlab, in that case, the surface mesh can read the file but
cannot calculate even number of edges.
size 00
Finished...
0 edges removed.
0 final edges.

Which is that happening so? I have attached my file here.




Please suggest me how to fix the problem.

holes_tri.off
<http://cgal-discuss.949826.n4.nabble.com/file/t376134/holes_tri.off>  



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

MaelRL

Hello,

Your mesh does not describe a valid polygon mesh because it is not properly oriented. You should first load it as a polygon soup using "CGAL::read_OFF()":

std::vector<Point_3> points;
std::vector<std::vector<std::size_t> > triangles;
CGAL::read_OFF(istream, points, triangles);

and then orienting it properly with orient_polygon_soup() and polygon_soup_to_polygon_mesh().

Here it is properly oriented and saved as a polygon mesh: https://gist.github.com/MaelRL/1667b4d1f655f44f41ba7f839c79f1bf

Best,
Mael

 31/07/2019 19:32, Shrabani Ghosh wrote:
Hi Users,

I am edge_collapse_surface_mesh to decimate triangles , I tried with few
data from cgal it works properly. 
size 07338
Finished...
7338 edges removed.
999 final edges.


But when I am using one of my skull data which I converted from vtk to off
format using meshlab, in that case, the surface mesh can read the file but
cannot calculate even number of edges.
size 00
Finished...
0 edges removed.
0 final edges.

Which is that happening so? I have attached my file here. 




Please suggest me how to fix the problem. 

holes_tri.off
<http://cgal-discuss.949826.n4.nabble.com/file/t376134/holes_tri.off>  



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Shrabani Ghosh
Excellent!! Thank You very much. Is that possible to do something so that all
the sizes of the triangles will have a uniform size?

I am referring to this link.

https://doc.cgal.org/latest/Polygon_mesh_processing/index.html



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

andreas.fabri
Look for isotropic remeshing

> On 31 Jul 2019, at 11:34, Shrabani Ghosh <[hidden email]> wrote:
>
> Excellent!! Thank You very much. Is that possible to do something so that all
> the sizes of the triangles will have a uniform size?
>
> I am referring to this link.
>
> https://doc.cgal.org/latest/Polygon_mesh_processing/index.html
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>


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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Shrabani Ghosh
In reply to this post by MaelRL
HI,

I was able to use my surface mesh by changing the orientation. But now I
have a surface mesh which is a bigger one, and when I am trying to change
the orientation, I am not able to do that. After some time, it showing
segmentation fault. How to solve this problem?






--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Sebastien Loriot (GeometryFactory)
What are you using precisely?

CGAL::Polygon_mesh_processing::reverse_face_orientations()?

How is the mesh read? You should post your code on gist.github.com
and the data set there, it would be easier to help you.

Sebastien.

On 9/12/19 5:48 PM, Shrabani Ghosh wrote:

> HI,
>
> I was able to use my surface mesh by changing the orientation. But now I
> have a surface mesh which is a bigger one, and when I am trying to change
> the orientation, I am not able to do that. After some time, it showing
> segmentation fault. How to solve this problem?
>
>
>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Shrabani Ghosh
CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh); //// this function is not working.
{
  const char* filename = (argc > 1) ? argv[1] : "../data/output_newvolume_bones.off";
  std::ifstream input(filename);
  std::vector<K::Point_3> points;
  std::vector<std::vector<std::size_t> > polygons;
  if(!input || !CGAL::read_OFF(input, points, polygons) || points.empty())
  {
    std::cerr << "Cannot open file " << std::endl;
    return EXIT_FAILURE;
  }
  CGAL::Polygon_mesh_processing::orient_polygon_soup(points, polygons);
  Polyhedron mesh;
  CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, polygons, mesh);
  // Number the faces because 'orient_to_bound_a_volume' needs a face <--> index map
  int index = 0;
  for(Polyhedron::Face_iterator fb=mesh.facets_begin(), fe=mesh.facets_end(); fb!=fe; ++fb)
    fb->id() = index++;
  if(CGAL::is_closed(mesh))
    CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
  std::ofstream out("../data/output_newvolume_bones_orient.off");
  out << mesh;
  out.close();
  return EXIT_SUCCESS;
}

On Thu, Sep 12, 2019 at 3:03 PM Sebastien Loriot (GeometryFactory) <[hidden email]> wrote:
What are you using precisely?

CGAL::Polygon_mesh_processing::reverse_face_orientations()?

How is the mesh read? You should post your code on gist.github.com
and the data set there, it would be easier to help you.

Sebastien.

On 9/12/19 5:48 PM, Shrabani Ghosh wrote:
> HI,
>
> I was able to use my surface mesh by changing the orientation. But now I
> have a surface mesh which is a bigger one, and when I am trying to change
> the orientation, I am not able to do that. After some time, it showing
> segmentation fault. How to solve this problem?
>
>
>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Sebastien Loriot (GeometryFactory)
The code looks correct. Can you share the input file?
(please upload it somewhere to avoid sending a large file
to all subscribers).

Sebastien.

On 9/12/19 9:13 PM, Shrabani Ghosh wrote:

> CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh); //// this
> function is not working.
> {
>    const char* filename = (argc > 1) ? argv[1] :
> "../data/output_newvolume_bones.off";
>    std::ifstream input(filename);
>    std::vector<K::Point_3> points;
>    std::vector<std::vector<std::size_t> > polygons;
>    if(!input || !CGAL::read_OFF(input, points, polygons) || points.empty())
>    {
>      std::cerr << "Cannot open file " << std::endl;
>      return EXIT_FAILURE;
>    }
>    CGAL::Polygon_mesh_processing::orient_polygon_soup(points, polygons);
>    Polyhedron mesh;
>    CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points,
> polygons, mesh);
>    // Number the faces because 'orient_to_bound_a_volume' needs a face
> <--> index map
>    int index = 0;
>    for(Polyhedron::Face_iterator fb=mesh.facets_begin(),
> fe=mesh.facets_end(); fb!=fe; ++fb)
>      fb->id() = index++;
>    if(CGAL::is_closed(mesh))
>      CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
>    std::ofstream out("../data/output_newvolume_bones_orient.off");
>    out << mesh;
>    out.close();
>    return EXIT_SUCCESS;
> }
>
> On Thu, Sep 12, 2019 at 3:03 PM Sebastien Loriot (GeometryFactory)
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     What are you using precisely?
>
>     CGAL::Polygon_mesh_processing::reverse_face_orientations()?
>
>     How is the mesh read? You should post your code on gist.github.com
>     <http://gist.github.com>
>     and the data set there, it would be easier to help you.
>
>     Sebastien.
>
>     On 9/12/19 5:48 PM, Shrabani Ghosh wrote:
>      > HI,
>      >
>      > I was able to use my surface mesh by changing the orientation.
>     But now I
>      > have a surface mesh which is a bigger one, and when I am trying
>     to change
>      > the orientation, I am not able to do that. After some time, it
>     showing
>      > segmentation fault. How to solve this problem?
>      >
>      >
>      >
>      >
>      >
>      >
>      > --
>      > Sent from: http://cgal-discuss.949826.n4.nabble.com/
>      >
>
>     --
>     You are currently subscribed to cgal-discuss.
>     To unsubscribe or access the archives, go to
>     https://sympa.inria.fr/sympa/info/cgal-discuss
>
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Shrabani Ghosh
Thank You. Here it is. 

On Thu, Sep 12, 2019 at 3:39 PM Sebastien Loriot (GeometryFactory) <[hidden email]> wrote:
The code looks correct. Can you share the input file?
(please upload it somewhere to avoid sending a large file
to all subscribers).

Sebastien.

On 9/12/19 9:13 PM, Shrabani Ghosh wrote:
> CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh); //// this
> function is not working.
> {
>    const char* filename = (argc > 1) ? argv[1] :
> "../data/output_newvolume_bones.off";
>    std::ifstream input(filename);
>    std::vector<K::Point_3> points;
>    std::vector<std::vector<std::size_t> > polygons;
>    if(!input || !CGAL::read_OFF(input, points, polygons) || points.empty())
>    {
>      std::cerr << "Cannot open file " << std::endl;
>      return EXIT_FAILURE;
>    }
>    CGAL::Polygon_mesh_processing::orient_polygon_soup(points, polygons);
>    Polyhedron mesh;
>    CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points,
> polygons, mesh);
>    // Number the faces because 'orient_to_bound_a_volume' needs a face
> <--> index map
>    int index = 0;
>    for(Polyhedron::Face_iterator fb=mesh.facets_begin(),
> fe=mesh.facets_end(); fb!=fe; ++fb)
>      fb->id() = index++;
>    if(CGAL::is_closed(mesh))
>      CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
>    std::ofstream out("../data/output_newvolume_bones_orient.off");
>    out << mesh;
>    out.close();
>    return EXIT_SUCCESS;
> }
>
> On Thu, Sep 12, 2019 at 3:03 PM Sebastien Loriot (GeometryFactory)
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     What are you using precisely?
>
>     CGAL::Polygon_mesh_processing::reverse_face_orientations()?
>
>     How is the mesh read? You should post your code on gist.github.com
>     <http://gist.github.com>
>     and the data set there, it would be easier to help you.
>
>     Sebastien.
>
>     On 9/12/19 5:48 PM, Shrabani Ghosh wrote:
>      > HI,
>      >
>      > I was able to use my surface mesh by changing the orientation.
>     But now I
>      > have a surface mesh which is a bigger one, and when I am trying
>     to change
>      > the orientation, I am not able to do that. After some time, it
>     showing
>      > segmentation fault. How to solve this problem?
>      >
>      >
>      >
>      >
>      >
>      >
>      > --
>      > Sent from: http://cgal-discuss.949826.n4.nabble.com/
>      >
>
>     --
>     You are currently subscribed to cgal-discuss.
>     To unsubscribe or access the archives, go to
>     https://sympa.inria.fr/sympa/info/cgal-discuss
>
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Sebastien Loriot (GeometryFactory)
I can't reproduce the issue with master and CGAL-4.13.

What version are you using?

Could you run the debugger and point to the line where the segfault occur?

Thanks,

Sebastien.

On 9/12/19 9:49 PM, Shrabani Ghosh wrote:

> Thank You. Here it is.
> output_newvolume_bones.off
> <https://drive.google.com/file/d/1UqJWdpvHaHYP7no2T3DW7vYUya3AtTs1/view?usp=drive_web>
>
>
> On Thu, Sep 12, 2019 at 3:39 PM Sebastien Loriot (GeometryFactory)
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     The code looks correct. Can you share the input file?
>     (please upload it somewhere to avoid sending a large file
>     to all subscribers).
>
>     Sebastien.
>
>     On 9/12/19 9:13 PM, Shrabani Ghosh wrote:
>      > CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
>     //// this
>      > function is not working.
>      > {
>      >    const char* filename = (argc > 1) ? argv[1] :
>      > "../data/output_newvolume_bones.off";
>      >    std::ifstream input(filename);
>      >    std::vector<K::Point_3> points;
>      >    std::vector<std::vector<std::size_t> > polygons;
>      >    if(!input || !CGAL::read_OFF(input, points, polygons) ||
>     points.empty())
>      >    {
>      >      std::cerr << "Cannot open file " << std::endl;
>      >      return EXIT_FAILURE;
>      >    }
>      >    CGAL::Polygon_mesh_processing::orient_polygon_soup(points,
>     polygons);
>      >    Polyhedron mesh;
>      >  
>     CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points,
>      > polygons, mesh);
>      >    // Number the faces because 'orient_to_bound_a_volume' needs a
>     face
>      > <--> index map
>      >    int index = 0;
>      >    for(Polyhedron::Face_iterator fb=mesh.facets_begin(),
>      > fe=mesh.facets_end(); fb!=fe; ++fb)
>      >      fb->id() = index++;
>      >    if(CGAL::is_closed(mesh))
>      >      CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
>      >    std::ofstream out("../data/output_newvolume_bones_orient.off");
>      >    out << mesh;
>      >    out.close();
>      >    return EXIT_SUCCESS;
>      > }
>      >
>      > On Thu, Sep 12, 2019 at 3:03 PM Sebastien Loriot (GeometryFactory)
>      > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >
>      >     What are you using precisely?
>      >
>      >     CGAL::Polygon_mesh_processing::reverse_face_orientations()?
>      >
>      >     How is the mesh read? You should post your code on
>     gist.github.com <http://gist.github.com>
>      >     <http://gist.github.com>
>      >     and the data set there, it would be easier to help you.
>      >
>      >     Sebastien.
>      >
>      >     On 9/12/19 5:48 PM, Shrabani Ghosh wrote:
>      >      > HI,
>      >      >
>      >      > I was able to use my surface mesh by changing the orientation.
>      >     But now I
>      >      > have a surface mesh which is a bigger one, and when I am
>     trying
>      >     to change
>      >      > the orientation, I am not able to do that. After some time, it
>      >     showing
>      >      > segmentation fault. How to solve this problem?
>      >      >
>      >      >
>      >      >
>      >      >
>      >      >
>      >      >
>      >      > --
>      >      > Sent from: http://cgal-discuss.949826.n4.nabble.com/
>      >      >
>      >
>      >     --
>      >     You are currently subscribed to cgal-discuss.
>      >     To unsubscribe or access the archives, go to
>      > https://sympa.inria.fr/sympa/info/cgal-discuss
>      >
>      >
>
>     --
>     You are currently subscribed to cgal-discuss.
>     To unsubscribe or access the archives, go to
>     https://sympa.inria.fr/sympa/info/cgal-discuss
>
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Shrabani Ghosh
Yes,

I am getting segmentation fault for this line. 
CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh); 

On Thu, Sep 12, 2019 at 4:27 PM Sebastien Loriot (GeometryFactory) <[hidden email]> wrote:
I can't reproduce the issue with master and CGAL-4.13.

What version are you using?

Could you run the debugger and point to the line where the segfault occur?

Thanks,

Sebastien.

On 9/12/19 9:49 PM, Shrabani Ghosh wrote:
> Thank You. Here it is.
> output_newvolume_bones.off
> <https://drive.google.com/file/d/1UqJWdpvHaHYP7no2T3DW7vYUya3AtTs1/view?usp=drive_web>
>
>
> On Thu, Sep 12, 2019 at 3:39 PM Sebastien Loriot (GeometryFactory)
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     The code looks correct. Can you share the input file?
>     (please upload it somewhere to avoid sending a large file
>     to all subscribers).
>
>     Sebastien.
>
>     On 9/12/19 9:13 PM, Shrabani Ghosh wrote:
>      > CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
>     //// this
>      > function is not working.
>      > {
>      >    const char* filename = (argc > 1) ? argv[1] :
>      > "../data/output_newvolume_bones.off";
>      >    std::ifstream input(filename);
>      >    std::vector<K::Point_3> points;
>      >    std::vector<std::vector<std::size_t> > polygons;
>      >    if(!input || !CGAL::read_OFF(input, points, polygons) ||
>     points.empty())
>      >    {
>      >      std::cerr << "Cannot open file " << std::endl;
>      >      return EXIT_FAILURE;
>      >    }
>      >    CGAL::Polygon_mesh_processing::orient_polygon_soup(points,
>     polygons);
>      >    Polyhedron mesh;
>      >   
>     CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points,
>      > polygons, mesh);
>      >    // Number the faces because 'orient_to_bound_a_volume' needs a
>     face
>      > <--> index map
>      >    int index = 0;
>      >    for(Polyhedron::Face_iterator fb=mesh.facets_begin(),
>      > fe=mesh.facets_end(); fb!=fe; ++fb)
>      >      fb->id() = index++;
>      >    if(CGAL::is_closed(mesh))
>      >      CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
>      >    std::ofstream out("../data/output_newvolume_bones_orient.off");
>      >    out << mesh;
>      >    out.close();
>      >    return EXIT_SUCCESS;
>      > }
>      >
>      > On Thu, Sep 12, 2019 at 3:03 PM Sebastien Loriot (GeometryFactory)
>      > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >
>      >     What are you using precisely?
>      >
>      >     CGAL::Polygon_mesh_processing::reverse_face_orientations()?
>      >
>      >     How is the mesh read? You should post your code on
>     gist.github.com <http://gist.github.com>
>      >     <http://gist.github.com>
>      >     and the data set there, it would be easier to help you.
>      >
>      >     Sebastien.
>      >
>      >     On 9/12/19 5:48 PM, Shrabani Ghosh wrote:
>      >      > HI,
>      >      >
>      >      > I was able to use my surface mesh by changing the orientation.
>      >     But now I
>      >      > have a surface mesh which is a bigger one, and when I am
>     trying
>      >     to change
>      >      > the orientation, I am not able to do that. After some time, it
>      >     showing
>      >      > segmentation fault. How to solve this problem?
>      >      >
>      >      >
>      >      >
>      >      >
>      >      >
>      >      >
>      >      > --
>      >      > Sent from: http://cgal-discuss.949826.n4.nabble.com/
>      >      >
>      >
>      >     --
>      >     You are currently subscribed to cgal-discuss.
>      >     To unsubscribe or access the archives, go to
>      > https://sympa.inria.fr/sympa/info/cgal-discuss
>      >
>      >
>
>     --
>     You are currently subscribed to cgal-discuss.
>     To unsubscribe or access the archives, go to
>     https://sympa.inria.fr/sympa/info/cgal-discuss
>
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Sebastien Loriot (GeometryFactory)
I meant within this function.

Sebastien.

On 9/12/19 10:24 PM, Shrabani Ghosh wrote:

> Yes,
>
> I am getting segmentation fault for this line.
> CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
>
> On Thu, Sep 12, 2019 at 4:27 PM Sebastien Loriot (GeometryFactory)
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     I can't reproduce the issue with master and CGAL-4.13.
>
>     What version are you using?
>
>     Could you run the debugger and point to the line where the segfault
>     occur?
>
>     Thanks,
>
>     Sebastien.
>
>     On 9/12/19 9:49 PM, Shrabani Ghosh wrote:
>      > Thank You. Here it is.
>      > output_newvolume_bones.off
>      >
>     <https://drive.google.com/file/d/1UqJWdpvHaHYP7no2T3DW7vYUya3AtTs1/view?usp=drive_web>
>      >
>      >
>      > On Thu, Sep 12, 2019 at 3:39 PM Sebastien Loriot (GeometryFactory)
>      > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >
>      >     The code looks correct. Can you share the input file?
>      >     (please upload it somewhere to avoid sending a large file
>      >     to all subscribers).
>      >
>      >     Sebastien.
>      >
>      >     On 9/12/19 9:13 PM, Shrabani Ghosh wrote:
>      >      > CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
>      >     //// this
>      >      > function is not working.
>      >      > {
>      >      >    const char* filename = (argc > 1) ? argv[1] :
>      >      > "../data/output_newvolume_bones.off";
>      >      >    std::ifstream input(filename);
>      >      >    std::vector<K::Point_3> points;
>      >      >    std::vector<std::vector<std::size_t> > polygons;
>      >      >    if(!input || !CGAL::read_OFF(input, points, polygons) ||
>      >     points.empty())
>      >      >    {
>      >      >      std::cerr << "Cannot open file " << std::endl;
>      >      >      return EXIT_FAILURE;
>      >      >    }
>      >      >    CGAL::Polygon_mesh_processing::orient_polygon_soup(points,
>      >     polygons);
>      >      >    Polyhedron mesh;
>      >      >
>      >  
>       CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points,
>      >      > polygons, mesh);
>      >      >    // Number the faces because 'orient_to_bound_a_volume'
>     needs a
>      >     face
>      >      > <--> index map
>      >      >    int index = 0;
>      >      >    for(Polyhedron::Face_iterator fb=mesh.facets_begin(),
>      >      > fe=mesh.facets_end(); fb!=fe; ++fb)
>      >      >      fb->id() = index++;
>      >      >    if(CGAL::is_closed(mesh))
>      >      >    
>     CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
>      >      >    std::ofstream
>     out("../data/output_newvolume_bones_orient.off");
>      >      >    out << mesh;
>      >      >    out.close();
>      >      >    return EXIT_SUCCESS;
>      >      > }
>      >      >
>      >      > On Thu, Sep 12, 2019 at 3:03 PM Sebastien Loriot
>     (GeometryFactory)
>      >      > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>
>      >     <mailto:[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>>> wrote:
>      >      >
>      >      >     What are you using precisely?
>      >      >
>      >      >  
>       CGAL::Polygon_mesh_processing::reverse_face_orientations()?
>      >      >
>      >      >     How is the mesh read? You should post your code on
>      > gist.github.com <http://gist.github.com> <http://gist.github.com>
>      >      >     <http://gist.github.com>
>      >      >     and the data set there, it would be easier to help you.
>      >      >
>      >      >     Sebastien.
>      >      >
>      >      >     On 9/12/19 5:48 PM, Shrabani Ghosh wrote:
>      >      >      > HI,
>      >      >      >
>      >      >      > I was able to use my surface mesh by changing the
>     orientation.
>      >      >     But now I
>      >      >      > have a surface mesh which is a bigger one, and when
>     I am
>      >     trying
>      >      >     to change
>      >      >      > the orientation, I am not able to do that. After
>     some time, it
>      >      >     showing
>      >      >      > segmentation fault. How to solve this problem?
>      >      >      >
>      >      >      >
>      >      >      >
>      >      >      >
>      >      >      >
>      >      >      >
>      >      >      > --
>      >      >      > Sent from: http://cgal-discuss.949826.n4.nabble.com/
>      >      >      >
>      >      >
>      >      >     --
>      >      >     You are currently subscribed to cgal-discuss.
>      >      >     To unsubscribe or access the archives, go to
>      >      > https://sympa.inria.fr/sympa/info/cgal-discuss
>      >      >
>      >      >
>      >
>      >     --
>      >     You are currently subscribed to cgal-discuss.
>      >     To unsubscribe or access the archives, go to
>      > https://sympa.inria.fr/sympa/info/cgal-discuss
>      >
>      >
>
>     --
>     You are currently subscribed to cgal-discuss.
>     To unsubscribe or access the archives, go to
>     https://sympa.inria.fr/sympa/info/cgal-discuss
>
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Shrabani Ghosh
I am getting something like this from the debugger.

Breakpoint 1, main (argc=1, argv=0x7fffffffd818)
    at
/home/sghos003/cgal_examples/orient_polygon_soup/orient_polygon_soup_example.cpp:35
35    CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh);
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x000000000058edf0 in
CGAL::HalfedgeDS_halfedge_base<CGAL::HalfedgeDS_list_types&lt;CGAL::Epick,
CGAL::I_Polyhedron_derived_items_3&lt;CGAL::Polyhedron_items_with_id_3>,
std::allocator<int> >, CGAL::Boolean_tag<true>, CGAL::Boolean_tag<true>,
CGAL::Boolean_tag<true> >::face (this=0x0)
    at
/home/sghos003/CGAL-4.13.1/include/CGAL/HalfedgeDS_halfedge_base.h:328
328    Face_handle           face()  


Thanks
Shrabani



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: Cannot read my data file in off format

Shrabani Ghosh
This post was updated on .
After finishing the iteration all over the faces, in CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh) this line below message is showing.

executable: malloc.c:3722: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
Aborted (core dumped)



Regards
Shrabani Ghosh



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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