The docs currently say this:
object that provides UV generator functions
which is vague, especially for someone new to UVs and trying to learn how to calculate UVs.
Also, with added documentation perhaps AIs can derive better information.
In particular, we can see in the source code that a UVGenerator
must have two methods: generateTopUV
and generateSideWallUV
.
What exactly are the descriptions for the methods?
My guess is this:
generateTopUV
- Generate UVs for the end caps of the extrusion (the shape being extruded). Receives the geometry, list of all vertices, and three indices representing a triangle. It gets called once per triangle for every triangle on both the start shape and the closing shape (for example for each triangle in two star shapes if the extruded shape is a star). It should return a tuple of threeVector2
instances representing the UVs for the three vertices represented by the indices.generateSideWallUV
- Generate UVs for the faces along the extrusion path. Each surface along the extrusion is a rectangle. Receives the geometry, list of all vertices, and four indices representing a face. It gets called once per rectangle face (for example for each rectangle around the “tube” created by the extrusion). It should return a tuple of fourVector2
instances representing the UVs for the four vertices represented by the indices.
Is this accurate?