Subject: CGAL users discussion list
List archive
- From: Marc Alexa <>
- To:
- Subject: Re: [cgal-discuss] Mesh_3 -> Triangulation_3
- Date: Thu, 10 Jan 2019 09:25:39 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:QlYuRh34wPiYUTrmsmDT+DRfVm0co7zxezQtwd8ZseIQKvad9pjvdHbS+e9qxAeQG9mDu7Qc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPYAhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLmiDsIODEk/m/ZhMx+kqBUrhGmqRFk2YHYfISVOeB+fq/Bf94XQ3dKUMZLVyxGB4Oxd4wBAPAbPelEsoLwu18OogWxBAa2GejizTpIiWXs3aImyeguCwXG0xIvHt0Uq3nUo9D1O70TUeCx1qXH0TLDb/ZP1Dr79YPGfBchofSWUrJxd8rc0UgvFwXfjlWRs4PpJT2V1v4Vv2iU7upgSeKvi3M8pA1rvjevwcIshpHViYIa0F/E8T91wIEvJd23TkNwfN2qEINIui2EK4d7RtkuTmJotSog1LEKpZ22cDIKxZg63xLTdvKKf5SS7h7+W+ucJS10iG9ndb6hnRq+7FWsx+36W8KpylhFtDBFncPJtn0V1xzc9MyHSvxl80ekwzmP1gTT5vhaLk8piKbXMpAhz74tmpYJvkTDGSj2mEryjKCIbEkr5u+o6+H/brXnoJ+TKZN0hxngPqgynsGzG+c1PwgUU2SF5eix16fv8E3kTLlSi/05iKjZsJTUJcQBoa65BhdY0oM55BalEziqys4XnX0ZI1NKYh2KlIfpO1TUL/D5CfezmUijkDBux/zeJL3uHo3NLmTfkLfmZbty90FcxxA3zdxG+p1UC6oBL+7uWk/qr9zVFQQ5Mgyxw+b/EtpxzIIeWWSVAq+YKqzeq1GI5vh8a9SKf5If7TbhN+A+tbmplm48gVZbfK+z3JJRZmr/BeVjO0zeYHzihZAKHm4O+wY/V+f3k0bRbTkGbHm7W+cw5yowFZm9JYbFXIGkxrKbjwmhGZgDQ2lcARilFXr4fs3QXv4WY2SbJsJxmxQLULGgT8kq0hT451yy8KZuMueBon5QjpnkztUgv7SCxyF3ziR9CoGm60/ISmh1mm0SQDpvhfJwpEV8zhGI1q0q2qUER+wW3OtAV0IBDbCZ1/ZzUomgVQfIf9PPQ1GjEI3/XGMBC+kpytpLWH5TXtWviheZgnivCr4R0rGHXdk6r/ua0H/2KMJwjX3B0ft5gg==
Thank you so much! The code runs fine. But my main problem remains: the triangulation in c3t3.triangulation contains more cells than the interior triangulation of the object.
If you add the lines
std::cerr << "Number of cells in c3t3: " << c3t3.number_of_cells() << std::endl;
std::cerr << "Number of finite cells in t: " << t.number_of_finite_cells() << std::endl;
to your code you see. this. I had hoped if I take a convex surface there would be no difference, because there is no necessity for tetrahedra on the outside, but this is still not true. If you create a mesh for a sphere, the numbers will still be different.
What I would really like to do is to export the tetrahedral mesh that is in the interior of the object — the number of tetrahedra c3t3 reports. I could of course iterate over these tetrahedra, but this does not give me a valid Triangulation_3 object, because it expects a triangulation without boundary faces; rather the boundary faces are incident on tetrahedra with one vertex at infinity. So my question is how to easily create a Triangulation_3 object that captures what c3t3 intends to represent?
Best,
Marc
Here is an example of usage of copy_tds():
https://gist.github.com/sloriot/f9f929ce2e30b59f1b63a3cf3780159e
Are talking of filtering infinite cells?
Sebastien.
On 01/09/2019 10:25 PM, Marc Alexa wrote:Hi Sebastian,
Thanks for your answer. I use the stream operator on both, c3t3 and c3t3.triangulation and the result is identical.
I was never able to downcast. I somehow don’t manage to use types that CGAL understand to cast. The copy_tds function looks interesting. For now I solved my problem in a more ugly way by directly filtering the stream generated by c3t3.
My other problem remains. c3t3 uses some peeling, but the peeled tets are part of the triangulation so they still get exported.
I guess, fundamentally I need to solve the following problem: given a collection of tets that form a valid tet mesh with boundary. How can I generate the ‘outside’ tets that CGAL expects for Triangulation 3, i.e. the tets connected to the infinite vertex. Is there a simple way in CGAL to do this?
Thanks!
-MarcOn 7. Jan 2019, at 08:47, Sebastien Loriot (GeometryFactory) <> wrote:
Hi Marc,
Did you try to dump c3t3.triangulation()? AFAIK, this should directly
call the operator<<() from Regular_triangulation_3 and gives you what
you need. I guess you could even down cast it to a given Triangulation_3
class.
If you need to import it into a different triangulation type, you have
to do it at the TDS level by using the function copy_tds() for example.
See here:
https://doc.cgal.org/latest/TDS_3/classTriangulationDataStructure__3.html#aac784b676421bd590612bb08c0a84f89
HTH,
Sebastien.
On 01/05/2019 01:53 PM, Marc Alexa wrote:Dear all,
I am generating a tetrahedral mesh using the suite of algorithms in Mesh_3. I want to use the resulting mesh in my code, which is based on Triangulation_3. The vertex and cell base classes are incompatible. My preferred way for doing this would be writing the mesh to a file. Unfortunately, the formats of the stream operators are different. Is there an easy way to “reduce” what is being written by Mesh_3 to what is being expected by Triangulation_3?
On a side note: I understand that if I am not using sliver exudation, the triangulation generated by Mesh_3 will be Delaunay. This means I could export the points only (and then reconstruct the tetrahedra). Then I only need information on which tetrahedra are in the interior of the meshed surface. I tried to circumvent this by using a simple convex surface, namely a sphere. Yet even for the sphere some tetrahedra are excluded, despite clearly lying in the interior. I do understand that the excluded tetrahedra are slivers, but wouldn’t it make sense that a tetrahedral mesh with the boundary vertices on the sphere contained everything inside the sphere?
Best,
Marc
--
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] Mesh_3 -> Triangulation_3, Marc Alexa, 01/05/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Sebastien Loriot (GeometryFactory), 01/07/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/09/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Sebastien Loriot (GeometryFactory), 01/10/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/10/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/10/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Mael, 01/10/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Laurent Rineau (CGAL/GeometryFactory), 01/11/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/11/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Laurent Rineau (CGAL/GeometryFactory), 01/11/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/11/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/10/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/10/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Sebastien Loriot (GeometryFactory), 01/10/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/09/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Laurent Rineau (CGAL/GeometryFactory), 01/11/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/11/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Laurent Rineau (CGAL/GeometryFactory), 01/11/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Marc Alexa, 01/11/2019
- Re: [cgal-discuss] Mesh_3 -> Triangulation_3, Sebastien Loriot (GeometryFactory), 01/07/2019
Archive powered by MHonArc 2.6.18.