Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using implicit_plot3d to create a plane between three points

Hello all. I'm an undergrad at the beginning phases of an applied crystallography/group theory research project and have been using Sage to make some simple visualization/symmetry analysis scripts. What I'm currently trying to do is create a plane for each face of certain high symmetry groups. Here's an example:

http://chem302.xyz/wp-content/uploads/2020/04/Tetrahedral.html

How would I create a plane to represent each face of the tetrahedron? In the code below S[1] through S[4] represent the different coordinates in space that make up the substituent molecules/vertices.

def tetra(XY4,q):

    A = { 0: (0,0,0) }

    S = {3 : (2**(1/2), 1, 0), 2 : (-2**(1/2), 1, 0), 1: (0, -1, 2**(1/2)), 4: (0, -1, -2**(1/2))}

    C2R = { 1 : (0,2.5,0), 2: (0,-2.5,0) }

    C3R = { 1 : (0, -2*.75, 2*2**(1/2)*.75), 2 : (0, 2*.75, -2*2**(1/2)*.75) }

    C2R_pair = { 1 : [ C2R[1],C2R[2] ] }

    C3R_pair = { 2 : [ C3R[1],C3R[2] ] }

    Axis_label = { (0, (-2*.75)-0.10, (2*2**(1/2)*.75)+0.10): 'C3', (0,2.75,0): 'C2' }

    Substituents = { S[1]: 'H', S[2]: 'H', S[3]: 'H', S[4]: 'H' }

    Additions = { S[1]: 'H', S[2]: 'H', S[3]: 'H', S[4]: 'H' }

    Central_Atom = { A[0] : 'N' }

    Sub_Bonds = { 'A0-S1' : [A[0],S[1]], 'A0-S2' : [A[0],S[2]], 'A0-S3' : [A[0],S[3]], 'A0-S4': [A[0],S[4]] }

    Sym_outline = {'S2-S3': [S[2],S[3]], 'S3-S4' : [S[3],S[4]], 'S2-S4': [S[2],S[4]], 'S1-S2': [S[1],S[2]], 'S1-S3': [S[1],S[3]], 'S1-S4': [S[1],S[4]]}

    Sym_Scale = { 'yz' : [(-1.5,1.5),(-2**(1/2),2**(1/2)),(-2**(1/2),2**(1/2))], 'xy': [(-1.5,1.5),(-2,2),(-2,2)] }

So if I want to create a plane between:

S[1] = (0, -1, 2**(1/2), S[2] = (-2**(1/2), 1, 0), S[3] = (2**(1/2), 1, 0)

Would I use implicit_plot3d? I tried to use list_plot3d but it did not cover the entire face.