Hi everybody,<br>It has been quite a long time I try to visualize a
polygon resulting from the simple cut of a sphere by a plane. However,
using the code below, I can&#39;t see anything with the original camera
setup. I guess that I have problem because my cut is in the camera
focal plane but I don&#39;t know how to solve the problem. Do you have any
idea to make this code working (I wouldn&#39;t like to change the camera
position and focal point) ?<br>

Thanks a lot,<br><br>Bruno<br><br>#include &lt;vtkSphereSource.h&gt;<br>#include &lt;vtkPolyData.h&gt;<br>#include &lt;vtkPlane.h&gt;<br>#include &lt;vtkCutter.h&gt;<br>#include &lt;vtkPolyDataMapper.h&gt;<br>#include &lt;vtkActor.h&gt;<br>


#include &lt;vtkProperty.h&gt;<br>#include &lt;vtkRenderer.h&gt;<br>#include &lt;vtkCamera.h&gt;<br>#include &lt;vtkRenderWindow.h&gt;<br>#include &lt;vtkRenderWindowInteractor.h&gt;<br><br>int main(int argc, char **argv) <br>


{<br>    vtkSphereSource *sphere = vtkSphereSource::New();<br>    <br>    vtkPlane *plane = vtkPlane::New();<br>    plane-&gt;SetOrigin(0., 0., 0.);<br>    plane-&gt;SetNormal(0., 0., 1.);<br>    <br>    vtkCutter *cutter = vtkCutter::New();<br>


    cutter-&gt;SetCutFunction(plane);<br>    cutter-&gt;SetInput(sphere-&gt;GetOutput());<br>    <br>    vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();<br>    mapper-&gt;SetInput(cutter-&gt;GetOutput());<br>    <br>


    vtkActor *actor = vtkActor::New();<br>    actor-&gt;SetMapper(mapper);<br>    actor-&gt;GetProperty()-&gt;SetColor(1., 0., 0.);<br>    actor-&gt;GetProperty()-&gt;SetLineWidth(5.);<br>    <br>    vtkRenderer *renderer = vtkRenderer::New();<br>


    renderer-&gt;AddActor(actor);<br>    renderer-&gt;GetActiveCamera()-&gt;ParallelProjectionOn();<br>    renderer-&gt;GetActiveCamera()-&gt;SetFocalPoint(0., 0., 0);<br>    renderer-&gt;GetActiveCamera()-&gt;SetPosition(0., 0., 1.);<br>


    renderer-&gt;ResetCameraClippingRange(-1., 1., -1., 1., 0, 1);<br>    <br>    vtkRenderWindow *renderwindow = vtkRenderWindow::New();<br>    renderwindow-&gt;AddRenderer(renderer);<br>    <br>    vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New();<br>


    interactor-&gt;SetRenderWindow(renderwindow);<br>    interactor-&gt;Initialize();<br>    renderwindow-&gt;Render();<br>    interactor-&gt;Start();<br><br>    sphere-&gt;Delete();<br>    plane-&gt;Delete();<br>    cutter-&gt;Delete();<br>


    mapper-&gt;Delete();<br>    actor-&gt;Delete();<br>    renderer-&gt;Delete();<br>    renderwindow-&gt;Delete();<br>    interactor-&gt;Delete();<br><br>    return 0;<br>}<br>