Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron

Subject: CGAL users discussion list

List archive

[cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron


Chronological Thread 
  • From: Marcel <>
  • To:
  • Subject: [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron
  • Date: Tue, 1 Apr 2014 15:58:35 +0200

Hello!

I'm trying to implement CSG operations with Nef_polyhedra on top of a given
framework that uses OpenSG for rendering. Now I can get all the triangle data
from OpenSG, but this results in 36 vertices for a cube as every corner has 3
vertices (for 3 different normals). This is not a closed mesh, therefore CSG
operations on the Nef_polyhedron fail.
Despite the problems that might arise from a fixed merging threshold with
complex models, I was trying to merge vertices in close proximity by
referencing the preexisting vertex in the indices array if there is one.
(When iterating over the given triangles)

So, first: Is there by chance a more or less convenient method for
automatically merging "close" vertices?

Second, the actual problem:
When I try to compute the distance between two vertices, an assertion fails:

CGAL/Interval_nt.h:89 "!(i>s) Variable used before being intialized (or CGAL
bug)"

in the last line of this snippet:

CGAL::Point a = positions->at(i); // Setting these equal manually really
makes them equal
CGAL::Point b = newPoint;
CGAL::Vector vecdiff(b, a);

I don't exactly understand what is wrong here. The points are certainly close
as they 'cout' as the same values. Still, they are not equal by means of "a
== b". (And I cross-checked by setting them to the same values.)

So, is there either a way to completely avoid doing this manually or can you
tell me what I am doing wrong?

Greetings,
Marcel


Archive powered by MHonArc 2.6.18.

Top of Page