meshing.save_obj

meshing.save_obj(mesh, path, *, merge_planar=True)

Write a Wavefront OBJ file with merged planar n-gon faces.

Parameters

Name Type Description Default
mesh Mesh A dual-contour :class:~cadjoint.meshing.dual_contouring.Mesh. required
path str | Path Output file path. required
merge_planar bool Merge coplanar quads into n-gons via :func:merge_planar_faces; when False every triangle of mesh.faces is written unmerged. True

All mesh vertices are written (1-based OBJ indexing keeps the original row order), so faces of either kind index the same vertex list. Faces index the lowest of any coincident rows and triangles that collapse there are dropped (:func:remove_slivers), so a reader that merges coincident points sees the same closed surface. The output is deterministic for a given mesh.