Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: Marcel <>
  • To:
  • Subject: Re: [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron
  • Date: Fri, 4 Apr 2014 10:55:05 +0200

After some more testing, I found that all ways to obtain a vector between two
Point_3 seem to use the same assertion. :)
Creating a Segment_3 from the points first and then using
Segment_3::to_vector() or Segment_3::squared_length() results in the same
failure.

So the Point_3 insist on not being equal but still creating a vector doesn't
work. How can I cout a point at higher precision than one decimal place?
Might this actually be a bug as the error message suggests?

Forgot to mention in my first post:
I'm using the Exact_predicates_exact_constructions kernel with these typedefs:

typedef Exact_predicates_exact_constructions_kernel Kernel;
typedef Polyhedron_3<Kernel> Polyhedron;
typedef Nef_polyhedron_3<Kernel> Nef_Polyhedron;
typedef Vector_3<Kernel> Vector;
typedef Point_3<Kernel> Point;

Greetings,
Marcel

Am 01.04.2014 um 15:58 schrieb Marcel
<>:

> 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
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>




Archive powered by MHonArc 2.6.18.

Top of Page