[vtkusers] Fwd: vtkTubeFilter Side/Border Thickness

David Doria daviddoria+vtk at gmail.com
Fri Apr 9 16:05:38 EDT 2010


On Fri, Apr 9, 2010 at 4:00 PM, Fauze Polpeta <fauze.polpeta at gmail.com> wrote:
> Hi David;
>
> I tried to use the vtkExtractPolyDataGeometry clipper but,
> unfortunately the clipping function is not applied to the
> vtkPolyDataToPolyDataFilter (vtkTubeFilter in my case). Indeed, it
> considers the abstraction over which the filter is connected
> (vtkLineSource in my case). So what happens? The the ring built with
> vtkTubeFilter disappears as whole since the vtkLineSource is who is
> being fully clipped.
>
> As a solution, I'm considering the adoption of a vtkCylinderSource and
> vtkCylinder for clipping. However, as I'm not a math expert (and not
> even VTK), I can not figure out how to positioning a Cylinder using
> two 3D points. vtkLineSource provides me with an interface for that,
> but it seems that vtkCylinder and vtkCylinderSource not.
>
> Is there a way of doing this? Aligning a cylinder between two points.
>
> Regards
>
> Fauze

I would do this:

1) Create two points: (0,0,0) and (0,0,h) (where h is the height of
the cylinder)

2) Use a landmark transform to find the transformation between these
two points and the two points that you want to use to position your
cylinder (here is an example:
http://www.vtk.org/Wiki/VTK/Examples/LandmarkTransform)

3) apply the transform computed in (2) to the actual cylinder using
vtkTransformPolyDataFilter
(http://www.vtk.org/Wiki/VTK/Examples/TransformPolyData)

Let me know if you have any trouble or further questions.

Thanks,

David



More information about the vtkusers mailing list