Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: Cody Rose <>
  • To:
  • Subject: Re: [cgal-discuss] error converting Polyhedron_3 to Nef_polyhedron_3
  • Date: Thu, 28 Mar 2013 10:47:50 -0700

Thank you for your reply. I had not through to use higher levels of checking for is_valid. However, I guess I still don't understand what those levels do exactly, because when I load the attached simple rectangular prism into a Polyhedron_3 and call is_valid(true, 1) then the validation still fails, and I cannot see how it could possibly do that.

I discovered this because I still cannot figure out what's actually wrong with my original polyhedron - I cannot identify the geometry of the dangling face you describe. One OFF viewer I've tried renders two dangling faces, but another does not, and when I manually inspect the coordinates in the .off they looks fine. I suspect the rendering problem has to do with the fact that two of my faces are concave, but I can't imagine that CGAL is having a similar issue.

(Incidentally, loading from the .off directly into a Nef_polyhedron doesn't help me, because in my actual use case these polyhedrons are generated in code, not read from a file.)

Thank you,
Cody

On 3/28/2013 12:41 AM, Sebastien Loriot (GeometryFactory) wrote:
Hello,

the polygon is actually invalid
(increase the check level to 3
if (!poly.is_valid(false,3)) {
std::cout << "poly is invalid\n";
}
).

You have a dangling face with make the surface non-manifold.

One solution is to use this:

if (!poly.is_valid(false,3)) {
std::cout << "poly is invalid\n";
stream.open("poly.off");
nef_polyhedron nef;
CGAL::OFF_to_nef_3 (stream, nef);
std::cout << "created nef\n";
}


Sebastien.


On 03/27/2013 09:28 PM, Cody Rose wrote:
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




OFF
8 6 0
200 100 0
100 100 0
100 200 0
200 200 0
200 100 30
100 100 30
100 200 30
200 200 30
4 0 1 2 3
4 7 6 5 4
4 3 7 4 0
4 0 4 5 1
4 1 5 6 2
4 2 6 7 3



Archive powered by MHonArc 2.6.18.

Top of Page