1
$\begingroup$

I'm representing a portion of molecule, P3HT, in Mathematica as a pentagon that I build using Polygon and Graphics3D.

I would like to represent the vertices of the pentagon as spheres(corresponding to atoms).

If possible I would like to add a vector perpendicular to the P3HT plane stemming from the centroid of the plane.

Here's what I have so far:

The atomic coordinates:

C1 := {-1.51767 , 2.46541, -0.0036}
C2 := {-1.15943, 1.11229, -0.00326}
C3 := {0.25701, 0.88881, -0.00082}
C4 := {0.9979, 2.09239, 0.00071}
S := {-0.10561, 3.33212, -0.00095}

The molecular plane, defined by the atomic coordinates:

P3HTPlane = Polygon[{{-1.51767`, 2.46541`, -0.0036`}, {-1.15943`, 
1.11229`, -0.00326`}, {0.25701`, 0.88881`, -0.00082`}, {0.9979`, 
2.09239`, 0.00071`}, {-0.10561`, 3.33212`, -0.00095`}}]

The centroid of the plane:

OO = RegionCentroid[P3HTPlane]

The plot of the plane with the centroid included:

Graphics3D[{LightOrange, P3HTPlane, Red, PointSize[0.02], Point[OO]}, 
BoxRatios -> {1, 1, 1}]

In case it helps, here's the molecule I'm working with:

ChemicalData["3-hexylthiophene", "MoleculePlot"]

Thanks for the help!

$\endgroup$
  • 1
    $\begingroup$ You can draw a sphere centered at C1 with radius say 0.1 using Sphere[C1, 0.1]. You can draw multiple spheres using Sphere[C1, 0.1], Sphere[C2, 0.1], ... or just Sphere[{C1, C2, ...}, 0.1] for short. You'll want to remove the BoxRatios -> {1, 1, 1} option though or the spheres won't look like spheres. $\endgroup$ – Rahul Aug 26 '16 at 23:12
  • $\begingroup$ Awesome! I got the whole thing working. Thank you very much! $\endgroup$ – Victor Murcia Aug 26 '16 at 23:57