Subject: CGAL users discussion list
List archive
- From: Andreas Fabri <>
- To:
- Subject: Re: [cgal-discuss] Finding inner vertices in mesh_optimization_lloyd_example
- Date: Wed, 27 Jan 2016 13:07:22 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=None ; spf=None
- Ironport-phdr: 9a23:dzt6mBcnh+oOMAcMGVlefbdFlGMj4u6mDksu8pMizoh2WeGdxc6/YB7h7PlgxGXEQZ/co6odzbGG7Oa4AydbuN6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDtvcWJKF4RzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IAu3GePEzQrVcSTgnKGso/9bDtB/ZTALJ6GFPfH8Rl09hBQTf4RjhFrn4uDH7/r503iWAMMTtC749Uy6jx6hmTxrllD0WOTcy7GbNm4p7i6cN80HpnAB234OBONLdD/F5ZK6IJd4=
- Organization: GeometryFactory
Hello,
I've rewritten the program you posted and I've put it on github:
https://gist.github.com/afabri/32a7b4082208bd53b78d
I did not really try to understand your program,
so let me just make some remarks:
Note that when you have a cavity the infinite vertex is
not a vertex of a cell.
Also never create or copy a Cell, only use Cell_handle
or Cell_iterator and access data with ->
You cannot fully control the number of inner vertices,
as the mesh generator will in any case Delaunay tetrahedra.
There are less vertices if you do not set the
cell_radius_edge_ratio
Best,
Andreas
On 26/01/2016 14:36, Pierre Hallot wrote:
Hello,
I have a few questions on the mesh_optimization_lloyd_example that can
be found in cgal/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.
I am currently using the provided example (liver.inr.gz) and just trying
to interact with the results.
First, I am trying to find the points that are inside the created mesh,
and to differentiate them from those that are on the boundary.
From what I've read, I can find them based on the fact that a vertex on
the boundary will have one adjacent vertex which is infinite.
I thus made the following code that I added at the end of the file
without modifying anything else:
Tr t = c3t3.triangulation();
// sets so that the same points are not added twice
std::set<C3t3::Vertex_handle> innerVertices;
std::set<C3t3::Vertex_handle> outerVertices;
for (C3t3::Cells_in_complex_iterator cell =
c3t3.cells_in_complex_begin(), end = c3t3.cells_in_complex_end(); cell
!= end; ++cell)
{
const Tr::Cell c(*cell);
// each tetrahedra has 4 vertices
for (int i = 0; i < 4; ++i)
{
// the vertices connected to the one we are checking
std::vector<C3t3::Vertex_handle> adjacent_vertices;
t.adjacent_vertices(c.vertex(i),
std::back_inserter(adjacent_vertices));
bool onBoundary = false;
int counter = 0;
for (std::vector<C3t3::Vertex_handle>::iterator it =
adjacent_vertices.begin(); it != adjacent_vertices.end(); ++it)
{
if (t.is_infinite(adjacent_vertices.at(counter)))
{
onBoundary = true;
break;
}
++counter;
}
if (!onBoundary)
{
innerVertices.insert(c.vertex(i));
}
else
{
outerVertices.insert(c.vertex(i));
}
}
}
std::cout << "CountInner: " << innerVertices.size() << std::endl;
std::cout << "CountOuter: " << outerVertices.size() << std::endl;
However, no vertex seems to be infinite and thus every point is
considered as inside the complex. How is it possible?
Related to this, the File_medit.h outputs a dimension in the .mesh file
(the fourth parameter).
I think I read somewhere that 3 means it is inside the complex while 2
is on the boundary.
That's exactly what I need, however for the liver, there are about 2000
vertices (out of a total of 3361) with dimension 3 and less than a
thousand with dimension 2, the rest has a dimension of 1, 0 or -1.
I would have expected to have much more vertices on the boundary than
inside the complex however, is what I am saying correct?
Moreover, if I replace the liver.inr.gz file by my own .inr file,
everything has a dimension of 1, which makes this method useless.
Lastly, is it possible to fix the number of vertices inside the complex
that will be created during the make_mesh_3 call? For instance, I would
like to have only 256 vertices inside. (I don't care about the number on
the boundary.)
Kind regards,
Pierre Hallot
--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project
phone: +33.492.954.912 skype: andreas.fabri
- [cgal-discuss] Finding inner vertices in mesh_optimization_lloyd_example, Pierre Hallot, 01/26/2016
- Re: [cgal-discuss] Finding inner vertices in mesh_optimization_lloyd_example, Andreas Fabri, 01/27/2016
- RE: [cgal-discuss] Finding inner vertices in mesh_optimization_lloyd_example, Pierre Hallot, 01/27/2016
- Re: [cgal-discuss] Finding inner vertices in mesh_optimization_lloyd_example, Jane Tournois, 01/28/2016
- RE: [cgal-discuss] Finding inner vertices in mesh_optimization_lloyd_example, Pierre Hallot, 01/27/2016
- Re: [cgal-discuss] Finding inner vertices in mesh_optimization_lloyd_example, Andreas Fabri, 01/27/2016
Archive powered by MHonArc 2.6.18.