io - read/write mesh or data files

read(name: str, type=None, **opts) madcad.mesh.Mesh

load a mesh from a file, guessing its file type

write(mesh: madcad.mesh.Mesh, name: str, type=None, **opts)

write a mesh to a file, guessing its file type

cache(filename: str, create: Optional[callable] = None, name=None, storage=None, **opts) madcad.mesh.Mesh

Small cachefile system, it allows to dump objects to files and to get them when needed.

It’s particularly usefull when working with other processes. The cached files are reloaded only when the cache files are newer than the memory cache data

If specified, create() is called to provide the data, in case it doesn’t exist in memory neighter as file if specified, name is the cache name used to index the file it defaults to the filename if specified, storage is the dictionnary used to storage cache data, defaults to io.caches

caches

dict containing the data objects, associated to their filename.

{'filename': (read_time, data_loaded)}
class FileFormatError