# Glyph3D filter but acting on polydata Vertices rather than points

**URL:** https://discourse.vtk.org/t/glyph3d-filter-but-acting-on-polydata-vertices-rather-than-points/11305
**Category:** Support
**Created:** [April 26, 2023, 9:13am UTC](https://discourse.vtk.org/t/glyph3d-filter-but-acting-on-polydata-vertices-rather-than-points/11305 "2023-04-26T09:13:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Matthieu](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@Matthieu](https://discourse.vtk.org/u/Matthieu)
#### Post date: [April 26, 2023, 9:13am UTC](https://discourse.vtk.org/t/glyph3d-filter-but-acting-on-polydata-vertices-rather-than-points/11305/1 "2023-04-26T09:13:22Z")

</div>

Hi, is there a way to make the vtkGlyph3D filter acting on the Vertices (cells) of a polydata rather than the points ?

I have a polydata with cells being triangles, lines, and vertices. I want a pipeline where I put tubes in place of lines (the tube filter works well) and spheres in place of vertices but the glyph3D filter works on the points of the polydata so it’s not what I want…

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [April 26, 2023, 10:54pm UTC](https://discourse.vtk.org/t/glyph3d-filter-but-acting-on-polydata-vertices-rather-than-points/11305/2 "2023-04-26T22:54:24Z")

</div>

It is not really clear to me what you want. First of all, you have the option to render lines as tubes and points as spheres simply by using the property of the actors. If you want spheres on only some of the points, you could split your data into two and use multiple actors. Also, the `vtkGlyph3D` as well as the `vtkGlyph3DMapper` can be used in conjunction with `SetInputArrayToProcess`, where you can specify what primitives to target.

---

<div class="post-metadata">

### Author: ![Matthieu](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@Matthieu](https://discourse.vtk.org/u/Matthieu)
#### Post date: [April 27, 2023, 7:34am UTC](https://discourse.vtk.org/t/glyph3d-filter-but-acting-on-polydata-vertices-rather-than-points/11305/3 "2023-04-27T07:34:27Z")

</div>

Oh, I didn’t know about this ! It’s definitely simpler than my solution but sadly the tubes and spheres have not a fixed width, it changes whenever you zoom… Is there a way to fix this ?

To add clarification, I want to render an actor based on a polydata with different types of cells:

- triangles
- polylines
- vertices  
But I want to render the polylines of the polydata as tubes to give them a real width, and the vertices as spheres for the same reason. (+ I want to be able to set the color of each cell but that’s ok)

Ideally I’d like something that looks like that [https://www.kitware.com/rendering-tubes-and-spheres-in-vtk/](https://www.kitware.com/rendering-tubes-and-spheres-in-vtk/) , on my polylines and vertices.But the solution in that link and yours do not have an “absolute” width, but one which adapt to the camera.

EDIT: also, another thing I’d like to do is to pick cells. With the solution of rendering lines as tubes in the actor, I can’t pick the tubes or spheres

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [April 30, 2023, 8:11pm UTC](https://discourse.vtk.org/t/glyph3d-filter-but-acting-on-polydata-vertices-rather-than-points/11305/4 "2023-04-30T20:11:45Z")

</div>

If it was me, I would split the `vtkPolyData` and use multiple actors.

---

<div class="post-metadata">

### Author: ![Matthieu](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@Matthieu](https://discourse.vtk.org/u/Matthieu)
#### Post date: [May 2, 2023, 7:34am UTC](https://discourse.vtk.org/t/glyph3d-filter-but-acting-on-polydata-vertices-rather-than-points/11305/5 "2023-05-02T07:34:29Z")

</div>

That is what I did first, but it leads to thousands of actors and my computer doesn’t like it…

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [May 2, 2023, 9:48am UTC](https://discourse.vtk.org/t/glyph3d-filter-but-acting-on-polydata-vertices-rather-than-points/11305/6 "2023-05-02T09:48:10Z")

</div>

Not one actor per vert. One actor for all the verts. For example vtkExtractCellsByType can extract the verts into a separate dataset, and you can then put this dataset into vtkGlyph3D.

Or, if you want, you can use vtkAppendPolyData to combine the output of vtkGlyph3D and the output of vtkTubeFilter and use just one actor for everything.
