<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE>@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 70.85pt 70.85pt 70.85pt 70.85pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.stylecourrierlectronique17 {
        COLOR: windowtext; FONT-FAMILY: Arial
}
SPAN.stylecourrierlectronique18 {
        COLOR: navy; FONT-FAMILY: Arial
}
SPAN.StyleCourrierlectronique19 {
        COLOR: navy; FONT-FAMILY: Arial
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=FR vLink=purple link=blue bgColor=white>
<DIV><FONT face=Arial size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">> this means
that I need to tessellate each polygon in a different polydata to keep the link
between original objects </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">> number and final
tessellated objects</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT
color=#000000><FONT color=#000080>No, in your case I don't think you have to.
</FONT>vtkTriangle filter should copy the polygon cell-data to
respective triangles, so you'll only need ids plus whatever values you
require for visualization in your original polygon cell-data, the
rest can be held in the polydata field-data or wherever. I just tried it in the
script below with ids in scalars and they're carried through, so you can use
these to look into the original field-data. I had a peek at the
vtkTriangleFilter source code and it should copy any array in cell-data
that doesn't have the copy flag set to off ... or maybe I misunderstand
you.</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>HTH</FONT></DIV>
<DIV><FONT face=Arial size=2>Malcolm</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>#-------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>from vtk import *<BR>import sys</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>pts = vtkPoints()<BR>polys =
vtkCellArray()<BR>scalars = vtkIntArray()<BR>pd =
vtkPolyData()<BR>pd.SetPoints(pts)<BR>pd.SetPolys(polys)<BR>pd.GetCellData().SetScalars(scalars)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>scalars.InsertNextValue(0)<BR>scalars.InsertNextValue(1)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>pts.InsertNextPoint(-100.0, -50.0,
0.0)<BR>pts.InsertNextPoint( 0.0, -50.0,
0.0)<BR>pts.InsertNextPoint( 0.0, 50.0,
0.0)<BR>pts.InsertNextPoint(-100.0, 50.0, 0.0)<BR>pts.InsertNextPoint(
100.0, -50.0, 0.0)<BR>pts.InsertNextPoint( 100.0, 50.0, 0.0)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># define
contour<BR>polys.InsertNextCell(4)<BR>polys.InsertCellPoint(0)
<BR>polys.InsertCellPoint(1) <BR>polys.InsertCellPoint(2)
<BR>polys.InsertCellPoint(3)<BR>polys.InsertNextCell(4)<BR>polys.InsertCellPoint(1)
<BR>polys.InsertCellPoint(4) <BR>polys.InsertCellPoint(5)
<BR>polys.InsertCellPoint(2) </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>tf =
vtkTriangleFilter()<BR>tf.SetInput(pd)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>pdm =
vtkPolyDataMapper()<BR>pdm.SetInput(tf.GetOutput())</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>actor = vtkActor()
<BR>actor.SetMapper(pdm)<BR>actor.GetProperty().SetColor(0,0,1)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>ren = vtkRenderer()<BR>renwin =
vtkRenderWindow()<BR>renwin.AddRenderer(ren)<BR>iren =
vtkRenderWindowInteractor()<BR>iren.SetRenderWindow(renwin)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>ren.AddActor(actor)<BR>ren.SetBackground(1,1,1)<BR>renwin.SetSize(600,600)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>iren.Initialize<BR>renwin.Render()<BR>iren.Start()</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>