[vtkusers] Cutting a cylinder

Amy Henderson amy.henderson at kitware.com
Wed Dec 1 09:49:36 EST 2004

Hi Sean,

Take a look at VTK/Graphics/Testing/Tcl/capSphere.tcl

What you want to do is pass each piece of the cylinder through 
vtkFeatureEdges (set to extract only boundary edges).  Clean each of these 
outputs (vtkCleanPolyData), and pass the results through vtkStripper to 
create a triangle strip filling in the polygon extracted from 
vtkFeatureEdges.  The relevant code from capSphere.tcl is shown below.

vtkFeatureEdges boundaryEdges
   boundaryEdges SetInput [clipper GetOutput]  # In your case, the input 
would be the output of your cutter.
   boundaryEdges BoundaryEdgesOn
   boundaryEdges FeatureEdgesOff
   boundaryEdges NonManifoldEdgesOff

vtkCleanPolyData boundaryClean
   boundaryClean SetInput [boundaryEdges GetOutput]

vtkStripper boundaryStrips
   boundaryStrips SetInput [boundaryClean GetOutput]

- Amy

At 09:27 AM 12/1/2004, Sean Richards wrote:
>Hello all!
>I am using vtkImplicitPlaneWidget to interactively slice a cylinder 
>(normal cylinder from vtkCylinderSource) in my scene.
>The user places the widget wherever they want to cut the cylinder. At this 
>point they invoke an event and the cylinder actually gets cut into 2 pieces.
>What I would like to know is how to 'close' the 2 halves of the cylinder 
>once they are cut.
>The cylinder is hollow, so once you make the cut and seperate the pieces, 
>each new piece has a hole where the cut was made. Can any please tell me 
>how I could add polydata to close these holes?
>Can vtkImplicitPlaneWidget tell you the shape of the hole it cut?
>Any help would be greatly appreciated!
>This is the private VTK discussion list. Please keep messages on-topic. 
>Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:

More information about the vtkusers mailing list