Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] NEF intersection (infinite loop BUG?)

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] NEF intersection (infinite loop BUG?)


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] NEF intersection (infinite loop BUG?)
  • Date: Mon, 28 Jan 2013 11:39:20 +0100
  • Organization: GeometryFactory

Could you provide a minimal example showing the pb?

For example using the attached program, it worked like a charm
for both examples.

Sebastien.

On 01/24/2013 09:54 AM, mastair wrote:
In rare occasions (actually not that rare; for me 1/20 intersections) the NEF
intersection function goes into an infinite loop and never returns the
intersection (keeps on eating 25% cpu). I have no idea why this happens.

I'm using the "exact_predicates_exact_constructions_kernel".

The following links contain two OFF examples, which don't work for me. 1A
does not work with 1B, and 2A not with 2B.

I would very much appreciate it, if someone would look into it.

1A.off<https://dl.dropbox.com/u/6776437/1A.off>
1B.off<https://dl.dropbox.com/u/6776437/1B.off>

2A.off<https://dl.dropbox.com/u/6776437/2A.off>
2B.off<https://dl.dropbox.com/u/6776437/2B.off>

Thanks!



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/NEF-intersection-infinite-loop-BUG-tp4656572.html
Sent from the cgal-discuss mailing list archive at Nabble.com.


#include <fstream>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/OFF_to_nef_3.h>




typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC;

typedef CGAL::Nef_polyhedron_3<EPEC> Nef_polyhedron_3;
typedef CGAL::Polyhedron_3<EPEC> Polyhedron_3;


int main(int,char** argv)
{
  Nef_polyhedron_3 nef1, nef2;
  std::ifstream file1_stream(argv[1]);
  std::ifstream file2_stream(argv[2]);
  CGAL::OFF_to_nef_3(file1_stream, nef1);
  CGAL::OFF_to_nef_3(file2_stream, nef2);

  
  Polyhedron_3 poly;
  nef1.convert_to_polyhedron(poly);
  
  std::ofstream out;
  out.open("nef1.off");
  out << poly;
  out.close();
  
  poly.clear();
  nef2.convert_to_polyhedron(poly);
  
  out.open("nef2.off");
  out << poly;
  out.close();
  
  Nef_polyhedron_3 nef3 = nef1.intersection(nef2);

  poly.clear();
  nef3.convert_to_polyhedron(poly);
  
  out.open("nef3.off");
  out << poly;
  out.close();

  return(0);
}




Archive powered by MHonArc 2.6.18.

Top of Page