0

I am mimicking a crystal lattice as follows:

enter image description here

The structure is created with nodes joined by edges but the outer nodes are connected with semi-transparent planer face as clearly shown here:

enter image description here Now, I am using same code as published in this reference. But how can I connect three outer atoms with semi-transparent plane?



Minimal Example:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,calc,3d}
\begin{document}
\begin{tikzpicture}[scale = 1]
%points on cube
\coordinate (B) at (0,0,4);
%center of faces
\coordinate (I) at (0,2,2); %center of face ABCD
\coordinate (L) at (2,0,2); %center of face ABFE
\coordinate (M) at (2,2,4); %center of face CBGF
%connector
\coordinate (O) at (1,1,3);
\coordinate (P) at (1,3,1);
\coordinate (Q) at (3,1,1);
\coordinate (R) at (3,3,3);
%place non-atom cube corners
\shadedraw [ball color= black] (B) circle (0.25cm);
%draw the center of each face
\shadedraw [ball color= red] (I) circle (0.25cm);
\shadedraw [ball color= red] (L) circle (0.25cm);
\shadedraw [ball color= red] (M) circle (0.25cm);
%connectors
\shadedraw [ball color= blue] (O) circle (0.45cm);
%connections from faces to O
\draw [very thick] (B) -- (O);
\draw [very thick] (I) -- (O);
\draw [very thick] (M) -- (O);
\draw [very thick] (L) -- (O);
\end{tikzpicture}
\end{document}
user0193
  • 241

1 Answers1

0

To draw transparent faces use the fill opacity key. First draw the faces in the back, then draw the atoms, then draw the faces in the front. Due to the perspective you have chosen the faces in the front will overlap the faces in back perfectly so you might as well just not draw them.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,calc,3d}
\begin{document}
\begin{tikzpicture}[scale = 1]
%points on cube
\coordinate (B) at (0,0,4);
%center of faces
\coordinate (I) at (0,2,2); %center of face ABCD
\coordinate (L) at (2,0,2); %center of face ABFE
\coordinate (M) at (2,2,4); %center of face CBGF
%connector
\coordinate (O) at (1,1,3);
\coordinate (P) at (1,3,1);
\coordinate (Q) at (3,1,1);
\coordinate (R) at (3,3,3);

% first draw faces in the back \filldraw[fill opacity=0.2] (I) -- (M) -- (B) -- cycle; \filldraw[fill opacity=0.2] (L) -- (M) -- (B) -- cycle;

% place non-atom cube corners \shadedraw [ball color= black] (B) circle (0.25cm); %draw the center of each face \shadedraw [ball color= red] (I) circle (0.25cm); \shadedraw [ball color= red] (L) circle (0.25cm); \shadedraw [ball color= red] (M) circle (0.25cm); %connectors \shadedraw [ball color= blue] (O) circle (0.45cm); %connections from faces to O \draw [very thick] (B) -- (O); \draw [very thick] (I) -- (O); \draw [very thick] (M) -- (O); \draw [very thick] (L) -- (O);

% draw faces in the front \filldraw[fill opacity=0.2] (I) -- (L) -- (B) -- cycle; \filldraw[fill opacity=0.2] (I) -- (L) -- (M) -- cycle; \end{tikzpicture} \end{document}

enter image description here

Henri Menke
  • 109,596
  • perfect!, thats exactly what I was looking for! Do you reckon the original 3D lattice diagrams were built using VESTA? – user0193 Feb 13 '22 at 19:37