<div dir="ltr"><div class="gmail_extra"><div><div dir="ltr">Ah I see resolution is just subdivisions. <a href="http://www.vtk.org/doc/nightly/html/classvtkPlaneSource.html#acd65f04a453ba87b766048f0e7597710">http://www.vtk.org/doc/nightly/html/classvtkPlaneSource.html#acd65f04a453ba87b766048f0e7597710</a></div></div><div dir="ltr"><br></div><div>I have also confirmed bbox matches exactly the values that GetBounds() reports.</div>
<br><div class="gmail_quote">On Tue, Sep 16, 2014 at 6:16 PM, Chris Marsh <span dir="ltr"><<a href="mailto:chris.marsh@usask.ca" target="_blank">chris.marsh@usask.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Yes, I was trying to be optimistic :( Good call on the bounds:<div><div>vtu export: xmin:624714 xmax:629904 ymin:5.64502e+06 ymax:5.64877e+06</div><div>vtp export: xmin:1 xmax:-1 ymin:1 ymax:-1</div></div><div><br></div><div>Presumably the problem. I'm unclear why it is doing this though?</div><div><br></div><div><span class=""><div>vtkSmartPointer<vtkPlaneSource> gridPoints = vtkSmartPointer<vtkPlaneSource>::New();</div><div><br></div></span><div>int gridSize = 1000;</div><div>gridPoints->SetResolution(gridSize, gridSize);</div><div>gridPoints->SetOrigin(bbox.vertex(0).x(), bbox.vertex(0).y(), 0);</div><div>gridPoints->SetPoint1(bbox.vertex(2).x(), bbox.vertex(0).y(), 0);</div><div>gridPoints->SetPoint2(bbox.vertex(0).x(), bbox.vertex(2).y(), 0);</div><div>gridPoints->Update();</div></div><div><br></div><div>where bbox is a bounding box (2D), index 0 is bottom left, indexing is increasing CCW. So 2 is upper right corner. As far as I can tell this is correct and corresponds to the vtu export numbers I had above.</div><div><br></div><div>I feel like I perhaps don't understand resolution: I envision it as the size of each cell, however I don't think that is correct is it?</div><div><div class="h5"><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><br style="color:rgb(102,102,102)"></div></div>
<br><div class="gmail_quote">On Tue, Sep 16, 2014 at 5:23 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On Tue, Sep 16, 2014 at 4:49 PM, Chris Marsh <<a href="mailto:chris.marsh@usask.ca" target="_blank">chris.marsh@usask.ca</a>> wrote:<br>
<br>
</span><span>> The interpolation doesn't look very good, even after increasing the<br>
> resolution. As well, it is flipped along the y-axis. Image is a mountain,<br>
> variable is air temp (blue = cold, red = warm).<br>
> See here: <a href="http://imgur.com/l1KpcS0" target="_blank">http://imgur.com/l1KpcS0</a><br>
<br>
</span>Honestly, I can't see any correspondence at all between the mountain<br>
and the interpolated data on that plane. Are you sure the size and<br>
position of the plane matches the size and position of your data?<br>
An easy way to check is to call GetBounds() on both of them and<br>
print out the bounds. They should match.<br>
<span><br>
> Secondly: I need to iterate over the rows/cols of this interpolated grid in<br>
> order to write it to an ArcGIS ascii file. What would be the best way to do<br>
> this? The fact it is now in a delaunay triangulation somewhat doesn't help<br>
> (now that I think about it!)<br>
<br>
</span>The interpolated data can be retrieved via GetPointData()->GetScalars(),<br>
but I'm not sure what ordering the vtkPlaneSource uses for its points.<br>
You can print GetPoint(0) and GetPoint(1) to see whether the points<br>
increase in the X direction or Y direction first.<br>
<br>
Also, watch for off-by-one mistakes. SetResolution(1, 1) gives a plane<br>
with 4 points (the corners). So if you want a plane with 4x4 points, you<br>
would SetResolution(3, 3).<br>
<span><font color="#888888"><br>
- David<br>
</font></span></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div>