I'm trying to replicate a mosaic I found on one of the example pages. I haven't looked at the code (where's the fun in that?), and I won't until I have something approximating a result, but I am running into a problem:
I have to name 36 paths and find intersections between them. Now, the simplest way to do that is with a foreach loop: \foreach \s in {0,...,35} {
\path[name path=c\s] (120+\s*\angle:4) arc({-167.2+\s*\angle}:-219.2+\s*\angle:10) arc(39.2+\s*\angle:-12.8+\s*\angle:10) arc(60+\s*\angle:120+\s*\angle:4) -- cycle;
};
(I have to learn a simpler way to define that path!) Anway, I can find the intersection between c0 and c1:
\path[name intersections={of=c0 and c1,by=I0}];
and draw the needed circle through it:
\node [draw] at (O) [circle through={(I0)}] {};
This works... most of the time. For some reason I can't understand, the compiler starts not being able to find the curve c0 and I have to exit and reload the program (not just the file.) That's why I think this is a LyX issue.
However, it occurs to me that the way I have defined the curve names is, perhaps, not the best way to go about this.
Any thoughts?
-Dan
Here's the code for the first part of the mosaic:
Code: Select all
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections,through}
\newcommand*{\myangle}{10}
\begin{tikzpicture}[scale=0.6]
\coordinate (O) at (0,0);
\foreach \s in {0,...,35} {
\path[name path=c\s] (120+\s*\myangle:4) arc({-167.2+\s*\myangle}:-219.2+\s*\myangle:10) arc(39.2+\s*\myangle:-12.8+\s*\myangle:10) arc(60+\s*\myangle:120+\s*\myangle:4) -- cycle;
\draw (120+\s*\angle:4) arc({-167.2+\s*\myangle}:-219.2+\s*\myangle:10) arc(39.2+\s*\myangle:-12.8+\s*\myangle:10) arc(60+\s*\myangle:120+\s*\angle:4) -- cycle;
};
\draw (O) circle(12);
\path[name intersections={of=c0 and c1,by=I0}];
\node [draw] at (O) [circle through={(I0)}] {};
\path[name intersections={of=c0 and c2,by=II0}];
\node [draw] at (O) [circle through={(II0)}] {};
\path[name intersections={of=c0 and c3,by=III0}];
\node [draw] at (O) [circle through={(III0)}] {};
\path[name intersections={of=c0 and c4,by=IV0}];
\node [draw] at (O) [circle through={(IV0)}] {};
\path[name intersections={of=c0 and c5,by=V0}];
\node [draw] at (O) [circle through={(V0)}] {};
\end{tikzpicture}
is supposed to mean. I keep having trouble posting code here. Is there a tutorial I can read, or something?! Illegal parameter number in definition of \tikz@scan@point@coordinate.
<to be read again>
$
l.9 }
;
?
! Emergency stop.