[vtkusers] How to insert edges?

Jeff Lee jeff at cdnorthamerica.com
Mon Aug 23 12:00:37 EDT 2004


Hi All,
Would not a vtkTriangleFilter be appropriate in this case?  It does all 
the accounting for you...
-J

Sean McInerney wrote:

> 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
>>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list