print_export
Export each colour group of a molecular structure as a separate watertight STL file, ready for multi-material 3D printing slicers.
Instructions
Exports a structure as watertight STL files ready for multi-colour 3D printing.
Each colour group becomes one STL file. PyMOL's OBJ exporter writes the whole visible scene, so each group is isolated on its own before export, then rebuilt into a single watertight, manifold solid. All groups share the same coordinate frame, so a slicer can load them as aligned multi-material parts (e.g. add the second STL as a "part" of the first in Bambu Studio).
Requires the optional print extra (trimesh, pymeshlab); see the install
hint returned if the libraries are missing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groups | Yes | Semicolon-separated ``label=selection`` pairs, one per colour. Example: "protein=polymer.protein; nucleic=polymer.nucleic". | |
| method | No | "auto" (light cleanup if the export is already watertight, else poisson with voxel fallback), "poisson" (keeps detail, best for bulky chains), or "voxel" (robust for thin nucleic acids). | auto |
| out_dir | No | Directory for the STL files (default: current directory). | . |
| obj_name | Yes | PyMOL object to export (e.g. "1abc"). | |
| voxel_pitch | No | Voxel size in Angstrom for the voxel method. Smaller keeps more detail; 0.7 keeps a ~10 A helix intact. | |
| poisson_depth | No | Screened-Poisson octree depth; higher = more detail. | |
| representation | No | What geometry to export. "surface" (default, unchanged) isolates each group as its own temp object and exports its molecular surface. "cartoon" exports the *currently displayed* cartoon geometry of the real objects, preserving per-residue rep flags and per-object cartoon type (e.g. a `cartoon tube` spine from :func:`print_ribbon_view`). In cartoon mode each group must name whole object(s) — one colour per object (e.g. "1abc or 1abc_spine") — and groups are isolated by toggling object visibility, no temp objects. | surface |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |