[Paraview] surface construction with holes

Ufuk Utku Turuncoglu (BE) u.utku.turuncoglu at be.itu.edu.tr
Mon Nov 20 03:47:00 EST 2017


Hi Kenichiro,

I tested your programmable filter again with higher resolution dataset 
and the result is much much better. I just want to tahank to you for 
your help and also let you know about the latest result (see attached 
plot, f png). I also tested Delaunay filter but in this case i clipped 
shape to two half and apply Delaunay2D each one of them and also 
threshold filters. You can see the result in plot e.png. It also 
improved but Programmable one seems better solution. Anyway, thanks again.

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: f.png
Type: image/png
Size: 72054 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171120/509cacd0/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: e.png
Type: image/png
Size: 103762 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171120/509cacd0/attachment-0001.png>


More information about the ParaView mailing list