[vtkusers] How to cut a hole in polydata?!

Alan Smithee xtreme2k2 at web.de
Wed Mar 21 08:24:42 EDT 2012


Hallo Fabian!

vtkSphereSource gives you a vtkPolyData and not a function. Try to use 
vtkSphere instead.

Am 21.03.2012 12:44, schrieb Fabian:
> Hello,
>
> first of all: THANKS ALOT for Your help.
>
> Especially the vtkClipPolyData idea looks very good.
>
> I 've been trying for some time now using examples and tutorials; but slowly
> I am going nuts!
>
> I tried vtkCutter and vtkClipPolyData but in both cases I cannot set my
> sample sphere as implicit function.
>
> In purpose of testing I created a polygon and tried to cut a reound hole in
> it using a sphere.
> My code is:
>
>    vtkSmartPointer<vtkSphereSource>   Sphere    =
> vtkSmartPointer<vtkSphereSource>::New();
>                 Sphere ->SetRadius(0.2);
>                 Sphere ->SetCenter(0.5,0.5,0);
>
>     vtkSmartPointer<vtkClipPolyData>    Clipper     =
> vtkSmartPointer<vtkClipPolyData>::New();
>                 Clipper ->SetInput(polygonPolyData);      //my created
> polygon
>                 Clipper ->SetClipFunction(Sphere);<- *This creates me an
> error saying: unable to convert 'vtk SphereSource *' to
> 'vtkImplicitFunction'.*
>
> All fitting examples I read work like that. I am going crazy!
>
>
> The same happens using the vtkCutter.
>
> What am I doing wrong?
>
> Greetings
> Fabian
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/How-to-cut-a-hole-in-polydata-tp5567306p5582663.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list