godotengine / godotengine/godot-docs

Add some clarification to the behavior of MeshDataTool.get_edge_vertex()

Open
#9,178 1 comment 0 reactions 0 assignees View on GitHub
area:class reference enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**
4.2.1 stable

**Issue description:**
I was trying to obtain vertex data on a face-by-face basis using the MeshDataTool. My plan was to iterate over the face edges using ``get_face_edge(face_id, edge)`` and then obtain vertex data using ``get_edge_vertex(edge_id, vertex)`` with the edge IDs provided.

In the attached image, I show the results of iterating over each edge using ``get_face_edge(face_id, edge)``. The edges are returned in their **clockwise winding order**. No issues with this, as the winding order is mentioned at the top of the page.

For each of those edges, I then used ``get_edge_vertex(edge_id, vertex)`` in hopes of getting edge vertices in the **clockwise winding order**. As shown in the image, the edge vertices are not returned in the ``clockwise winding order`` at all. I assume this is because an edge can be shared by multiple faces, meaning it is impossible to determine which vertex comes "first" unless the face is known. So the vertices are returned according to some other ordering scheme, which is not mentioned in the documentation.

**URL to the documentation page (if already existing):**
https://docs.godotengine.org/en/stable/classes/class_meshdatatool.html#class-meshdatatool-method-get-edge-vertex
![winding](https://github.com/godotengine/godot-docs/assets/133930242/244b2c06-7eb4-4fc2-a3fe-c50195965f21)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.