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 15:28:56 +0300
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:Gvt+PBTDo7PiKlpw8Fvk/IlPm9psv+yvbD5Q0YIujvd0So/mwa64bRKN2/xhgRfzUJnB7Loc0qyN4/CmBDNLuMbd+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq82VPloD3WrhKZpJbzyI7izp/vEMhoVjLqtjgjDomVBvP9ps+GVzOFiIlAz97MrjtLRq8iBXpu5zv5UYCfayLOwFS6dFBmEmL3wt/5+s8gLSSBOGoHoaSGQf1BRSRBPU6QnzGZb3vCy9veV03GyWPNb9UKsvCgiluqxkQRuthCYcPCMi60nWjNZxheRVukGPvRt6lrbOaZ2EKeF+NpvHdNUTWyIVRtxYSz1cEI6UYI4GDu5HNuFd+dqu72ASpAezUFH/TNjkzSVF0yf7
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 sphere
2.)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 MWE
problem 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.
cheers
Pratyush
Attachment:
Write_OFF_Triangulation_MWE.cpp
Description: Binary data
0.247970594274
0.437010585563
1.88966790864
1.20611480791
0.074753232476
0.0728844821223
0.933471343953
2.06821898758
2.25656992757
1.51630273059
0.966385520644
0.136247897582
-0.210631121612
0.253678821029
0.796804540888
1.03127112269
1.55965390277
1.72308095576
1.51549074238
0.963276443765
0.948599013538
0.686327505296
-0.0466614906609
-0.115215559259
-0.215234056764
0.0124103780235
0.953629114739
0.816964742166
0.794357871131
1.02259403981
0.840127422552
0.78132352628
0.753568610875
0.31836198107
0.277551089956
0.510724363107
0.128480563696
-0.474491243302
-0.349312606374
-0.246732155755
-0.619716607747
-0.704244602301
0.429737207232
0.701402323248
0.557935725645
0.673613176067
0.927982081433
0.661156216563
48
0.28259708263 0.28259708263 0.916666666667
-0.28259708263 0.28259708263 0.916666666667
-0.28259708263 -0.28259708263 0.916666666667
0.28259708263 -0.28259708263 0.916666666667
0.688619145905 0.285235389544 0.666666666667
0.285235389544 0.688619145905 0.666666666667
-0.285235389544 0.688619145905 0.666666666667
-0.688619145905 0.285235389544 0.666666666667
-0.688619145905 -0.285235389544 0.666666666667
-0.285235389544 -0.688619145905 0.666666666667
0.285235389544 -0.688619145905 0.666666666667
0.688619145905 -0.285235389544 0.666666666667
0.942809041582 0.0 0.333333333333
0.666666666667 0.666666666667 0.333333333333
5.7730403749e-17 0.942809041582 0.333333333333
-0.666666666667 0.666666666667 0.333333333333
-0.942809041582 1.15460807498e-16 0.333333333333
-0.666666666667 -0.666666666667 0.333333333333
-1.73191211247e-16 -0.942809041582 0.333333333333
0.666666666667 -0.666666666667 0.333333333333
0.923879532511 0.382683432365 0.0
0.382683432365 0.923879532511 0.0
-0.382683432365 0.923879532511 0.0
-0.923879532511 0.382683432365 0.0
-0.923879532511 -0.382683432365 0.0
-0.382683432365 -0.923879532511 0.0
0.382683432365 -0.923879532511 0.0
0.923879532511 -0.382683432365 0.0
0.942809041582 0.0 -0.333333333333
0.666666666667 0.666666666667 -0.333333333333
5.7730403749e-17 0.942809041582 -0.333333333333
-0.666666666667 0.666666666667 -0.333333333333
-0.942809041582 1.15460807498e-16 -0.333333333333
-0.666666666667 -0.666666666667 -0.333333333333
-1.73191211247e-16 -0.942809041582 -0.333333333333
0.666666666667 -0.666666666667 -0.333333333333
0.688619145905 0.285235389544 -0.666666666667
0.285235389544 0.688619145905 -0.666666666667
-0.285235389544 0.688619145905 -0.666666666667
-0.688619145905 0.285235389544 -0.666666666667
-0.688619145905 -0.285235389544 -0.666666666667
-0.285235389544 -0.688619145905 -0.666666666667
0.285235389544 -0.688619145905 -0.666666666667
0.688619145905 -0.285235389544 -0.666666666667
0.28259708263 0.28259708263 -0.916666666667
-0.28259708263 0.28259708263 -0.916666666667
-0.28259708263 -0.28259708263 -0.916666666667
0.28259708263 -0.28259708263 -0.916666666667
PaddyCheers,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/07/2016
- Re: [cgal-discuss] some further questions on convex hull, Monique Teillaud, 04/07/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/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/07/2016
- Re: [cgal-discuss] some further questions on convex hull, Pratyush Pranav, 04/07/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.