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 <kmo...@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-boun...@paraview.org on behalf of u.utku.turunco...@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
_______________________________________________
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

Reply via email to