SAMSON Forum
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • SAMSON Connect
    • Get SAMSON

    Getting atoms inside a .stl object

    Brainstorm
    2
    4
    33
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Tom 1 last edited by

      SAMSON_stl.PNG

      I was wondering if it was possible to use a .stl object to carve crystals in SAMSON. I've been trying out different python snippets provided by the AI assistant which seem like they are just on the verge of doing it, but ultimately are missing some capability I can't quite find a way to add. SAMSON_STL.sam

      The idea is it you could position a solid mesh object on your crystal model, do some a test to see if an atom is inside the mesh, and then delete that atom. For simple meshes the test could be if it is inside the bounding box of the mesh.

      This could be a cool feature. SAMSON file attached of the system in the image.

      Thanks,

      Tom

      1 Reply Last reply Reply Quote 0
      • T
        Tom 1 last edited by

        I went back and tried to open the file I uploaded here and I get an error that it can't be loaded. Maybe .stls cannot be saved in a .sam?

        1 Reply Last reply Reply Quote 0
        • Stephane
          Stephane last edited by

          Hi Tom, it might be possible to use some computational geometry libraries that would determine whether a point in inside a triangulated object (it's non trivial for non-convex objects, but they can often be decomposed into convex parts). I'll look into the serialization of the STL objects but I don't immediately see any issues.

          1 Reply Last reply Reply Quote 0
          • Stephane
            Stephane last edited by

            This one might help: https://github.com/quant-sci/compute-geometry. If you have a convex object like the one in the image, I guess you'd first compute its convex hull thanks to this library, and you'd then use the resulting convex hull to determine whether an atom is inside or not.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post