<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">apply a CleanToGrid filter before&nbsp; the
      python programmable filter and this is a corrected version of your
      script:<br>
      <br>
      <meta name="qrichtext" content="1">
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;"><!--StartFragment-->pdi
        = self.GetInput()</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;">pdo =
        self.GetOutput()</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;">newPoints
        = vtk.vtkPoints()</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;">numPoints
        = pdi.GetNumberOfPoints()</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;">for i in
        range(0, numPoints):</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;"> coord =
        pdi.GetPoint(i)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;"> x, y, z
        = coord[:3]</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;"> r = x *
        sin(y)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;"> t = x *
        cos(y)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;">
        newPoints.InsertPoint(i, r, t, z)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;">pdo.SetPoints(newPoints)<!--EndFragment--></p>
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style type="text/css">
p, li { white-space: pre-wrap; }
</style><br>
      <br>
      Felipe<br>
      <br>
      Le 03/04/2013 04:55, Nikolaos Beratlis a &eacute;crit&nbsp;:<br>
    </div>
    <blockquote
cite="mid:CALdMxnw7K2SqmPjdKUpP1fYmjz-U6bW-0L-5YtDf5C-FaE10Rw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div style="">Hi,</div>
        <div style=""><br>
        </div>
        I am reading the following xmf file (attached as var3d.xmf) into
        Paraview:
        <div><br>
        </div>
        <div>
          <div>&lt;?xml version="1.0" ?&gt;</div>
          <div>&lt;!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []&gt;</div>
          <div>&lt;Xdmf Version="2.2"&gt;</div>
          <div>&lt;Domain&gt;</div>
          <div>&lt;Grid GridType="Uniform"&gt;</div>
          <div>&lt;Topology TopologyType="3DRectMesh" Dimensions=" &nbsp; &nbsp; 2
            &nbsp; &nbsp; 4 &nbsp; &nbsp; 3"/&gt;</div>
          <div>&lt;Geometry GeometryType="VXVYVZ"&gt;</div>
          <div>&lt;DataItem Dimensions=" &nbsp; &nbsp;3" NumberType="Float"
            Precision="4" Format="XML"&gt;</div>
          <div>&nbsp; &nbsp;0.0000 &nbsp; 1.0000 &nbsp; 2.0000</div>
          <div>&lt;/DataItem&gt;</div>
          <div>&lt;DataItem Dimensions=" &nbsp; &nbsp;4" NumberType="Float"
            Precision="4" Format="XML"&gt;</div>
          <div>&nbsp; &nbsp;0.0000 &nbsp; 2.0944 &nbsp; 4.1888 &nbsp; 6.2832</div>
          <div>&lt;/DataItem&gt;</div>
          <div>&lt;DataItem Dimensions=" &nbsp; &nbsp;2" NumberType="Float"
            Precision="4" Format="XML"&gt;</div>
          <div>&nbsp; &nbsp;1.0000 &nbsp; 2.0000</div>
          <div>&lt;/DataItem&gt;</div>
          <div>&lt;/Geometry&gt;</div>
          <div>
            &lt;Attribute Name="var" AttributeType="Scalar"
            Center="Node"&gt;</div>
          <div>&lt;DataItem Dimensions="24" NumberType="Float"
            Precision="4" Format="XML"&gt;</div>
          <div>0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
            22 23</div>
          <div>&lt;/DataItem&gt;</div>
          <div>&lt;/Attribute&gt;</div>
          <div>&lt;/Grid&gt;</div>
          <div>&lt;/Domain&gt;</div>
          <div>&lt;/Xdmf&gt;</div>
          <div><br>
          </div>
          <div style="">
            The grid is a 3D orthogonal grid read in cartesian
            coordinates (see attached image showing grid and contours of
            variable). I then want to transform the grid from cartesian
            to cylindrical coordinates. I tried using the following
            Python script:</div>
          <div><br>
          </div>
          <div>
            <p style="margin:0px">pdi = self.GetPolyDataInput()</p>
            <p style="margin:0px">pdo = self.GetPolyDataOutput()</p>
            <p style="margin:0px">newPoints = vtk.vtkPoints()</p>
            <p style="margin:0px">numPoints = pdi.GetNumberOfPoints()</p>
            <p style="margin:0px">for i in range(0, numPoints):</p>
            <p style="margin:0px"> coord = pdi.GetPoint(i)</p>
            <p style="margin:0px"> x, y, z = coord[:3]</p>
            <p style="margin:0px"> r = x * sin(y)</p>
            <p style="margin:0px"> t = x * cos(y)</p>
            <p style="margin:0px"> newPoints.InsertPoint(i, r, t, z)</p>
            <p style="margin:0px">pdo.SetPoints(newPoints)</p>
            <p style="margin:0px"><br>
            </p>
            <p style="margin:0px">with Output Data Set Type chosen to be
              the Same as Input, but I get this error:</p>
            <p style="margin:0px"><br>
            </p>
            Traceback (most recent call last):<br>
            File "&lt;string&gt;", line 26, in &lt;module&gt;<br>
            File "&lt;string&gt;", line 12, in RequestData<br>
            AttributeError: 'NoneType' object has no attribute
            'SetPoints'</div>
        </div>
        <div><br>
        </div>
        <div style="">I have no experience with Python scripting. What
          am I doing wrong?</div>
        <div style=""><br>
        </div>
        <div style="">Thank you,</div>
        <div style=""><br>
        </div>
        <div style="">Nikos</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the ParaView Wiki at: <a class="moz-txt-link-freetext" href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Felipe Bordeu Weldt
Ing&eacute;nieur de Recherche
-------------------------------------
T&eacute;l. : 33 (0)2 40 37 16 57
Fax. : 33 (0)2 40 74 74 06
<a class="moz-txt-link-abbreviated" href="mailto:Felipe.Bordeu@ec-nantes.fr">Felipe.Bordeu@ec-nantes.fr</a>
Institut GeM - UMR CNRS 6183
&Eacute;cole Centrale Nantes
1 Rue de La No&euml;, 44321 Nantes, FRANCE
-------------------------------------</pre>
  </body>
</html>