[vtkusers] Polyline width question...

Mathieu Coursolle mcoursolle at rogue-research.com
Wed Nov 5 11:44:36 EST 2008


Hi VTK users,

I have a 2D scene in which I display a circle polydata generated using  
vtkRegularPolygonSource. I want the thickness to always be the same in  
pixels.

It works fine, except that I have some strange artifacts, like missing  
pieces in 4 opposite locations (see picture attached).

Is there anything wrong in this code?

Thanks!

Mathieu

vtkSmartPointer<vtkRegularPolygonSource> circleSource =  
vtkSmartPointer<vtkRegularPolygonSource>::New();
circleSource->SetCenter(0.0, 0.0, 0.0);
circleSource->SetNumberOfSides(360);
circleSource->SetNormal(0.0, 0.0, 1.0);
circleSource->SetRadius(15.0); // 15 mm radius
circleSource->SetGeneratePolygon(FALSE);
circleSource->SetGeneratePolyline(TRUE);
circleSource->Update();
			
vtkSmartPointer<vtkPolyDataMapper> circleMapper =  
vtkSmartPointer<vtkPolyDataMapper>::New();	
circleMapper->SetInput(circleSource->GetOutput());
			
vtkSmartPointer<vtkActor> circleActor =  
vtkSmartPointer<vtkActor>::New();
circleActor->SetMapper(circleMapper);
circleActor->GetProperty()->SetLineWidth(20); // 20 pixels thick
circleActor->GetProperty()->SetOpacity(0.9);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081105/9a14b016/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture 1.png
Type: image/png
Size: 5399 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081105/9a14b016/attachment.png>


More information about the vtkusers mailing list