(obj, file_name)
return exch.write_file(file_name, exported_data)
Exports curves and surfaces in libconfig format.

    .. note::

        Requires `libconf <https://pypi.org/project/libconf/>`_ package.

    Libconfig format is also used by the `geomdl command-line application <https://github.com/orbingol/geomdl-cli>`_
    as a way to input shape data from the command line.

    :param obj: input geometry
    :type obj: abstract.SplineGeometry, multi.AbstractContainer
    :param file_name: name of the output file
    :type file_name: str
    :raises GeomdlException: an error occurred writing the file
Exports curves and surfaces in libconfig format.
Exports curves and surfaces in libconfig format .
def export_cfg(obj, file_name):
    """ Exports curves and surfaces in libconfig format.

    .. note::

        Requires `libconf <https://pypi.org/project/libconf/>`_ package.

    Libconfig format is also used by the `geomdl command-line application <https://github.com/orbingol/geomdl-cli>`_
    as a way to input shape data from the command line.

    :param obj: input geometry
    :type obj: abstract.SplineGeometry, multi.AbstractContainer
    :param file_name: name of the output file
    :type file_name: str
    :raises GeomdlException: an error occurred writing the file
    """
    def callback(data):
        return libconf.dumps(data)

    # Check if it is possible to import 'libconf'
    try:
        import libconf
    except ImportError:
        raise exch.GeomdlException("Please install 'libconf' package to use libconfig format: pip install libconf")

    # Export data
    exported_data = exch.export_dict_str(obj=obj, callback=callback)

    # Write to file
    return exch.write_file(file_name, exported_data)
def export_cfg ( obj , file_name ) : def callback ( data ) : return libconf . dumps ( data ) # Check if it is possible to import 'libconf' try : import libconf except ImportError : raise exch . GeomdlException ( "Please install 'libconf' package to use libconfig format: pip install libconf" ) # Export data exported_data = exch . export_dict_str ( obj = obj , callback = callback ) # Write to file return exch . write_file ( file_name , exported_data )