trimesh.path.exchange.load module

Functions

load_path(obj[, file_type])

Load a file to a Path object.

path_formats()

Get a list of supported path formats.

trimesh.path.exchange.load.load_path(obj, file_type=None, **kwargs)

Load a file to a Path object.

Parameters
  • obj (One of the following:) –

    • Path, Path2D, or Path3D objects

    • open file object (dxf or svg)

    • file name (dxf or svg)

    • shapely.geometry.Polygon

    • shapely.geometry.MultiLineString

    • dict with kwargs for Path constructor

    • (n,2,(2|3)) float, line segments

  • file_type (str) – Type of file is required if file object passed.

Returns

path – Data as a native trimesh Path object

Return type

Path, Path2D, Path3D object

trimesh.path.exchange.load.path_formats()

Get a list of supported path formats.

Returns

loaders – Extensions of loadable formats, ie: [‘svg’, ‘dxf’]

Return type

list of str