# Support PLY with texture coordinates parameters named (s, t)

**URL:** https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197
**Category:** Development
**Tags:** file-formats
**Created:** [December 22, 2025, 1:11pm UTC](https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197 "2025-12-22T13:11:19Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![afavray.modjaw](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/9de053/32.png) [@afavray.modjaw](https://discourse.vtk.org/u/afavray.modjaw)
#### Post date: [December 22, 2025, 1:11pm UTC](https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197/1 "2025-12-22T13:11:19Z")

</div>

Hello,

I am using `vtkPLYReader` to import various PLY meshes in my project (python VTK 9.5.2).

I have a problem with some PLY file formats that use external texture : the `vtkPLYReader` fails to parse texture coordinates on some of them. So I lost all information about texture and can’t display correctly the mesh color.

It seems VTK (9.5.2) currently only support texture coordinates expressed using properties named _(u, v)_ or _(texture\_u, texture\_v)_, and doesn’t support (s, t) which is also frequently used.

Is it possible to add support for these parameters name?

After checking the _vtkPLYReader.cxx_, it seems it’s doable by adapting a few lines:

```cpp
int vtkPLYReader::RequestData(vtkInformation* vtkNotUsed(request),
  vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector)
{
...

  bool texCoordsPointsAvailable = false;
  vtkSmartPointer<vtkFloatArray> texCoordsPoints = nullptr;
  if ((elem = vtkPLY::find_element(ply, "vertex")) != nullptr)
  {
    if (vtkPLY::find_property(elem, "u", &index) != nullptr &&
      vtkPLY::find_property(elem, "v", &index) != nullptr)
    {
      texCoordsPointsAvailable = true;
    }
    else if (vtkPLY::find_property(elem, "texture_u", &index) != nullptr &&
      vtkPLY::find_property(elem, "texture_v", &index) != nullptr)
    {
      texCoordsPointsAvailable = true;
      vertProps[3].name = "texture_u";
      vertProps[4].name = "texture_v";
    }
    else if (vtkPLY::find_property(elem, "s", &index) != nullptr &&
      vtkPLY::find_property(elem, "t", &index) != nullptr)
    {
      texCoordsPointsAvailable = true;
      vertProps[3].name = "s";
      vertProps[4].name = "t";
    }

    if (texCoordsPointsAvailable)
    {
      texCoordsPoints = vtkSmartPointer<vtkFloatArray>::New();
      texCoordsPoints->SetName("TCoords");
      texCoordsPoints->SetNumberOfComponents(2);
      output->GetPointData()->SetTCoords(texCoordsPoints);
    }
  }
...
}

```

Please correct me if I’m wrong.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [January 5, 2026, 11:15am UTC](https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197/2 "2026-01-05T11:15:14Z")

</div>

[Paul Borke’s PLY web page](https://paulbourke.net/dataformats/ply/) is sometimes cited as the best doc available on the PLY format, but it doesn’t mention any particulars about texture coordinate naming conventions in PLY files. Blender appears to output “s” and “t” as the texture coordinate names according to an example in [this Wikipedia article](https://en.wikipedia.org/wiki/PLY_(file_format)), so it seems reasonable to me for VTK to interpret those property names as texture coordinates.

What do you think @sankhesh @mwestphal ?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [January 5, 2026, 12:19pm UTC](https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197/3 "2026-01-05T12:19:06Z")

</div>

Sounds fair to me.

---

<div class="post-metadata">

### Author: ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)
#### Post date: [January 7, 2026, 4:14am UTC](https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197/4 "2026-01-07T04:14:21Z")

</div>

Sounds reasonable to me too, given that `rst` are common (similar to `uvw`) texture coordinate referring schemes in graphics APIs.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [January 8, 2026, 2:39pm UTC](https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197/5 "2026-01-08T14:39:58Z")

</div>

@afavray.modjaw would you be willing to submit a merge request that adds support for s and t coordinate parameters? See [https://gitlab.kitware.com/vtk/vtk/-/blob/master/CONTRIBUTING.md?ref\_type=heads](https://gitlab.kitware.com/vtk/vtk/-/blob/master/CONTRIBUTING.md?ref_type=heads) for how to contribute. I’d be happy to assist you with the contribution workflow.

---

<div class="post-metadata">

### Author: ![afavray.modjaw](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/9de053/32.png) [@afavray.modjaw](https://discourse.vtk.org/u/afavray.modjaw)
#### Post date: [January 8, 2026, 3:24pm UTC](https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197/6 "2026-01-08T15:24:45Z")

</div>

I would be happy to contribute!

I’ll try to free up some time to do it in a few days.

---

<div class="post-metadata">

### Author: ![seanm](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.vtk.org/u/seanm)
#### Post date: [January 8, 2026, 9:30pm UTC](https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197/7 "2026-01-08T21:30:10Z")

</div>

Please CC me on any MR, we use ply and could give it a test too.

---

<div class="post-metadata">

### Author: ![afavray.modjaw](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/9de053/32.png) [@afavray.modjaw](https://discourse.vtk.org/u/afavray.modjaw)
#### Post date: [January 14, 2026, 11:14am UTC](https://discourse.vtk.org/t/support-ply-with-texture-coordinates-parameters-named-s-t/16197/8 "2026-01-14T11:14:33Z")

</div>

The MR:

[Support PLY with texture coordinates parameters named (s, t) (!12810) · Merge requests · VTK / VTK · GitLab](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/12810)
