The different (solid) primitive types are useful for individual objects but, sometimes, we need independent triangles, especially if we want to have multiple (separate) shapes in a single vertex array.
Presenting to you, Extract Triangles!
Extract Triangles does exactly that; it extracts individual triangles from the other primitive types.
Basically, it's this:
sf::VertexArray triangleFan(sf::PrimitiveType::TriangleFan);
// set up vertices for triangle fan
sf::VertexArray independentTriangles{ extractTriangles::vertexArrayFrom(triangleFan) };
Simple, huh?
It can also work with just vertices (i.e. std::vector<sf::Vertex>) as well as convert between the two types and - for some reason - can also create vertex buffers from either of those!
For more information as well as the code, visit the SFML wiki and/or the GitHub repository listed below.
Wiki page:
https://github.com/SFML/SFML/wiki/Source:-Triangles-ExtractorGitHub repository (it's a part of SfmlSnippets):
https://github.com/Hapaxia/SfmlSnippets/tree/master/TrianglesExtractorThere is also an example showing it in action included in the repository and also on the wiki page.
Feel free to ask any questions or make any comments.