Geometry Export Error

@Mugen87 Yup the above obj works fine but the given code :

var points = [];
for ( var i = 0; i < 10; i ++ ) {
   points.push( new Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
}
var geometry = new LatheGeometry( points,10,0,6.3)
console.log(geometry.index) 

The last console log always gives undefined . Could you please tell me why ? This is certainly the cause of hinderence when I try to save the geometry with a material in mesh with OBJ or GLTF exporter.
Thanks!