<div dir="ltr">Here is it!<br><br><i style="color: rgb(0, 0, 153);"># A simple script to demonstrate the vtkCutter function<br>import vtk<br><br><br>#Create a cube<br>cube=vtk.vtkSphereSource()<br>cube.SetRadius(50)<br>cube.SetThetaResolution(200)<br>
cube.SetPhiResolution(200)<br>cubeMapper=vtk.vtkPolyDataMapper()<br>cubeMapper.SetInputConnection(cube.GetOutputPort())<br><br>#create a plane to cut,here it cuts in the XZ direction (xz normal=(1,0,0);XY =(0,0,1),YZ =(0,1,0)<br>
plane=vtk.vtkPlane()<br>plane.SetOrigin(10,0,0)<br>plane.SetNormal(1,0,0)<br><br>#create cutter<br>cutter=vtk.vtkCutter()<br>cutter.SetCutFunction(plane)<br>cutter.SetInput(cubeMapper.GetInput())<br>cutter.Update()<br><br>
FeatureEdges=vtk.vtkFeatureEdges()<br>FeatureEdges.SetInputConnection(cutter.GetOutputPort())<br>FeatureEdges.BoundaryEdgesOn()<br>FeatureEdges.FeatureEdgesOff()<br>FeatureEdges.NonManifoldEdgesOff()<br>FeatureEdges.ManifoldEdgesOff()<br>
FeatureEdges.Update()<br><br><br><br><br>cutMapper=vtk.vtkPolyDataMapper()<br>cutMapper.SetInput(FeatureEdges.GetOutput())<br>cutActor=vtk.vtkActor()<br>cutActor.GetProperty().SetColor(1,1,0)<br>cutActor.GetProperty().SetEdgeColor(1,0.5,0)<br>
cutActor.GetProperty().SetLineWidth(2)<br>cutActor.GetProperty().EdgeVisibilityOn()<br>cutActor.GetProperty().SetOpacity(0.7)<br>cutActor.SetMapper(cutMapper)<br><br><br>#create renderers and add actors of plane and cube<br>
ren = vtk.vtkRenderer()<br>ren.AddActor(cutActor)<br><br><br>#Add renderer to renderwindow and render<br>renWin = vtk.vtkRenderWindow()<br>renWin.AddRenderer(ren)<br>renWin.SetSize(600, 600)<br>iren = vtk.vtkRenderWindowInteractor()<br>
iren.SetRenderWindow(renWin)<br>ren.SetBackground(0,0,0)<br>renWin.Render()</i><br><br><div class="gmail_quote">On Fri, Jun 4, 2010 at 10:07 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">From the output of vtkCutter, insert vtkFeatureEdges with<br>
BoundaryEdgesOn()<br>
FeatureEdgesOff()<br>
NonManifoldEdgesOff()<br>
ManifoldEdgesOff()<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On Fri, Jun 4, 2010 at 4:16 PM, Jothy &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; With the help of CapCow.tcl example I am able to fill the contour I got from<br>
&gt; vtkCutter. But, the problem is I am the edge to be visible, so I set edge<br>
&gt; visibility on, it makes all the triangle edges on. I want only the outline<br>
&gt; on.<br>
&gt;<br>
&gt; Any suggestions?<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Jothy<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br></div>