Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have rewritten the Mesh class to have faster generation.
In addition, the vertices, colors, uvs, normals, triangles can also be bytes-like objects now (e.g. array.array, numpy arrays, or bytearray).
Triangles can have mixed line segments, triangles, and quads via tuples of length 2, 3, and 4 respectively.
I have added a new vertex_buffer parameter to the init with the vertex_buffer_length parameter being the number of vertices in the vertex buffer, and vertex_buffer_format being a vertex format string for the vertex buffer. The vertex buffer format string's format is comma separated triplets of number, data type, attribute type. Example:
"3fp,4fc,3fn"
. The number at the start of each triplet is how many values. The letter following the number is the data type of those values. The current types supported are "f" for 32 bit floats, and "I" for unsigned 32 bit integers. The letters are intended to follow the same convention as found in Python's struct functions (https://docs.python.org/3/library/struct.html#format-characters). Following that first character, is another character that specifies the vertex attribute type. The current supported types are "p" for vertex position, "c" for vertex color, "t" for texture coordinate, and "n" for normal vector. The given sample has vertices with a position composed of 3 floats, a color composed of 4 floats, and a normal composed of 3 floats.