[vtkusers] non-manifold edges in output of vtkDecimatePro
Bryn Lloyd
blloyd at vision.ee.ethz.ch
Tue May 12 02:48:18 EDT 2009
Hi Andy,
Thanks for the patch. I tested it with three meshes that
vtkQuadricDecimation breaks. Your solution does work with these examples
and seems to solve the bug! It would great if this patch could enter VTK
CVS.
bye
Bryn
randomgurn wrote:
>
> 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
>
>
--
-------------------------------------------------
Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 26668
Fax: +41 44 63 21199
-------------------------------------------------
More information about the vtkusers
mailing list