function indexTriangles(geometry) {
  if (defined(geometry.indices)) {
    return geometry;
  }
  const numberOfVertices = Geometry.computeNumberOfVertices(geometry);

  //>>includeStart('debug', pragmas.debug);
  if (numberOfVertices < 3) {
    throw new DeveloperError("The number of vertices must be at least three.");
  }
  if (numberOfVertices % 3 !== 0) {
    throw new DeveloperError(
      "The number of vertices must be a multiple of three.",
    );
  }
  //>>includeEnd('debug');

  const indices = IndexDatatype.createTypedArray(
    numberOfVertices,
    numberOfVertices,
  );
  for (let i = 0; i < numberOfVertices; ++i) {
    indices[i] = i;
  }

  geometry.indices = indices;
  return geometry;
}
Compresses and packs geometry normal attribute values to save memory.

@param {Geometry} geometry The geometry to modify.
@returns {Geometry} The modified <code>geometry</code> argument, with its normals compressed and packed.

@example
geometry = Cesium.GeometryPipeline.compressVertices(geometry);