Skip to content

write_mesh builtin

write_mesh(path, mesh, *, ascii=False, dxf_entity='3dface')

Writes a .obj, .stl or ASCII R2000 .dxf mesh.

Parameters:

Name Type Description Default
path str or Path

The file; its extension picks the format.

required
mesh Mesh

The mesh. OBJ writes the face column group as g lines; DXF puts faces on the layer named by the face column layer, else 0.

required
ascii bool

Write ASCII instead of binary STL.

False
dxf_entity ('3dface', polyface)

One 3DFACE per triangle, or one polyface POLYLINE with shared vertices per layer, split past 32767 vertices or faces.

"3dface"

used in