The sample script for this task can be found below. You can either copy it inside of the Python Scripting console in SAMSON, or save it as a .py file and open this file in SAMSON when you need to execute this script.
This example shows how to select bonds which center lies in between of two planes: z_min and z_max
If you want to select bonds which center lies on a specific plane, just set z_min=z_max
# Get an indexer of all bonds in the active document. Here we use SAMSON Node Specification Language to get only bonds
allBondsIndexer = SAMSON.getNodes('node.type bond')
# two planes: 1.7A and 2.3A
z_min = Quantity.angstrom(1.7)
z_max = Quantity.angstrom(2.3)
for bond in allBondsIndexer: # a loop over an indexer
# compute the z-axis center of the bond
bondCenterZ = (bond.leftAtom.getZ() + bond.rightAtom.getZ()) / 2.0
# check whether the bond lies in between of desired planes
if bondCenterZ >= z_min and bondCenterZ <= z_max:
# select the bond by setting the selectionFlag to True
bond.selectionFlag = True
allBondsIndexer.clear() # clear an indexer
Thank you for the suggestion, @Cyril !
Yes, for now, it is possible only with an importer for crystallographic .cif files. There is a possibility to replicate crystals thanks to the Crystal Creator App, but it does not expand them periodically with bond connections. We will see what we can do.
Hello @Kava ! Thank you for your interest in SAMSON. As far as we know, no one is currently working on the STL exporter. But this would be a really nice feature. For the efficiency and speed reasons, the Gaussian surface is generated on GPU. Therefore, we don't have direct access to resulting shapes and it won't be that easy to export these shapes. We will see what we can do.
Another possibility is to program the Gaussian surface on CPU yourself and export the resulting shape in the STL file (see Documentation for developers).
Rendering of spheres is fast, it is done on GPU, rendering of disks should not make it much faster. It is the Document view, which makes it slower for bigger systems, but it will be faster in the next SAMSON version.
If you want to see the flat visualization of atoms, you can modify the rendering preferences via changing the lightning preferences in SAMSON (see User guide: Visualizing. Lightning section). Basically, in the SAMSON preferences (Ctrl/Cmd+K) go to Rendering > Lightning: set the light intensity for first and second lights to zero; set the ambient light to 1 and the Fresnel intensity to 0.