<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV><BR>&nbsp;</DIV>
<DIV style="FONT-FAMILY: ">
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">Hi</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">&nbsp;</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">I am trying to do tricky part as 
match implicit surface with parametric surface but not getting proper 
result.</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">&nbsp;</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">First I create implicit surface 
using vtkPlane-&gt;vtkSampleFunction and create parametric surface using 
vtkPlaneSource. Then a</DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">pply transformation to both as 
rotate 20 degree in x and rotate 30 degree in Y. </DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">Both output should be similar but 
it’s different. I am not able to figure out reason. </DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">&nbsp;</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">As you can see in picture red plane 
is produced using vtkSampleFunction and white one is using 
vtkPlaneSource.</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">&nbsp;</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">I attached screen shot and code if 
any one can explain me why it is different.</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">&nbsp;</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">&nbsp;</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">code</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">&nbsp;</DIV></DIV>
<DIV>
<DIV style="DISPLAY: inline; FONT-FAMILY: ">&nbsp;</DIV></DIV>
<DIV>
<DIV>#include "vtkSmartPointer.h"</DIV>
<DIV>#include "vtkRenderer.h"</DIV>
<DIV>#include "vtkRenderWindow.h"</DIV>
<DIV>#include "vtkRenderWindowInteractor.h"</DIV>
<DIV>#include "vtkInteractorStyleTrackballCamera.h"</DIV>
<DIV>#include "vtkPolyDataMapper.h"</DIV>
<DIV>#include "vtkActor.h"</DIV>
<DIV>#include "vtkContourFilter.h"</DIV>
<DIV>#include "vtkSampleFunction.h"</DIV>
<DIV>#include "vtkPlane.h"</DIV>
<DIV>#include "vtkProperty.h"</DIV>
<DIV>#include "vtkTransformPolyDataFilter.h"</DIV>
<DIV>#include "vtkTransform.h"</DIV>
<DIV>#include "vtkOutlineFilter.h"</DIV>
<DIV>#include "vtkPlaneSource.h"</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>int main()</DIV>
<DIV>{</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkRenderer&gt; renderer = 
vtkSmartPointer&lt;vtkRenderer&gt;::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkRenderWindow&gt; renderWindow = 
vtkSmartPointer&lt;vtkRenderWindow&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderWindow-&gt;SetSize(640,480);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderWindow-&gt;AddRenderer(renderer);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; 
renderInteractor =&nbsp;&nbsp;&nbsp;&nbsp; 
vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
renderInteractor-&gt;SetRenderWindow(renderWindow);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt; 
vtkInteractorStyleTrackballCamera&gt; style = 
vtkSmartPointer&lt;vtkInteractorStyleTrackballCamera&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderInteractor-&gt;SetInteractorStyle(style);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkTransform&gt; xform = 
vtkSmartPointer&lt;vtkTransform&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; xform-&gt;Identity();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; xform-&gt;RotateX(20);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; xform-&gt;RotateY(30);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPlane&gt; plane = 
vtkSmartPointer&lt;vtkPlane&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; plane-&gt;SetNormal(1,0,0);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; plane-&gt;SetTransform(xform);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; // Sample the function</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkSampleFunction&gt; sample = 
vtkSmartPointer&lt;vtkSampleFunction&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; sample-&gt;SetSampleDimensions(10,10,10);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; sample-&gt;SetImplicitFunction(plane);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; double xmin = -0.5, xmax=0.5, ymin=-0.5, ymax=0.5, 
zmin=-0.5, zmax=0.5;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; sample-&gt;SetModelBounds(xmin, xmax, ymin, ymax, zmin, 
zmax);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp; // Create the 0 isosurface</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkContourFilter&gt; contours 
=&nbsp;&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkContourFilter&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
contours-&gt;SetInputConnection(sample-&gt;GetOutputPort());</DIV>
<DIV>&nbsp;&nbsp;&nbsp; contours-&gt;SetValue(0,0);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; contours-&gt;Update();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPolyDataMapper&gt; mapperSample = 
vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
mapperSample-&gt;SetInputConnection(contours-&gt;GetOutputPort());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkActor&gt; actorSample = 
vtkSmartPointer&lt;vtkActor&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; actorSample-&gt;SetMapper(mapperSample);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderer-&gt;AddActor(actorSample);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPlaneSource&gt; planeSource = 
vtkSmartPointer&lt;vtkPlaneSource&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; planeSource-&gt;SetNormal(1,0,0);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkTransformPolyDataFilter&gt; 
xformFilter = </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
vtkSmartPointer&lt;vtkTransformPolyDataFilter&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
xformFilter-&gt;SetInput(planeSource-&gt;GetOutput());</DIV>
<DIV>&nbsp;&nbsp;&nbsp; xformFilter-&gt;SetTransform(xform);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPolyDataMapper&gt; xformMapper= 
vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
xformMapper-&gt;SetInput(xformFilter-&gt;GetOutput());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkActor&gt; xformActor = 
vtkSmartPointer&lt;vtkActor&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; xformActor-&gt;SetMapper(xformMapper);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderer-&gt;AddActor(xformActor);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; // create outline</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkOutlineFilter&gt; outline = 
vtkSmartPointer&lt;vtkOutlineFilter&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
outline-&gt;SetInputConnection(xformFilter-&gt;GetOutputPort());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; // map it to graphics primitives</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPolyDataMapper&gt; outlineMapper = 
vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
outlineMapper-&gt;SetInputConnection(outline-&gt;GetOutputPort());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; // create an actor for it</DIV>
<DIV>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkActor&gt; outlineActor = 
vtkSmartPointer&lt;vtkActor&gt;::New();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; outlineActor-&gt;SetMapper(outlineMapper);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
outlineActor-&gt;GetProperty()-&gt;SetColor(0,0,0);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderer-&gt;AddActor(outlineActor);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderer-&gt;SetBackground(.1,.2,.3);&nbsp;&nbsp;&nbsp; 
</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderer-&gt;ResetCamera();</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderWindow-&gt;Render();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; renderInteractor-&gt;Start();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; return EXIT_SUCCESS;</DIV>
<DIV>}</DIV></DIV>
<DIV>
<DIV 
style="DISPLAY: inline; FONT-FAMILY: ">&nbsp;</DIV></DIV></DIV></DIV></DIV></BODY></HTML>