I doubt that there is a special solution for your CAD-files. I include technical drawing in my documents rather often and use \includepdf[options]{file}
together with PDF-files. They will give you vectorized drawings.
You will need the pdfpages
-package.
Here is a short example for this:
\documentclass[10pt]{article}
\usepackage{pdfpages}
\usepackage{graphicx}
\begin{document}
% Include all pages, don't auto scale
\includepdfset{pages=-,noautoscale}
....
% Include the PDF file somewhere
\includepdf{MY_CAD_FILE.pdf}
....
\end{document}
Please note that this will only work using pdflatex
. If you insist on using latex
you will have to convert the PDFs to EPS-files and include them via \includegraphics[...]{...}
. Nevertheless this will give you vectorized graphics as well.
You could also use media9
-package, but this will force the reader to use Adobe. This might not be intended (thanks AlexG for the suggestion).
Another alternative, inspired by https://tex.stackexchange.com/a/126179/34618
Code
\documentclass[tikz,border=1cm]{standalone}
%\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand\irregularline[2]{%
let \n1 = {rand*(#1)} in
+(0,\n1)
\foreach \a in {0.1,0.2,...,#2}{
let \n1 = {rand*(#1)} in
-- +(\a,\n1)
}
} % #1=seed, #2=length of horizontal line
\begin{document}
\begin{tikzpicture}
\draw[blue] (0,0) \irregularline{0.1cm}{6} -- (6,0)--(6,-2) --(0,-2) -- (0,0);
\foreach \t in {0,0.1,...,6} {\draw (\t,0) -- (\t,-2);}
\draw[red] (0,2) \irregularline{2mm}{6};
\end{tikzpicture}
\end{document}
UPDATE: for vertical drawing. One simply switches the coordinates in the command line as displayed below and an example.
\newcommand\irregularliney[2]{%
let \n1 = {rand*(#1)} in
+(\n1,0)
\foreach \a in {0.1,0.2,...,#2}{
let \n1 = {rand*(#1)} in
-- +(\n1,\a)
}
} % #1=seed, #2=length
\draw[yellow,thick] (0,0) \irregularliney{0.1cm}{6} -- (0,6)--(-2,6) --(-2,0) -- (0,0);
Best Answer
-- New -- Horizontal and vertical cotations.