Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] error converting Polyhedron_3 to Nef_polyhedron_3

Subject: CGAL users discussion list

List archive

[cgal-discuss] error converting Polyhedron_3 to Nef_polyhedron_3


Chronological Thread 
  • From: Cody Rose <>
  • To:
  • Subject: [cgal-discuss] error converting Polyhedron_3 to Nef_polyhedron_3
  • Date: Wed, 27 Mar 2013 13:28:40 -0700

Hello,

I receive an assertion failure when trying to convert the attached polyhedron to a nef polyhedron. The attached sample code demonstrates my problem. I am running this with CGAL 4.1, Boost 1.47, and LEDA 6.3. I am not sure if there is something about this polyhedron that causes the problem, but I could not find anything in the documentation to help me resolve this issue, and a cursory inspection of the .off doesn't show anything wrong to me (I'm probably just missing something simple).

The example program out is as follows:

loaded good poly with 16 vertices
CGAL error: assertion violation!
Expression : pe_prev->is_border() || internal::Plane_constructor<Plane>::get_plane(pe_prev->facet(),pe_prev->facet()->plane()). has_on(pe_prev->opposite()->vertex()->point())
File : c:\program files (x86)\cgal\include\cgal\nef_3\polyhedron_3_to_nef_3.h
Line : 254
Explanation:
Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html

Thank you,
Cody Rose
# Output of a CGAL tool
#CBP
# polyhedral_surface 1
# halfedges 48
# triangulated 0
# non_empty_facets 0
# terrain 0
# normalized_to_sphere 0
# radius 0
# rounded 0
# rounded_bits 0
# ENDCBP

OFF
16 10 0

# 16 vertices
# ------------------------------------------


-6603.14 675.341 242.094
-6603.14 559.341 212.989
-7047.14 559.341 212.989
-7047.14 795.342 272.202
-6603.14 795.342 272.202
-6603.14 735.342 257.148
-6655.14 735.342 257.148
-6655.14 675.341 242.094
-6603.14 675.341 252.919
-6603.14 559.341 223.815
-7047.14 559.341 223.815
-7047.14 795.342 283.028
-6603.14 795.342 283.028
-6603.14 735.342 267.973
-6655.14 735.342 267.973
-6655.14 675.341 252.919

# 10 facets
# ------------------------------------------

4 7 15 8 0
4 0 8 9 1
4 1 9 10 2
4 2 10 11 3
4 3 11 12 4
4 4 12 13 5
4 5 13 14 6
4 6 14 15 7
8 0 1 2 3 4 5 6 7
8 15 14 13 12 11 10 9 8


# End of OFF #
#define CGAL_USE_LEDA
#define CGAL_LEDA_VERSION 630
#define LEDA_DLL

#include <iostream>
#include <fstream>
#include <string>

#include <CGAL/leda_real.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>

typedef leda_real NT;
typedef CGAL::Cartesian<NT> K;
typedef CGAL::Polyhedron_3<K> polyhedron;
typedef CGAL::Nef_polyhedron_3<K> nef_polyhedron;

int main() {
std::string filename("path/to/provided/poly.off");
std::ifstream stream(filename.c_str());
polyhedron poly;
stream >> poly;
stream.close();

if (!poly.is_valid()) {
std::cout << "poly is invalid\n";
}
else if (!poly.is_closed()) {
std::cout << "poly is open\n";
}
else {
std::cout << "loaded good poly with " <<
poly.size_of_vertices() << " vertices\n";
nef_polyhedron nef(poly);
std::cout << "created nef\n";
}

return 0;
}


Archive powered by MHonArc 2.6.18.

Top of Page