For molecular modelers delving into the SAMSON Integrative Molecular Design platform, efficiently managing and understanding mesh attributes in SAMSON’s Node Specification Language (NSL) can improve workflows significantly. Whether you’re working on structural analysis, visualization, or custom scripting, knowing how to query and manipulate mesh nodes is invaluable.
The mesh attribute space (short name: me) allows you to target and apply operations specifically to mesh nodes. These nodes are fundamental when working with molecular representations that involve complex surfaces, material properties, visibility settings, and more. Let’s explore what this space offers and how you can leverage it effectively.
Key Mesh Attributes in NSL
Here are some of the frequently used attributes within the mesh namespace and examples of their application:
| Attribute Name | Short Name | Possible Values | Examples |
|---|---|---|---|
| hasMaterial | hm |
true, false |
me.hmnot me.hm |
| hidden | h |
true, false |
me.hnot me.h |
| name | n |
String (in quotes) | me.n "A"me.n "L*" |
| ownsMaterial | om |
true, false |
me.om |
| selected | – | true, false |
me.selectednot me.selected |
| selectionFlag | sf |
true, false |
me.sf falseme.sf |
| visibilityFlag | vf |
true, false |
me.vf falseme.vf |
| visible | v |
true, false |
me.vnot me.v |
Practical Example: Querying Mesh Visibility
One common use case is identifying which meshes are currently visible in a scene. For example, you can use the visible attribute (me.v) to filter for visible mesh nodes:
|
1 2 |
// Query all visible mesh nodes me.v |
Similarly, if you want to find mesh nodes that are hidden, you can invert the query:
|
1 2 |
// Query all hidden mesh nodes not me.v |
Inherited Attributes
The mesh namespace also inherits attributes from the broader node attribute space. These include properties like hasMaterial, hidden, and name. For example, the name attribute is useful for selecting mesh nodes by specific identifiers:
|
1 2 |
// Query mesh nodes with a name starting with "L" me.n "L*" |
By combining these attributes in logical expressions, you can precisely target mesh nodes of interest, even in large and complex molecular models.
Conclusion
With a solid grasp of mesh attributes, SAMSON users can efficiently customize and automate their workflows, focusing on specific subsets of molecular data. Check out the detailed documentation at Mesh Attributes in NSL to explore more advanced examples and capabilities.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.
