[vtkusers] Polyline width question...

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


By the way, I do not have the issue if I do not call setLineWidth(...).

Thanks.

Mathieu

On 5-Nov-08, at 11:44 AM, Mathieu Coursolle wrote:

> 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);
>
> <Picture 1.png>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the 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/20081105/9dd75bd9/attachment.htm>


More information about the vtkusers mailing list