pymol-open-source icon indicating copy to clipboard operation
pymol-open-source copied to clipboard

new API to export geometry per selection

Open speleo3 opened this issue 5 years ago • 1 comments

This is a feature request to export geometry per selection.

First requested by @jaredsampson on the pymol-users mailing list: https://www.mail-archive.com/[email protected]/msg15640.html

Input arguments:

  • atom selection
  • representation (e.g. surface or cartoon)

Output: CGO or lists of vertex and normal coordinates. CGO would be more generic, but eventually harder to use (needs to be parsed). List of coordinates would be specific for the primitive type (e.g. triangles), which will not work for some representations which have more than one primitive (e.g. cartoon can have triangles and cylinders).

speleo3 avatar Feb 25 '20 11:02 speleo3

Thanks, Thomas. This sounds great. To produce the different output possibilities, there could be a mode argument, with such options as:

  • CGO
  • triangles (like use_shaders=0)
  • primitives
  • possibly other text formats, e.g. Wavefront OBJ, VRML2?

For reference, my current application and the reason for my original inquiry on pymol-users, would be to export the surface geometry to calculate average per-residue surface normal vectors.

Also, the output for the "primitives" option could be a list of dicts, which would take care of handling multiple primitive types.

jaredsampson avatar Feb 25 '20 16:02 jaredsampson