2

I am a beginner in LaTeX, trying to draw a series of sketches, close to engineering drawings, in order to illustrate the equations governing the constriction resistance of two pieces of metal pushed together. A classical example is a terminal tongue bolted to a terminal block. The MWE illustrates a cross-section of a copper tongue, plated with tin, with a central hole for bolting it. One key factor is the rugosity of the conductive surfaces that, when bolted, exhibit a combination of plastic an elastic deformations. I would like to enhance the code, (mostly borrowed), in order for the black lines to be affected by the same rugosity as the top and bottom surfaces. (and become gray like the outline of the shape, but thinner as the plating is not sectioned in the area). I have tried various options do do this, but could not reach anything satisfactory.

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\definecolor{copper}{rgb}{0.69, 0.25, 0.21}
\definecolor{tin}{rgb}{0.7, 0.7, 0.7}

\begin{document}
\begin{tikzpicture}
\draw[ultra thick]
(3,0)--(6,0);
\draw[ultra thick]
(3,2)--(6,2);
\draw[ultra thick, tin, fill=copper]
(0,0)--(0,2) 
\pgfextra{\pgfmathsetseed{10}}
decorate[decoration={random steps,segment length=0.2cm,amplitude=.05cm, }]
{-- (3,2)} -- (3,0) 
\pgfextra{\pgfmathsetseed{12}}
decorate[decoration={random steps,segment length=0.2cm,amplitude=.05cm}]
{-- (0,0)};
\draw[ultra thick, tin, fill=copper]
(6,0)--(6,2) 
\pgfextra{\pgfmathsetseed{14}}
decorate[decoration={random steps,segment length=0.2cm,amplitude=.05cm}]
{-- (9,2)} -- (9,0) 
\pgfextra{\pgfmathsetseed{11}}
decorate[decoration={random steps,segment length=0.2cm,amplitude=.05cm}]
{-- (6,0)};
\end{tikzpicture}
\end{document}
1

I don't know if what you want is this, but hope this will help you.

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\definecolor{copper}{rgb}{0.69, 0.25, 0.21}
\definecolor{tin}{rgb}{0.7, 0.7, 0.7}

\tikzset{
  rugous/.style = {tin, thick,
    decoration={random steps,segment length=0.2cm,amplitude=.05cm}
  },
  rugous block/.style = {rugous, fill=copper, ultra thick},
}

\begin{document}
  \begin{tikzpicture}
    \draw[rugous,decorate] (3,0) -- (6,0);
    \draw[rugous,decorate] (3,2) -- (6,2);
    \filldraw[rugous block]
      (0,0) -- ++(0,2) decorate{-- ++(3,0)} -- ++(0,-2) decorate{-- ++(-3,0)};
    \filldraw[rugous block]
      (6,0) -- ++(0,2) decorate{-- ++(3,0)} -- ++(0,-2) decorate{-- ++(-3,0)};
  \end{tikzpicture}
\end{document}

enter image description here

1
  • Simple, educational and elegant. Useful simplicity for future use. – Yves Jan 3 '15 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.