Export Import

Export / import operations differ from most operations of the zencad library in that they are performed not only on objects in the program memory, but also on files. The evalcache caching library uses a special mechanism to work with files. It allows imports to take into account changes to the content of files, and exports are not performed unnecessarily.


Create an STL mesh file located in the path from the solid model model. The delta parameter determines the granularity. The smaller the delta, the smaller the size of the polygons.

to_stl(model, path, delta)

Importing SMALL stl and other mesh mesh formats is possible using third-party libraries such as trimesh. (see examples / Integration / trimesh)

Create a brep file of the BREP format located in the path path from the solid modelmodel.

to_brep(model, path)

Read the brep file of the BREP format located in the path path. Return the resulting model.

m = from_brep(path)


("0.34.0: Currently limited support. Not all curve types are supported.")

Create / read svg file from flat body model, located on pathpath.

to_svg(model, path)
model = from_svg(path)

Create / read svg string of flat body representation model.

svg = to_svg_string(model)
model = from_svg_string(svg)