Subject: CGAL users discussion list
List archive
- From: Marcel <>
- To:
- Subject: Re: [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron
- Date: Tue, 8 Apr 2014 18:15:17 +0200
Looks like the root cause of my problem was me trying to use a
CGAL::Point_3<CGAL::Epeck> the "wrong" way.
Manually initializing a CGAL::Lazy_exact_nt<CGAL::Gmpq> with a double and
assigning it to that_point[0] results in strange behaviour. Using the (double
x, double y, double z) constructor of said Point_3 works fine though.
This solves the biggest part of my problem, now I'm fighting with
non-closedness of a torus - sphere and cube work fine.
Thanks for being my debugging rubber duck... I should've built a minimal
example earlier. :)
Marcel
Am 08.04.2014 um 08:25 schrieb Sebastien Loriot (GeometryFactory)
<>:
> I have trouble understanding what is your problem. Could you produce a
> minimal example showing the problem with an assertion for example?
>
> Thanks,
>
> Sebastien.
>
>
> On 04/07/2014 12:45 PM, Marcel wrote:
>> Hello,
>>
>> I've done further evaluations and noticed strange behaviour. The two
>> points 'a' and 'b' I mentioned in the first post do print like this:
>> (defined as
>> CGAL::Point_3<CGAL::Exact_predicates_exact_constructions_kernel>)
>>
>> a: 0.5 0.5 0.5 (cout << "a: " << a)
>> a: 0/1 0/1 0/1 (cout << "a: " << a.x().exact() << a.y().exact() <<
>> a.z().exact())
>> b: 0.5 0.5 0.5 (cout << "b: " << b)
>> b: 0/1 0/1 0/1 (cout << "b: " << b.x().exact() << b.y().exact() <<
>> b.z().exact())
>>
>> The output values are clearly not the same (despite being represented
>> differently).
>>
>> The values being the same for both points looks fine as the points come
>> from another visual mesh that actually has vertices in the same place
>> (which is the reason why I am doing this).
>> Still, these points insist in not being equal (a == b results in "false")
>> and I cannot seem to create a vector from a to b to measure their
>> distance. (Resulting in the assertion error described in the first post)
>> At least one of these circumstances is however necessary to decide if I
>> can ignore that vertex.
>>
>> So what might cause the different values where just representation is
>> different?
>> And why won't CGAL create a vector from a to b for me?
>>
>> CGAL 3.9 (Ubuntu 12.04 - unfortunately, I couldn't find a backport of CGAL
>> 4.4)
>>
>> 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
>>>
>>>
>>
>>
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>
- [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron, Marcel, 04/01/2014
- Re: [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron, Marcel, 04/04/2014
- Re: [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron, Marcel, 04/07/2014
- Re: [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron, Sebastien Loriot (GeometryFactory), 04/08/2014
- Re: [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron, Marcel, 04/08/2014
- Re: [cgal-discuss] Convert external mesh data to a *closed* Nef_polyhedron, Sebastien Loriot (GeometryFactory), 04/08/2014
Archive powered by MHonArc 2.6.18.