[vtkusers] Assign colors to lines of vtkPolyData with cell type polygon.

kenichiro yoshimi rccm.kyoshimi at gmail.com
Thu Nov 23 21:55:47 EST 2017


Hello Martijn,

The vtkPolyDataConnectivityFilter provides a simple way to assign
colors to regional rings. I hope the attached example will help you.
Also here are the examples for reference.
https://lorensen.github.io/VTKExamples/site/Cxx/Modelling/ContourTriangulator/
https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ExtractOutsideSurface/

Thanks

2017-11-24 5:52 GMT+09:00 Martijn Koopman <koopman.mk at gmail.com>:
> Hello,
>
> I have a vtkPolyData which cell types are polygons.
> Is it possible to color individual lines of such a vtkPolyData?
>
> I know it is possible to color individual cells by creating a data array,
> setting it as cell data and calling
> vtkPolyDataMapper::SetScalarModeToUseCellData().
>
> However, the cells of the polydata are polygons, not lines.
>
> Some background information:
> First I read polygons from a file. Each polygon consists of an exterior ring
> and zero or more interior rings.
> I construct a vtkPolyData with these rings as lines and use
> vtkContourTriangulator to form the polygons.
> vtkContourTriangulator returns a vtkPolyData with polygons ofcourse.
>
> Afterwards I want to assign a color only to those lines that constitute the
> interior and exterior rings, not the lines that make up the triangulation.
>
> Thanks in Advance,
> Martijn
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ContourTriangulator.tar.gz
Type: application/x-gzip
Size: 69213 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20171124/e79ce9aa/attachment.bin>


More information about the vtkusers mailing list