[vtkusers] Create a circle in a polydata

siqi chen siqichensc at gmail.com
Mon Dec 28 14:00:00 EST 2009


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<daviddoria%2Bvtk 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091228/5aee8bcb/attachment.htm>


More information about the vtkusers mailing list