<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><span class="Apple-style-span" style="font-family: -webkit-monospace; font-size: 14px; line-height: 16px; ">Hi,<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">I have a set of points, I just need to find a spline that pass through all<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">of those points and generate a number of output points.<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">Here is what I did<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br
 style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">int numberOfInputPoints = points-&gt;GetNumberOfPoints();<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp;&nbsp;&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; vtkCardinalSpline* aSplineX;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; vtkCardinalSpline* aSplineY;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; vtkCardinalSpline* aSplineZ;&nbsp;&nbsp;&nbsp;&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; aSplineX =
 vtkCardinalSpline::New();<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; aSplineY = vtkCardinalSpline::New();<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; aSplineZ = vtkCardinalSpline::New();<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; for (int i=0; i&lt;numberOfInputPoints; i++)&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp;&nbsp;&nbsp; {<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp;&nbsp;&nbsp; &nbsp; double x = points-&gt;GetPoint(i)[0];<br style="line-height: 1.2em; outline-style: none; outline-width: initial;
 outline-color: initial; ">&nbsp;&nbsp;&nbsp; &nbsp; double y = points-&gt;GetPoint(i)[1];<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp;&nbsp;&nbsp; &nbsp; double z = points-&gt;GetPoint(i)[2];<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aSplineX-&gt;AddPoint(i, x);<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aSplineY-&gt;AddPoint(i, y);<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aSplineZ-&gt;AddPoint(i, z);<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp;&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color:
 initial; ">&nbsp;&nbsp;&nbsp; }<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp;&nbsp;&nbsp; vtkPoints* polypoints = vtkPoints::New();<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp;&nbsp;&nbsp;&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp;&nbsp;&nbsp; int numberOfOutputPoints = 20;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;double t;<br style="line-height: 1.2em; outline-style:
 none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;for (int i=0; i&lt;numberOfOutputPoints; i++)&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp;&nbsp;&nbsp; {<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; &nbsp; t<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">=(double)(numberOfInputPoints-1)/(double)(numberOfOutputPoints-1)*(double)i;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp;&nbsp;&nbsp; &nbsp; std::cout &lt;&lt; "t: " &lt;&lt; t &lt;&lt; std::endl;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; &nbsp; polypoints-&gt;InsertNextPoint(aSplineX-&gt;Evaluate(t),<br style="line-height: 1.2em;
 outline-style: none; outline-width: initial; outline-color: initial; ">aSplineY-&gt;Evaluate(t),<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;aSplineZ-&gt;Evaluate(t));<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&nbsp; &nbsp; }<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">I thought the newly generated points will be stored in polypoints? But when<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">I checked it, it only contains the first and the last
 point of my input<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">points.<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">I am new to vtk so please help me. Thank you very much</span></td></tr></table><br>