Thanks for this explanation. Really interesting. I&#39;m glad having read that mail. <br>What would happen if the square were not in the (x,y) plane. The function become a f(x,y,z) function ? <br>Or by writing f(x,y) you meant f(i,j) where i and j are locl coordinates ?<br>

<br><div class="gmail_quote">2010/10/15 Moreland, Kenneth <span dir="ltr">&lt;<a href="mailto:kmorel@sandia.gov">kmorel@sandia.gov</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">





<div>
<font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">If I can, I would like to expand the conversation a little bit because I don&rsquo;t think the technical details are telling the whole story.<br>
<br>
The root of the problem is that the interpolation of a scalar field based on the four corners of a square (or any quadrilateral) is in general ill-defined. &nbsp;We usually mean for field to be linearly interpolated between the points. &nbsp;That is, find some function of the form f(x,y) = a*x + b*y + c that gives the correct scalar for all four points. &nbsp;But, in fact, four points over constrain the problem and no such linear function exists.<br>


<br>
So really, the differences you are seeing are the differences between how the internal VTK functions resolve the interpolation and how your rendering hardware is doing it. &nbsp;I haven&rsquo;t looked at the source code, but I&rsquo;m assuming that VTK is using something like bilinear interpolation. &nbsp;Bilinear interpolation works by first interpolating the scalar on opposite edges and then interpolating again between these edges to get a point in the interior. &nbsp;Bilinear interpolation has several advantages: it can be done independently of neighboring polygons and still be C0 continuous, it is easy to implement, it is smooth in the interior, and it gives an interpolation that intuitively makes sense. &nbsp;Note, however, that bilinear interpolation is <i>not</i> linear. &nbsp;This is evident by your plot (which is a parabola).<br>


<br>
Your graphics driver is much more concerned with speed. &nbsp;As such, it takes your quadrilateral and breaks it into triangles. &nbsp;This circumvents the whole interpolation problem because the three vertices of the triangle perfectly constrain the linear function. &nbsp;It is also easy for the graphics hardware to compute the interior of the triangle. &nbsp;Of course, the result is not as, shall we say, pleasant as bilinear interpolation. &nbsp;It is not smooth: There is a C1 discontinuity at the line where the quadrilateral was split into triangles. &nbsp;Also, this splitting is arbitrary. &nbsp;The split could just as easily been made in the opposite direction. &nbsp;In that case, you would see a red line go from upper left to lower right instead of that blue line from lower left to upper right.<br>


<br>
So the rendering is probably not what was indented when defining the scalar value on a quadrilateral. &nbsp;However, ParaView allows it because correcting the problem would make the rendering prohibitively slow. &nbsp;Furthermore, it is rarely even noticeable. &nbsp;The square in this example is worst case. &nbsp;Not only do no linear functions fit, they are not even close. &nbsp;Thus, the different ways to resolve the issue are dramatically different. &nbsp;In a practical application, this does not occur. &nbsp;The scalar values tend to more closely fit a linear function. &nbsp;If a quadrilateral like this occurred in a real data set, it might be indicative of a meshing problem. &nbsp;Furthermore, real meshes have lots of facets. &nbsp;If this square was a small part of a much bigger surface, differences in interpolation are less meaningful.<br>


<br>
In short, the interpolation your graphics hardware performs is sufficient for qualitative analysis (getting an overview of behavior), which is all its really good for anyway. &nbsp;When you do qualitative analysis (showing actual numbers in the data) such as in your plot, the more accurate interpolation models of VTK are used.<br>


<br>
-Ken<div><div></div><div class="h5"><br>
<br>
<br>
On 10/14/10 9:06 AM, &quot;Andy Bauer&quot; &lt;<a href="http://andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>&gt; wrote:<br>
<br>
</div></div></span></font><blockquote><div><div></div><div class="h5"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><br>
<br>
2010/10/14 小縣信也 &lt;<a href="http://so0208jp@gmail.com" target="_blank">so0208jp@gmail.com</a>&gt;<br>
</span></font><blockquote><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">Hi Andy,<br>
<br>
Thank you for replying.<br>
Do you mean that the rendering image doesn&#39;t reflect the result of<br>
interpolation ?<br>
</span></font></blockquote><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><br>
Yes.<br>
&nbsp;<br>
</span></font><blockquote><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">If so, what is the most common usage?<br>
In what situation is the interpolation used ?<br>
</span></font></blockquote><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><br>
If your grid uses triangles then the image should match the interpolation for the typical node/point based interpolation. <br>
<br>
&nbsp;<br>
</span></font></div></div><blockquote><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><div><div></div><div class="h5">Shinya<br>
<br>
<br>
2010/10/13 Andy Bauer &lt;<a href="http://andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>&gt;:<br>
&gt; I think this is a rendering issue and not an interpolation issue. &nbsp;From the<br>
&gt; 2d plot you can see that it&#39;s properly interpolating the values. &nbsp;I think<br>
&gt; the quadrilateral is getting rendered as 2 triangles in which case the<br>
&gt; diagonal values appear to be constant since the 2 end points are at the same<br>
&gt; value.<br>
&gt;<br>
&gt; 2010/10/12 小縣信也 &lt;<a href="http://so0208jp@gmail.com" target="_blank">so0208jp@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hello<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m sending &nbsp;the following &nbsp;e-mail again ,because nobody answered it.<br>
&gt;&gt; Does anyone have information on my problem?<br>
&gt;&gt;<br>
&gt;&gt; Shinya<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ---------- Forwarded message ----------<br>
&gt;&gt; From: 小縣信也 &lt;<a href="http://so0208jp@gmail.com" target="_blank">so0208jp@gmail.com</a>&gt;<br>
&gt;&gt; Date: 2010/10/7<br>
&gt;&gt; Subject: Interpolation problem<br>
&gt;&gt; To: <a href="http://paraview@paraview.org" target="_blank">paraview@paraview.org</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hello, paraview users<br>
&gt;&gt;<br>
&gt;&gt; I draw the file &ldquo;Sample_inter.vtk&rdquo; on ParaView. (ref:attached file)<br>
&gt;&gt; I chose &ldquo;Gouraud&rdquo; in Interpolation option.<br>
&gt;&gt; The contor picture doesn&rsquo;t seem to be interpolated by 4 points.<br>
&gt;&gt; However,the graph which is made by PlotOverLine shows the gradation of<br>
&gt;&gt; 4 points scalar.<br>
&gt;&gt; Why are they different?<br>
&gt;&gt; Does anyone know this problem?<br>
&gt;&gt; How can I make contour picture interpolated by &nbsp;Gouraud ?<br>
&gt;&gt;<br>
&gt;&gt; I look forward to your reply to my inquiry<br>
&gt;&gt;<br>
&gt;&gt; Shinya Ogata<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br></div></div>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt; <br><div class="im">
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt;&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
</div></span></font></blockquote><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><br>
<br>
</span></font></blockquote>
</div>


<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br>