Thanks!<br><br>Does the SetOrigin(100,0,0) mean a sagitall cut or cut in the X-plane at 100th pixel and what does SetValue(0, 0.5) mean?<br><br>Many thanks again<br><br>Jothy<br><br><div class="gmail_quote">On Thu, Dec 24, 2009 at 3:50 AM, Jinyoung Hwang <span dir="ltr"><<a href="mailto:hwangjinyoung@gmail.com">hwangjinyoung@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hello,</div>
<div> </div>
<div>I made an example you want, but it may not be.</div>
<div>
<div>If not, repost again, then other will help you.</div></div>
<div> </div>
<div>Jinyoung</div>
<div> </div>
<div>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div> // data load<br> vtkSmartPointer<vtkStructuredPointsReader> reader = vtkSmartPointer<vtkStructuredPointsReader>::New();<br> reader->SetFileName("test.vtk");<br> reader->Update();</div>
<div> // MC is used to display in 3D<br> vtkSmartPointer<vtkMarchingCubes> cubes = vtkSmartPointer<vtkMarchingCubes>::New();<br> cubes->SetInputConnection(reader->GetOutputPort());<br> cubes->ComputeNormalsOn();<br>
cubes->ComputeGradientsOn();<br> cubes->SetValue(0, 20);<br> cubes->Update();</div>
<div>// create a plane, and specify it</div>
<div> vtkSmartPointer<vtkPlane> plane = vtkSmartPointer<vtkPlane>::New();<br> plane->SetOrigin(100,0,0);<br> plane->SetNormal(1,0,0);</div>
<div>// create a cutter</div>
<div> vtkSmartPointer<vtkCutter> cutter = vtkSmartPointer<vtkCutter>::New();<br> cutter->SetInputConnection(cubes->GetOutputPort());<br> cutter->SetCutFunction(plane);<br> cutter->GenerateCutScalarsOn();<br>
cutter->SetValue(0, 0.5);</div>
<div> // create a mapper<br> vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();<br> mapper->SetInputConnection(cutter->GetOutputPort());<br> mapper->ScalarVisibilityOn(); <br>
mapper->Update();</div>
<div> </div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>