[vtkusers] How to insert edges?

Sean McInerney seanm at nmr.mgh.harvard.edu
Mon Aug 23 11:31:11 EDT 2004


Hi Petru,

   The VTK readers that I am familiar with make no checks WRT the 
planarity of quads or polygons ... or convexity for that matter. If you 
have degenerate data, then there may be some cleaning up to do.

   To break a given quad into two triangles, you will have to remove the 
cell entry for the quad as well as inserting the two cell entries for 
the triangles. Be careful which methods you use to insert; some will 
allocate additional memory while others assume a preallocated list size 
and make no checks.

   I am not sure that this fully addresses your woes, but hopefully it's 
  a good start.

-Sean

Petru Pau wrote:
> After weeks of failures and bad results, I have discovered the reason:
> in the huge vtkPolyData that I read as input, some quads do not have
> coplanar vertrices. (Side question: Can it be that vtk avoids making 
> planarity
> tests for quads and polygons?)
> 
> The most immediate solution is to insert a few new edges: the diagonals of
> these quads.
> 
> I tried to do that and failed. First, simply inserting next cell does 
> not work,
> if the list of lines of the poly data is null. Second, if I take the 
> lines of
> the poly data, add the new edge to it, and set it back as the lines of the
> poly data, the process fails in the subsequent BuildLinks.
> 
> The question is now evident: How can I insert and edge in a vtkPolyData?
> 
> Petru
> 



More information about the vtkusers mailing list