[Paraview] surface construction with holes

Ufuk Utku Turuncoglu (BE) u.utku.turuncoglu at be.itu.edu.tr
Wed Nov 15 03:12:57 EST 2017


Hi,

Thanks for your suggestion. Actually the data is coming from one of my 
colleges and it belongs to Fermi Surfaces (x, y, and z coordinates for 
constant energy) generated by a code and we would like to generate an 
animation for surfaces that belongs to multiple energy levels for a 
teaching purposes. Anyway, i test it with the data it is better but it 
has some artifacts with simple shapes. For example, the attached plot 
a.png belongs to a almost sphere shape but in this case it has some 
artificial planes in the surface. For the data with holes it gives 
relatively good result with some minor artifacts. I also tested Ken's 
way. If i apply Delaunay 3D to the shape the result is very poor and it 
is hard to fix the artifacts with Mesh Quality filter. On the other 
hand, if i clip the shape to two symmetric ones and apply  Delaunay 2D 
to each of one along with Mesh Quality and Threshold filters as Ken 
described. The results are better (see c.png and d.png). Still it has 
artifacts that i don't know how could i fix. I am also considering to 
write data using unstructured mesh if it is possible but i have to try 
it. Anyway, thanks to both of you for your help.

Best Regards,

--ufuk


On 15/11/2017 08:48, kenichiro yoshimi wrote:
> Hi Ufuk,
>
> vtkSurfaceReconstructionFilter with programmable filter detects holes
> in your data although they are somewhat inaccurate. As Ken mentioned,
> it would fail for other shapes with holes. But I think it is a little
> funny approach.
> ----
> import vtk
>
> pdi = self.GetInput()
> pdo = self.GetOutput()
>
> surf = vtk.vtkSurfaceReconstructionFilter()
> surf.SetInputData(pdi)
> surf.SetSampleSpacing(0.02)
>
> cf = vtk.vtkContourFilter()
> cf.SetInputConnection(surf.GetOutputPort())
> cf.SetValue(0, 0.0)
>
> reverse = vtk.vtkReverseSense()
> reverse.SetInputConnection(cf.GetOutputPort())
> reverse.ReverseCellsOn()
> reverse.ReverseNormalsOn()
> reverse.Update()
>
> pdo.ShallowCopy(reverse.GetOutput())
> ----
>
> Thanks
>
> 2017-11-15 0:04 GMT+09:00 Moreland, Kenneth <kmorel at sandia.gov>:
>> Ufuk,
>>
>> The short answer is, no. You cannot keep the Delaunay2D filter from filling holes.
>>
>> The mathematical description of Delaunay triangulation fills in all the space in the convex hull of the points. The question about having the Delaunay triangulation keeping open space that is supposed to be empty comes up frequently on this list. However, generally identifying what should not be filled is not easy to describe, especially in a general sense. When you ask me about the “hole” in your data, I, as a human, can immediately identify what you mean. But can you describe it in such a way that it can be easily picked out by a computer? I cannot. And even if we did come up with something, there is a good chance it would fail for holes of other shapes.
>>
>> That said, you might be able to resolve the problem by removing the triangles over the hole after you create the surface. I note that what you mean by a hole is a region where points are spread out, so we could start by removing big triangles. You can identify triangle size using the Mesh Quality filter. Add the Mesh Quality filter and change Triangle Quality Measure to Area. After you run that, use the threshold filter to remove all triangles with a “quality” (actually area) greater than 0.01.
>>
>> That removes some of the triangles in the holes, but not all of them. You will also see that the remaining triangles are skinny ones that stretch across cords of the circular hole. So, we could also remove skinny triangles. Run the Mesh Quality filter again on the output, this time setting the Triangle Quality Measure to Radius Ratio. Then use the Threshold filter again to remove triangles greater than a value somewhere in the range of 5 to 15. You might notice at this point that it is getting difficult to specify values that work well around the holes along the sides. Low values start removing valid triangles on the sides. High values leave some of the holes covered. This is what I meant by it being difficult to describe the holes to a computer.
>>
>> An alternate approach is to select the triangles over the wholes, invert the selection, and then extract the selection. You could also do that to the result of the procedure I just gave you.
>>
>> One final note. You are using Delaunay 2D on a set of data that is 3D. I presume you are aware that Delaunay 2D is actually projecting all of your points onto a plane and finding a triangulation there. It is not finding a surface in 3D. The only way to find the true 3D surface (in ParaView) would be to do a Delaunay 3D and then extract the external faces.
>>
>> -Ken
>>
>>
>> On 11/14/17, 5:11 AM, "ParaView on behalf of Ufuk Utku Turuncoglu (BE)" <paraview-bounces at paraview.org on behalf of u.utku.turuncoglu at be.itu.edu.tr> wrote:
>>
>>      Hi,
>>
>>      I am trying to create surface for a poly data (see attached figure). In
>>      this case, if i use Delaunay2D filter, it creates surface but it also
>>      fills the holes. So, i just wonder that is it possible to create surface
>>      for it without filling holes. You could also find a simple dataset as
>>      attachment.
>>
>>      Regards,
>>
>>      --ufuk
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>
>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/paraview


-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.png
Type: image/png
Size: 91465 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171115/38ec10a6/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b.png
Type: image/png
Size: 61277 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171115/38ec10a6/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: c.png
Type: image/png
Size: 54120 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171115/38ec10a6/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: d.png
Type: image/png
Size: 46632 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171115/38ec10a6/attachment-0007.png>


More information about the ParaView mailing list