Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata
- Date: Fri, 08 Aug 2014 00:33:05 +0200
- Organization: GeometryFactory
Thanks for the minimal reproducible example!
Actually, if you read again the doc of boost::iterator_facade
you'll see you're using the default for reference, which is
value&. In your case, reference should be value (Triangle is a temporary).
Sebastien.
On 08/07/2014 11:14 PM, Rostislav Khlebnikov wrote:
Hi everyone,
I'm using AABB_tree to compute intersections of a VTK poly data with a
plane. When I just convert the triangles from VTK to CGAL and store them
in std list, everything works fine. However, I would like to reduce
storage requirements by creating a triangle iterator that iterates over
the VTK triangle data.
Code in main.cpp here shows how I do it http://pastebin.com/kNLQevXV
<http://pastebin.com/sKPFHTT2>
In Release version everything works fine, but in Debug version -
intersections are never found! (Funnily enough it's a debug version that
fails). I tried finding the problem - but I don't seem to understand it.
What I found is that when CGAL uses the kernel to convert from
Triangle_3 to TriangleC3 with rep() and then uses this TriangleC3's
vertex() method on line 1909 in function_objects.h, the TriangleC3
'base' variable becomes corrupted during get(base) call at line 94 in
Triangle_3.h (i.e. correct coordinates are overwritten in what seems to
be stack initialization in function call when I looked at disassembly).
Is it something wrong that I do with my custom iterator? Or perhaps it's
a bug in VS2013 compiler (I saw some bug reports regarding stack
corruption for VS2012 such as this
<http://stackoverflow.com/questions/11000798/structure-parameter-corrupted-on-function-call>,
so perhaps it's not completely resolved).
I attached all the code, input files and cmake file, so if someone who
has VTK and CGAL could quitckly test it on their platform. For me the
release version returns 54 intersections and debug - 0.
Thank you in advance,
Rostislav.
CGAL installation info:
Windows 8.1, MSVS 2013, x64
CGAL 4.4 installed with the CGAL-4.4-Setup.exe installer and then
built
with CMake and MSVS 2013.
- [cgal-discuss] AABB tree with custom iterator for VTK polydata, Rostislav Khlebnikov, 08/07/2014
- Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata, Sebastien Loriot (GeometryFactory), 08/08/2014
- Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata, Rostislav Khlebnikov, 08/08/2014
- Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata, Rostislav Khlebnikov, 08/09/2014
- Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata, Sebastien Loriot (GeometryFactory), 08/10/2014
- Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata, Rostislav Khlebnikov, 08/10/2014
- Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata, Sebastien Loriot (GeometryFactory), 08/10/2014
- Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata, Rostislav Khlebnikov, 08/09/2014
- Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata, Rostislav Khlebnikov, 08/08/2014
- Re: [cgal-discuss] AABB tree with custom iterator for VTK polydata, Sebastien Loriot (GeometryFactory), 08/08/2014
Archive powered by MHonArc 2.6.18.