Function Repository Resource:

MoleculeMeshRegion

Source Notebook

Create a mesh region from a molecule

Contributed by: Jason Biggs

ResourceFunction["MoleculeMeshRegion"][mol]

returns a 3D MeshRegion constructed from mol.

Details and Options

ResourceFunction["MoleculeMeshRegion"] takes the same options as MoleculePlot3D and MeshRegion.

Examples

Basic Examples (2) 

Create a molecule from a chemical name and convert it to a mesh region:

In[1]:=
ResourceFunction["MoleculeMeshRegion"][
 Molecule["1-(2,4,6-trimethylphenyl)ethanone"]]
Out[1]=

Create a mesh region from a chemical entity:

In[2]:=
ResourceFunction["MoleculeMeshRegion"][
 Entity["Chemical", "TetraethylPyrophosphate"]]
Out[2]=

Options (3) 

Supply a PlotTheme to control how the molecule is rendered:

In[3]:=
ResourceFunction["MoleculeMeshRegion"][
 Entity["Chemical", "Trans2Methyl2PentenoicAcid"], PlotTheme -> "Tubes"]
Out[3]=

Specify a MeshCellStyle:

In[4]:=
ResourceFunction["MoleculeMeshRegion"][
 Molecule["(9Z,12Z,15Z)-octadeca-9,12,15-trienoyl chloride"], MeshCellStyle -> {{2, All} -> Opacity[0.5, Orange]}]
Out[4]=

Combine the "Spacefilling" plot theme from MoleculePlot3D with the "SmoothShading" plot theme from MeshRegion:

In[5]:=
ResourceFunction["MoleculeMeshRegion"][
 Molecule["5H-benzo[b][1,5]benzoxazepin-6-one"], PlotTheme -> {"Spacefilling", "SmoothShading"}]
Out[5]=

Publisher

JasonB

Version History

  • 1.0.0 – 06 April 2020

License Information