Carving script

Uploaded: Mar 19, 2026

SAMSON version: 11.0.0

5
3

This document contains an example of a "carving" script. The script assumes the document contains contains a watertight mesh (which can be obtained by importing OBJ or STL files into SAMSON), and creates two selection groups: one for atoms inside the mesh, and one for atoms outside. These groups can then be used to delete the corresponding atoms.

The script should be considered as a starting point since it does not use any acceleration structures (e.g., a bounding-volume hierarchy on the mesh) and can be slow when the mesh contains many triangles.

This document can be opened in SAMSON,
the integrative platform for molecular design.

To use this document:

1. Create your free account and choose a molecular design plan
2. Download and install SAMSON on your computer
3. Come back to this page to download the document and open it in SAMSON.
Alternatively, import the document directly from SAMSON using the import link.