[vtkusers] Polyline width question...

Mathieu Coursolle mcoursolle at rogue-research.com
Wed Nov 5 15:41:00 EST 2008


Hi again,

I did some more tests, and even if I create a line polydata point by  
point, the line width
is not the same on every point.

The circle example presented here shows that the circle is 20 pixels  
wide at angle 0, 90, 180 and 270, but
get thinner on other angles and shows missing pixels at 45, 135, 225  
and 315 degrees.

Does anybody knows a way to make the circle have a regular width at  
all angles?

Thanks!

Mathieu

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

> 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/7206a9bc/attachment.htm>


More information about the vtkusers mailing list