[vtkusers] non-manifold edges in output of vtkDecimatePro

randomgurn public at ssbd.net
Mon May 11 11:55:43 EDT 2009



Bryn Lloyd-2 wrote:
> 
> Hi,
> 
> 
> I am using following code to decimate a surface mesh:
> 
>   vtkNew(vtkDecimatePro,decimate);
>    decimate->SetInput(reader->GetOutput());
>    decimate->SetTargetReduction(target);
>    decimate->SetFeatureAngle(angle);
>    decimate->PreserveTopologyOn();
>    decimate->SplittingOff();
>    decimate->PreSplitMeshOff();
>    decimate->BoundaryVertexDeletionOff();
> 
> 
> The output can be a broken surface mesh: There are non-manifold edges in 
> the output of vtkDecimatePro. Additionally there are duplicate
> triangles.
> 
> The input comes from running marching cubes on a vtkStructuredPoints. 
> According to my test routines it is a good triangle mesh (i.e. NO 
> non-manifold edges etc.)
> 
> 
> Must I set a parameter of vtkDecimatePro differently, or is this a bug? 
> Is there actually a guarantee that vtkDecimatePro will not break my mesh?
> 
> 
> Thanks for any help
> 
> Bryn
> 

Dear Bryn,

I have been having similar problems, although with the 
vtkQuadricDecimation class.  I don't know if you can move to this class, 
but I've bodged together 
http://www.nabble.com/file/p23486156/vtkQuadricDecimation.patch a fix  for
it.

Essentially, I found that the problems arise when you remove one of the 
"base edges" from a triangular pyramid.  Say that you've got three 
triangles with vertex indices:-

(0,1,3), (1,2,3), (0,3,2)

(I am imagining them on a Mercedes logo, with vertices 0,1,2 on the 
circumference and vertex 3 in the middle - but hey, that's not really 
important).

If you collapse any of the edges (0,1), (1,2) or (2,0), the two 
remaining faces will be on top of each other; then VTK will remove one 
of them, and all manner of things start happening that I don't want.  If 
you check for these edges, and block them from being collapsed, the mesh 
comes out perfectly (for my purposes, at least).

I attach a  http://www.nabble.com/file/p23486156/vtkQuadricDecimation.patch
patch .  I'm sure that somebody far better versed in VTK could 
do it a whole lot more efficiently (and write it in the correct style 
too!).  In particular, it could be made more efficient by not having to 
create and destroy the id lists in method IsEdgeCollapsible.


Regards,

Andy.


-- Andy Turner PhD Student Imperial College London


-- 
View this message in context: http://www.nabble.com/non-manifold-edges-in-output-of-vtkDecimatePro-tp23315212p23486156.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list