In my attempt to create an eye icon to illustrate something in my notes, I came up with the following:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.25]
\filldraw[color=black] (0,0) circle (1.5cm);
\fill[color=white] (0,0) circle (1cm);
\draw[very thick](-3,0) .. controls (-2,2) and (2,2) .. (3,0) .. controls (2,-2) and (-2,-2) .. (-3,0)--cycle;
\end{tikzpicture}
\end{document}
This produces:
The problem I would have is to resize the diagram in that I do not like how the inner circles are independent of the eye design. May be using nodes would help a lot. Essentially I would like the inner circles shrink and expand with respect to the outer shape. I know that scale
and transform shape
can help but I am looking for something flexible like \tikzeye{<height>}{<width>}
or \tikzeye{<scale>}
. Any other designs or variants are welcome. I know the dingbat
package has an \eye
command defined but it is not too flexible.
EDIT:
I like the clipping idea. If a point P1 and P2 are on the circle and point Q1 and Q2 on the curve, how can make these points, P1 and Q1 and P2 and Q2 be the equal respectively given that P1 and Q1 are at the top and P2 and Q2 are at the bottom? See image below.
\begin{tikzpicture}[scale=0.25]
\filldraw[color=black] (0,0) circle (1.5cm); % Circle with points P1 and P2
\fill[color=white] (0,0) circle (1cm);
\filldraw[color=blue] (0,1.5) circle (3pt) node[above] {{\footnotesize p1}}; % Point P1 on the circle.
\filldraw[color=blue] (0,-1.5) circle (3pt) node[below] {{\footnotesize p2}};% Point P2 on the circle.
\draw[very thick,yshift=6cm](-3,0) .. controls (-2,2) and (2,2) .. (3,0) .. controls (2,-2) and (-2,-2) .. (-3,0)--cycle; % Curve in question
\filldraw[color=blue] (0,7.5) circle (3pt) node[above] {{\footnotesize q1}};% Point Q1 on the curve.
\filldraw[color=blue] (0,4.5) circle (3pt) node[below] {{\footnotesize q2}};% Point Q2 on the curve.
\end{tikzpicture}
scale=0.5
in your code, you get an eye of double size (even the inner circles). Anyway, you can also put your whole tikz picture inside a\scalebox
(fromgraphics
package) and thus even the line thickness will be scaled, or use\resizebox
to specify the final height and width.\eye
symbol fromdingbat
package andmdframed
package to highlight some text.