export_landmark_file(landmarks_object, fp, extension=None, overwrite=False)¶
Exports a given shape. The
fpargument can be either or a str or any Python type that acts like a file. If a file is provided, the
extensionkwarg must be provided. If no
extensionis provided and a str filepath is provided, then the export type is calculated based on the filepath extension.
Due to the mix in string and file types, an explicit overwrite argument is used which is
landmarks_object (dict or
PointCloudor subclass of
PointCloudThe landmarks to export. The type of
PointCloudor subclass of it are supported by all exporters, while the rest are available only for the LJSON format.
fp (Path or file-like object) – The Path or file-like object to save the object at/into.
extension (str or None, optional) – The extension to use, this must match the file path if the file path is a string. Determines the type of exporter that is used.
overwrite (bool, optional) – Whether or not to overwrite a file if it already exists.
ValueError – File already exists and
fpis a str and the
Noneand the two extensions do not match
fpis a file-like object and
ValueError – The provided extension does not match to an existing exporter type (the output type is not supported).
ValueError – The provided type for landmarks_object is not supported.