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