<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi everyone.<br>
</p>
<p>I finally found a working solution to my problem which I would
like to share in case it may help someone else.<br>
I had a curious observation that the point clouds (generated as a
vector of doubles through some optimization) for which I was not
able to programatically generate a convex hull using VTK C++
functions, if I wrote the point coordinates to a VTK file and
opened it in Paraview and applied vtkDelaunay3D filter, I was
getting a proper convex hull. Thus, I guessed that the issue may
be due to some floating point corner cases because my point
co-ordinates were stored as double in my original program but in
the course of writing to file and reading back there might be some
loss of precision which seems to fix the issue. With this as an
hypothesis, in my original program, I rounded off all the point
coordinates to just 2 decimal places and now I get proper convex
hull without using Paraview! If you noticed my original use case
scenario, I am simply interested in the topology of the cells and
this loss of precision is not a deal-breaker. So this solution
works well enough for me.</p>
<p>Thanks and regards,<br>
Amit<br>
</p>
<br>
<div class="moz-cite-prefix">On 08/10/2017 07:22 PM, Amit wrote:<br>
</div>
<blockquote type="cite"
cite="mid:e1e253e2-f79c-7d26-887d-c87f87931942@yahoo.co.in"
id="mid_e1e253e2_f79c_7d26_887d_c87f87931942_yahoo_co_in" class="
cite">I am sorry. I think I spoke too soon that my problem is
solved. My code is part of a larger C++ project. I am generate
several point clouds based on an optimization criteria. I
triangulate every point cloud. But the issue of missing triangles
does not happen for all the point clouds consistently. It happens
only for a few of them. Changing the alpha value to something
non-zero helped resolve the issue in one of the point-clouds but
it started happening in some other ones. I tried multiple
alpha-values but I am not able to figure out one that works for
all. Sometimes, if I print out the point cloud data for which I
get missing triangles to a VTK file and open it in Paraview, when
I apply my triangulation algorithm using a programmable filter, it
works there. So I suspect there may also be some floating point
corner case which gets resolved when writing to a file and
re-reading in paraview. I am only guessing. It was hard to
generate a minimum working example.
<br>
<br>
Finally, I think I have a minimum working Python code. Please find
attached two files:
<br>
1. Sample.vtk -- contains a culprit point cloud
<br>
2. MinWorkingEx.py -- a Python code to triangulate the point cloud
by projecting them to a unit sphere first
<br>
<br>
Repeating my question: Since I am trying to generate a convex hull
on points located on a unit sphere, why should there be any
missing triangles ever?
<br>
<br>
Regards,
<br>
Amit
<br>
<br>
<br>
On 08/09/2017 08:34 PM, Amit wrote:
<br>
<blockquote type="cite" id="Cite_2876442" class=" cite">Thank you
Bill and David for your replies.
<br>
<br>
David: I did not use vtkCleanPolyData. I had read the doc
multiple times but I did not have the patience to understand the
significance of alpha.
<br>
<br>
Bill: You are right. I was using the default value of alpha=0.0.
Just out of trial and error I set alpha=1.0 and the issue got
resolved. I think that as I am working with unit spheres,
alpha_radius=1.0 is sufficiently large value so that all faces
of all tetrahedron get included in the output convex hull.
<br>
<br>
Thanks once again for the pointers.
<br>
<br>
Regards,
<br>
Amit
<br>
<br>
<br>
On 08/09/2017 04:03 PM, Bill Lorensen wrote:
<br>
<blockquote type="cite" id="Cite_2255888" class=" cite">If you
save your polydata in a .vtp file you can try this example:
<br>
<a class="moz-txt-link-freetext" href="https://lorensen.github.io/VTKExamples/site/Cxx/Modelling/Delaunay3D/">https://lorensen.github.io/VTKExamples/site/Cxx/Modelling/Delaunay3D/</a>
<br>
<br>
It reports the # of verts, lines, triangles and tets.
<br>
<br>
<br>
On Wed, Aug 9, 2017 at 4:56 PM, Bill Lorensen
<a class="moz-txt-link-rfc2396E" href="mailto:bill.lorensen@gmail.com"><bill.lorensen@gmail.com></a> wrote:
<br>
<blockquote type="cite" id="Cite_9454852" class=" cite">I
assume Alpha=0.0 for the Delaunay filter?
<br>
<br>
Can you post a small, standalone compilable program that
produces this output?
<br>
<br>
Bill
<br>
<br>
<br>
On Wed, Aug 9, 2017 at 2:18 PM, Amit via vtkusers
<a class="moz-txt-link-rfc2396E" href="mailto:vtkusers@vtk.org"><vtkusers@vtk.org></a> wrote:
<br>
<blockquote type="cite" id="Cite_4129416" class=" cite">Dear
all.
<br>
I have a point cloud made up of points lying on surface of
a unit sphere
<br>
stored in a vtkPolyData. I want to get the convex hull of
this point cloud
<br>
using the vtkDelaunay3D filter. Then using
vtkDataSetSurfaceFilter I want to
<br>
extract the surface of the convex hull. This way, I can
get a triangulation
<br>
of the point cloud as a hollow spherical shell. Kindly
open the attached
<br>
UnstructuredGrid file in Paraview. It represents the
output of vtkDelaunay3D
<br>
filter made up of tetrahedrons. But the surface of the
convex-hull has some
<br>
missing triangles. Using the SpreadSheet View, I can see
that cells with Ids
<br>
60, 61, 64 have triangular faces in the missing region.
Hence, I would not
<br>
have expected these "hole" in the surface. Can somebody
explain why the
<br>
triangles are not being rendered? When I extract surface
from this
<br>
unstructured grid I get a spherical shell with missing
triangles as holes.
<br>
Regards,
<br>
Amit
<br>
<br>
<br>
_______________________________________________
<br>
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
<br>
<br>
Visit other Kitware open-source projects at
<br>
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
<br>
<br>
Please keep messages on-topic and check the VTK FAQ at:
<br>
<a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
<br>
<br>
Search the list archives at:
<a class="moz-txt-link-freetext" href="http://markmail.org/search/?q=vtkusers">http://markmail.org/search/?q=vtkusers</a>
<br>
<br>
Follow this link to subscribe/unsubscribe:
<br>
<a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a>
<br>
<br>
</blockquote>
<br>
<br>
-- <br>
Unpaid intern in BillsBasement at noware dot com
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
</body>
</html>