[vtkusers] cylinder with perpendicular hole

David Gobbi david.gobbi at gmail.com
Wed Feb 27 11:56:33 EST 2013


Clipping only works when there are polydata vertices both inside and
outside of your clip function.  Because none of the vtkCylinderSource
vertices are inside your vtkCylinder, no clipping occurs.

Some polydata sources like vtkPlaneSource and vtkSphereSource allow
you to set the resolution in two directions, i.e. to make a 2D grid
that works well with clipping.  But vtkCylinderSource only allows you
to set the resolution around the cylinder, not along the cylinder.

So in order to generate a cylinder that you can clip properly, you'll
need to do this:

vtkLineSource -> generate a line, use SetResolution() to give it many vertices.
vtkTubeFilter -> convert the line into a cylinder

Hopefully this will work as a solution for you.

 - David


On Wed, Feb 27, 2013 at 9:24 AM, Petr Vokac <vok at ujv.cz> wrote:
> Hello,
>
> I am trying to plot cylinder with perpendicular hole
> using vtkCylinderSource and vtkCylinder. I can see the hole
> at 45 degrees (and large hole) but not at 90 degrees, why?
>
> I am sorry for another beginner question.
> Thank you for any hint.
>
> Petr



More information about the vtkusers mailing list