toJSON(obj) {
        var serializer = Serializers[obj.type];

        if (serializer === undefined) {
            console.warn(`GeometriesSerializer: No serializer with ${obj.type}.`);
            return null;
        }

        return new serializer().toJSON(obj);
    }
GeometriesSerializer
@author tengge / https://github.com/tengge1