[vtkusers] Create a circle in a polydata

David Doria daviddoria+vtk at gmail.com
Tue Dec 29 09:37:50 EST 2009


On Mon, Dec 28, 2009 at 2:00 PM, siqi chen <siqichensc at gmail.com> wrote:
> Dave,
>
> Here is the function I use to create a polydata circle.
>
> void CircleInit( vtkPoints *points, int radius, int *center )
> {
>     vtkRegularPolygonSource * poly = vtkRegularPolygonSource::New();
>     poly->GeneratePolygonOff();
>     poly->SetNumberOfSides(50);
>     poly->SetRadius(radius);
>     poly->SetCenter(center[0],center[1],0);
>     poly->Update();
>     points->DeepCopy(poly->GetOutput()->GetPoints());
>     poly->Delete();
> }
>
> Siqi
>
>
> On Mon, Dec 28, 2009 at 10:50 AM, David Doria <daviddoria+vtk at gmail.com>
> wrote:
>>
>> I noticed that there is not a "vtkCircleSource". What is the best way
>> to create a circle in a polydata? I am trying to make varying size
>> circles for the vtkVoxelContoursToSurfaceFilter example. Should I use
>> vtkSphereSource and vtkCutter? Does it make sense to add a
>> vtkCircleSource class?
>>
>> Thanks,
>>
>> David
>> _______________________________________________
>> 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
>
>

Great, thanks. I made a demo of this:
http://www.cmake.org/Wiki/VTK/Examples/RegularPolygonSource

I suppose this could be used in conjunction with:
http://www.cmake.org/Wiki/Finding_Boundary_Edges

to make an unfilled circle.

Thanks,

David



More information about the vtkusers mailing list