I came across this collection of svg images for drawing diagrams related to laser optics. It is called "ComponentLibrary" and it is developed by Alexander Franzen.
I used it in the past by importing the various images into an svg editor. Then, by connecting lines between them and inserting text nodes, I got very nice results:
I was thinking of creating similar images in tikz, and create such figures and diagrams with tikz only.
But I would like to get some advice from the more experienced tikz users here about the dimensions and positions of such small images.
For example, I created this image of a sensor:
Its tikz code is
% file sensor.tikz
\begin{tikzpicture}
\draw[line width=0.25] (0,0) rectangle (1,1);
\draw[very thin] (1.3,0.45) rectangle (1.6,0.55);
\draw[very thin, rotate around={25:(0.75,0.5)}] (1.6,0.55) rectangle (1.3,0.45);
\draw[very thin, rotate around={-25:(0.75,0.5)}] (1.6,0.55) rectangle (1.3,0.45);
\end{tikzpicture}
I chose to create a rectangle with sides of length 1
, with its corners at (0,0)
and (1,1)
.
Now I want to add a wavy arrow to indicate some EM radiation hitting it:
So I plotted a wavy arrow from (4,0.5)
to (2,0.5)
, which I think is not ideal. Better is to instruct tikz to plot an arrow from "a bit to the right of the sensor, until the sensor".
%\usetikzlibrary{decorations.pathmorphing}
\begin{tikzpicture}
\input{sensor.tikz}
\path[->, draw=red,decorate,decoration={snake,pre length=3pt,post length=7pt}] (4,0.5) -- node[above] {Radiation} (2,0.5);
\end{tikzpicture}
I would like to ask for your thoughts about writing a collection of .tikz
files, mainly about what positions should I set to each optics component, and about pre defining nodes in each image.
Because once you have more than 3 or 4 images on your canvas, you have to be able to control their position and relation more systematically.