A Guide to Mesh Attributes in SAMSON’s Node Specification Language

Molecular modelers often face challenges when they need to customize and retrieve information about specific molecular nodes, especially when working with mesh nodes. To help streamline these workflows, SAMSON’s Node Specification Language (NSL) provides a clear framework for defining and accessing mesh attributes. In this post, we’ll explore the fundamental mesh attributes NSL offers, what they correspond to, and how they can be used in molecular modeling.

What are Mesh Attributes?

Mesh attributes belong to the mesh attribute space (abbreviated as me) in NSL and are specifically designed for mesh nodes. These attributes make it easier to check properties like visibility, material ownership, and selection directly from NSL expressions. For instance, these attributes allow defining queries such as “select all visible mesh nodes” or “filter by mesh name.”

Key Attributes and How to Use Them

Here is a breakdown of the main mesh attributes and examples of how they can be used:

Attribute Name Short Name Possible Values Usage Examples
hasMaterial hm true, false me.hm
not me.hm
hidden h true, false me.h
not me.h
name n Strings in quotes me.n "A"
me.n "L*"
ownsMaterial om true, false me.om
selected (None) true, false me.selected
not me.selected
selectionFlag sf true, false me.sf false
me.sf
visibilityFlag vf true, false me.vf false
me.vf
visible v true, false me.v
not me.v

Examples in Practice

Let’s look at how these attributes can solve everyday modeling problems:

  • Filtering mesh nodes based on visibility: Use the me.v (visible) attribute to identify all visible meshes in your model. For example, me.v returns all visible mesh nodes, while not me.v retrieves all hidden ones.
  • Checking material presence: Utilize the me.hm (hasMaterial) attribute to determine whether a mesh node is associated with a material. This can be helpful when rendering specific parts of a structure.
  • Identifying specific meshes by name: Search for specific mesh nodes using me.n, such as me.n "A" to find all meshes named “A.” Wildcards such as "L*" can help locate all names starting with L.

Conclusion

Mastering mesh attributes in NSL can significantly simplify your molecular modeling workflows with SAMSON. By applying these attributes effectively, you gain a powerful way to control and retrieve information from your mesh nodes. For an in-depth reference, check out the original documentation page at https://documentation.samson-connect.net/users/latest/nsl/mesh/.

SAMSON and all SAMSON Extensions are free for non-commercial use. To explore SAMSON further, visit https://www.samson-connect.net.

Comments are closed.