更新

更新

当我尝试创建一个眼睛图标来说明笔记中的某些内容时,我想到了以下内容:

\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}

得出的结果为:

在此处输入图片描述

我遇到的问题是调整图表大小,因为我不喜欢内圆与眼睛设计无关。使用节点可能会有很大帮助。本质上,我希望内圆相对于外形缩小和扩大。我知道这一点,scale可以transform shape提供帮助,但我正在寻找灵活的东西,例如\tikzeye{<height>}{<width>}\tikzeye{<scale>}。欢迎任何其他设计或变体。我知道该dingbat包已\eye定义命令,但它不太灵活。

编辑:

我喜欢剪辑的想法。如果点 P1 和 P2 在圆上,点 Q1 和 Q2 在曲线上,假设 P1 和 Q1 在顶部,P2 和 Q2 在底部,如何使这些点 P1 和 Q1 以及 P2 和 Q2 分别相等?见下图。

\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}

在此处输入图片描述

答案1

这是我对你的眼睛的诠释,试图让它看起来更有机一些:

\def\eyepath{(-3,0) .. controls (-2,1.8) and (2,2.2) .. (2.7,0) .. controls (2,-1.2) and (-2,-1.4) .. (-3,0)--cycle;}


\begin{tikzpicture}[scale=0.25]
\clip\eyepath;
\filldraw[color=orange!50!black] (-.2,.2) circle (1.5);
\fill[color=black] (-.2,.2) circle (0.7);
\fill[color=white] (.3,.5) circle (0.2);
\draw[very thick]\eyepath;
\end{tikzpicture}

眼睛

关于您的问题,您可以将此 tikzpicture 放入\scalebox(来自graphicx包)中以获得任何所需的尺寸。还请注意,我的眼睛略微不对称。您可以使用它\reflectbox来获得另一只眼睛 :-)

更新

我无法抗拒,我尝试用更现实的眼光来看待它(可能不符合问题的精神,抱歉!)

\documentclass{article}
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{calc,decorations.pathmorphing}
\begin{document}

\def\eye#1{\scalebox{#1}{
\def\topedge{(-3,0) .. controls (-2,1.8) and (2,2) .. (2.3,.3)}
\def\bottomedge{(2.3,.3) .. controls (2,-2.2) and (-2,-1.2) .. (-3,0)}
\def\eyepath{\topedge -- \bottomedge --cycle;}

\begin{tikzpicture}[scale=0.25]
  \clip\eyepath;
  % Iris
    \filldraw[color=orange!30!black] (-.2,.2) circle (1.4);
  % Shadow on iris
    \filldraw[color=orange!40!black] (-.3,-.1) circle (1.1);
  % Iris lines
    \foreach \a in {0,5,...,360}{
      \pgfmathparse{25+28*rnd}
      \fill[orange!\pgfmathresult!black, decoration={random steps, segment length=1pt, amplitude=0.3pt}, decorate, line width=0.3pt  ] (-.2,.2) -- ++($(\a+2*rnd:.8+0.3*rnd)$) -- ++(\a+90:3pt) -- cycle;
    }
  % Pupil
    \fill[color=black] (-.2,.2) circle (0.5);
  % Sun reflection
    \fill[color=white] (90:.8) {[rotate=-30] circle (0.2 and 0.12)};
  % Shadow of the eyelid
    \draw[line width=2.5mm, draw opacity=0.1, line cap=round]\topedge;
  % Eyelids
    \draw[line width=1mm, red!40!white!80!black, line cap=round]\bottomedge;
    \draw[line width=1.2mm, red!40!white!60!black, line cap=round]\topedge;
  % Lacrimal
    \fill[red!40!white!80!black] (-2.8,0) circle (.25);
    \fill[white] (-2.7,.1) circle (.03);
\end{tikzpicture}
}}

\eye{1}
\end{document}

眼睛

相关内容