Modeling a face with more than 3 vertices

It was not my intention to model roofs, but a simple colorful roof also works with my addon
https://discourse.threejs.org/t/addon-produces-almost-infinite-many-time-varying-geometries-with-functions/262/14

See
http://sandbox.threejs.hofk.de/

In the sourcecode of THREEf.js one can see, however, how the surfaces are designed in color.

function morphFaces( time ) { 
...
  if ( g.isGeometry ) {
 ...
 // g is the geometry! 
   g.faces[ fIdx ].materialIndex  = g.materialCover( ( j + 0.5 ) / rs, i / hs, t ); // by function

...

  g.faces[ fIdx ].materialIndex = g.fixedMaterial[ fixMatIdx ][ j1 ]; // overwrite by array