How to generate an indexed mesh?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Zylann
:warning: Old Version Published before Godot 3 was released.

I’m trying to generate geometry with the SurfaceTool, but so far it only allows to add vertices. Basically I want to create quads with 4 vertices instead of 6, or fans, and define triangles with indices, essentially to improve performance and space.
How can I generate a mesh with indexed vertices?

I see the index() method but it isn’t documented…