<div dir="ltr"><div>In case someone else is interested in this I found an example (more precisely a test) at:<br></div><div><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Hybrid/Testing/Python/TestProjectedTerrainPath.py">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Hybrid/Testing/Python/TestProjectedTerrainPath.py</a><br>
</div><div><br></div><div>which I was able to modify to suit my needs. </div><div><br></div><div>In the ends it boils down to:</div><div><br></div><div>- Load the STL file and create a vtkImageData containing the the elevation of the points. In my case I used an image that encompasses all the points in the STL and a vtkCellLocator to get the elevation for each "pixel" in the image.</div>
<div><br></div><div>- Create polylines with default elevation.</div><div><br></div><div>- Use vtkProjectedTerrainPath with the vtkImageData and the vtkPolyData of the polylines</div><div><br></div><div>- Render as usual.</div>
<div><br></div><div>the gotchas I found is that it seems that only the Hug projection mode worked for me. Also, I had some trouble figuring at the origin of the vtkImageData should be: in my case the min x and min y of the STL surface and 0 for z so that the polylines and surface line up properly.</div>
<div><br></div><div>Guillaume</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 13, 2014 at 11:55 AM, Guillaume Dumont <span dir="ltr"><<a href="mailto:dumont.guillaume@gmail.com" target="_blank">dumont.guillaume@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I have an elevation map stored in a STL file. I can successfully load this as a vtkPolyData instance and display it. Now, I have several 2D polylines that I want to display as paths on this surface. From the documentation (<a href="http://www.vtk.org/doc/nightly/html/classvtkProjectedTerrainPath.html#details" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkProjectedTerrainPath.html#details</a>) I understand that I can use vtkProjectedTerrainPath for that. However, I cannot find any examples of its usage. </div>

<div><br></div><div>Can anyone give me C++, Python or pseudo-code that would get me started?</div><div><br></div><div>From what I understand I need to convert my vtkPolyData to vtkImageData. How can I do that?</div><div>
<br>
</div><div>Many thanks.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Guillaume</div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Guillaume Dumont<br>=========================<br><a href="mailto:dumont.guillaume@gmail.com">dumont.guillaume@gmail.com</a>
</div></div>