Subject: CGAL users discussion list
List archive
- From: Pratyush Pranav <>
- To:
- Subject: Re: [cgal-discuss] some further questions on convex hull
- Date: Fri, 15 Apr 2016 16:27:47 +0300
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:Eg70pxQTTt1/8/BhJ4JoNEotXdpsv+yvbD5Q0YIujvd0So/mwa64bRKN2/xhgRfzUJnB7Loc0qyN4/CmBDNLuMfR+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq82VPloD3WvtKZpJbzyI7izp/vEMhoVjLqtjgjDomVBvP9ps+GVzOFiIlAz97MrjtLRq8iBXpu5zv5UYCfayLOwFS6dFBmEmL3wt/5+s8gLSSBOGoHoaSGQf1BRSRBPU6QnzGZb3vCy9veV03GyWPNb9UKsvCgiluqxkQRuthCYcPCMi60nWjNZxheRVukGPvRt6lrbOaZ2EKeF+NpvHdNUTWyIVRtxYSz1cEI6UYI4GDu5HNuFd+dqu72ASpAezUFH/TNjkzSVF0yf7
yes true, but creating the right triangulation is just the start of the problem for me..i did this just to visualise if what i am getting is what i am after actually.
summary of the main problem then:
my data set is a list of points on the surface of a sphere, with values specified on them. i need to be able to compute the lower star filtration of a simplicial complex (this in order to be able to compute homology and persistent homology). the lower star filtration requires that i sort out the vertices in order. then for each vertex i should be able to output all the incident edges and facets whose other vertices have values less than the value on the vertex on which these edges and facets are incident. i might not be accurate in the definition of lower star filtration, but this is what is needed algorithmically. Again, I am attaching an MWE that works for 3D triangulations with generalised points in 3D(filtration_builder_healpix.cpp).
But since in this current case, i need the triangulation of points on sphere, which is a 2D triangulation, i have two choices:
— construct the 3D triangulation and take only the simplices that are incident to the infinite cell (and construct the filtration out of it) : this i assumed would have given me the convex hull simplifies, but from the triangulation that i produced it does not look so. this is where getting the triangulation right might be important.
— the other option is to construct the convex hull explicitly from the triangulation and work with it. i see that even if the triangulation does not look good(attached figure), when i write out the convex hull explicitly (attaching MWE that does this) and write it to an off file, it gives me the correct simplices (attached figure also for convex hull). but in this case i face the problem that i am not able to find information on how to define vertex base with info for polyhedron, and i need that to be able to write the lower star filtration, just like i do for the triangulation.
I would really appreciate if you can help resolve this issue, or point me in the right direction. please do not hesitate to ask if something is not clear in my explanation :)
cheers
Pratyush
Attachment:
filtration_builder_healpix.cpp
Description: Binary data
Attachment:
Write_OFF_ConvexHull_VandE.cpp
Description: Binary data
PaddyRegards,Hi Pratyush,I always use the trick in /include/CGAL/IO/Complex_2_in_triangulation_3_file_writer.h , in output_surface_facets_to_off, which uses a sdt::map to create a mapping between vertex handles and integers (since vertex handles are hashable). I see you had your own vertex ordering in the cpp file you attached, which isn't necessary.On Fri, Apr 15, 2016 at 1:28 PM, Pratyush Pranav <> wrote:Hi Paddy,I am not sure what I am doing wrong, so I am attaching an MWE that produces the required off file along with the needed input files ( format is ./executable coord_file data_file). It is not per se an MWE for just the triangulation and subsequent writing of off..Here is briefly what I am trying to do:1.) read a set of coordinates on the sphere2.)read data on those points (here is where I am not sure in my code if the data matches exactly at the point it is specified in the file wrt the triangulation).3.) sort the vertices according to the value on them (for this i have used the vertex_base_with info to create my own data structure which stores value and index.) however this part is not required for the MWE but for my subsequent things.4.) output the off file.Would be great if you could tell me what is going wrong.Alternatively, i could have a much simpler life, if i could manage to derive my own class for a POLYHEDRON in which i could store the value and index. If that can be done, that brings me nearer to what i want, because ultimately I only want a 2D triangulation of the points on the sphere (and not 3D) and work with the 2D triangulation. As pointed in the previous mails, i get that the 2D triangulation of spherical points is the convex hull of 3D triangulation.It is perhaps possible i am not being clear very much right now. But if there is help coming, i can be more systematic about the problem i am after. But in a nut shell again,problem 1 — whats going wrong with the triangulation in the MWEproblem 2 — a possibility to derive for polyhedron_3, something like vertex_base_with info that we have for triangulation. if you can point me to the relevant place in the manual, that might be a good start already. i am exploring but could not really find it.cheersPratyushPaddyCheers,I usually use an stl format for quick stuff like this since you don't need to number any vertices, just write a list of vertex coordinates for each face. So you should only need to iterate over the faces. You can view stl files in ParaView.Hi Pratyush,The image triangulationpointsons2 looks like your connectivities might have an off by 1 error in the mesh file you've written.On Thu, Apr 14, 2016 at 9:22 AM, Pratyush Pranav <> wrote:no, no, i use exactly that :) not in a mood to rewrite thats written already:)I jump late in the discuss and did not read the full thread so I might
be wrong but it seems you reimplemented the function
convex_hull_3_to_polyhedron_3.
http://doc.cgal.org/latest/Convex_hull_3/group__PkgConvexHull3Functions.html#gaa87070e950e63e3a7395a2fb14c7ea7c
Sebastien.
On 04/14/2016 10:10 AM, Pratyush Pranav wrote:no, i finally convert to convex hull from triangulation, because when i
visualised the triangulation, it was not what i had thought it was
(attaching a visualisation of the triangulation of the point, as well as
the extracted convex hull (which was what i am after). the triangulation
doesn’t even look alright to me ( i output all the finite vertices,
edges and facets in off format)…however, the convex hull comes out just
alright. it is clear that not all the simplifies of the triangulation
are a part of the convex hull, so just taking the simplifies incident to
the infinite vertex or cells in the triangulation and think it give the
full convex hull was a wrong idea…i was getting bad results then. by the
way, is it true that a simplex that belongs to convex hull may actually
not be a part of the triangulation?
also, more importantly, when i output the infinite vertex it gives me
the coordinates as (0,0,0). i faintly remember reading in the coal
manuals that for points on sphere, there is an insertion of a dummy
point at (0,0,0)…just trying to confirm. if this is true, i can
partially make sense of the garbage result i was getting.
so now, i convert to convex hull, and write it to a polyhedron_3. by the
way, i think i have my answer. the halfedges are unique to a facet from
what it looks like on the polyhedron documentation.
pratyushOn 14 Apr 2016, at 09:00, Monique Teillaud <
<mailto:>> wrote:
Hard to answer, without knowing which precise package you are finally
using.
If it is 3D triangulation, then:
http://doc.cgal.org/latest/Triangulation_3/classCGAL_1_1Triangulation__3.html#a46150602a4dd3953bfc820c7eebf123d
but there are no half edges and no handles to facets...
--
Monique Teillaud
http://www.loria.fr/~teillaud/
INRIA Nancy - Grand Est, LORIA
Institut National de Recherche en Informatique et Automatique
On 13 Apr 2016, at 23:12, Pratyush Pranav <
<mailto:>> wrote:i have been doing something and getting somewhere…working with the
triangulation did not give me the right thing…so i switched over to
the convex hull computed from the triangulation. i have one more
question though.
is there a way to extract the incident facets on a vertex?
am i right if i say that i find the incident half edge to a vertex,
from that half edge get a handle to the incident facet? does every
half edge have a unique facet that it points to?
given a half edge handle, what is the proper way to extract the
incident facet handle to it?On 11 Apr 2016, at 20:29, Monique Teillaud
< <mailto:>> wrote:
On 11 Apr 2016, at 16:06, Pratyush Pranav <
<mailto:>> wrote:yes i get it a bit…been playing around with things for a while…but
now stuck a bit at the proper usage of circulators.
my problem is the following :
first i want to iterate over all the incident edges to a vertex.
then for each edge i want to determine if it is on the convex hull.
for this, I want to circulate over all the incident cells of an
edge to determine if the edge is on the boundary of the hull (if
one or more cells incident to the edge are infinite cells, the edge
is on the hull).
how to do this? as i gather circulators do not behave in the same
fashion as iterators.
it is roughly the same, except that there is no range associated.i was reading on circulators, and saw that i could convert a
circulator to a container and iterate over the contents of the
container so i define it as follows
this looks uselessly complicated
why not just use the circulator in the simplest possible way, as in
the example given here
http://doc.cgal.org/latest/Circulator/index.html#title3 ?
there must also be an example in some triangulation chapter (if not
3d, then 2d)
--
Monique Teillaud
http://www.loria.fr/~teillaud/
INRIA Nancy - Grand Est, LORIA
Institut National de Recherche en Informatique et Automatique
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
- Re: [cgal-discuss] some further questions on convex hull, (continued)
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/11/2016
- Re: [cgal-discuss] some further questions on convex hull, Monique Teillaud, 04/11/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/13/2016
- Re: [cgal-discuss] some further questions on convex hull, Monique Teillaud, 04/14/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/14/2016
- Re: [cgal-discuss] some further questions on convex hull, Sebastien Loriot (GeometryFactory), 04/14/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/14/2016
- Re: [cgal-discuss] some further questions on convex hull, Pádraig Ó Conbhuí, 04/14/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/15/2016
- Re: [cgal-discuss] some further questions on convex hull, Pádraig Ó Conbhuí, 04/15/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/15/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/11/2016
- Re: [cgal-discuss] some further questions on convex hull, Monique Teillaud, 04/14/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/15/2016
- Re: [cgal-discuss] some further questions on convex hull, Monique Teillaud, 04/15/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/15/2016
- Re: [cgal-discuss] some further questions on convex hull, Monique Teillaud, 04/15/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/15/2016
Archive powered by MHonArc 2.6.18.