2010-12-04 11 views
4

나는 TikZ에서 유로 기호를 재구성하려고합니다. 내 기본 가이드는 내가 예에서 아크를 그리는 tikz 지시 드릴 수 없습니다 http://upload.wikimedia.org/wikipedia/commons/5/57/Euro_Construction.svgpgf/tikz로 EUR 기호 만들기

내가으로 실행했습니다 문제는 내가 지금까지 모든 교차로를 계산할 수 있다는 것입니다

하지만 입니다 A에서 K까지. 그 호를 클리핑을 사용하여 그릴 수 있지만, 내가 이해하는 한 연결된 경로는 경로가 아닙니다. 저는 모든 각도를 손으로 계산하는 것을 피하려고합니다. 내가 에서 \ pgfpoints는 예를 들어, 좌표 이름을 얻는 방법 : 그건 좀 지나친 것 같다 불구하고 SVG 지원에 대한

\ pgfpatharcto는 다음 문제로 날 리드 작업을 수행 할 수 ,이 (A) \ pgfpatharcto에서 사용 하시겠습니까? 심지어 더 나은 : 어떻게 내가 svg 경로 데이터에서 명명 된 좌표를 사용할 수 있습니까? 기본적으로 이 문제를 \ draw로 줄이면됩니다. (B) - (A) svg "a 6 6 0 0 0 (K)"- (O) ...;

는 내가 이미 가지고있는 것은 이것이다 :

Alt text http://img.skitch.com/20101204-ef3a3xwh2reqis67phqenmuxa2.png
Skitch

사용하여 업로드 :

\begin{tikzpicture} 
\draw[step=5mm, gray, very thin] (-7.5,-7.5) grid (7.5,7.5); % grid 

% inner and outer circle to be used for the intersections 
\path[name path=outer] (0,0) circle[radius=6]; 
\path[name path=inner] (0,0) circle[radius=5]; 

% upper, semi upper, semi lower and lower horizontal lines. 
\path[name path=U] (-7.5,1.5) -- (4,1.5); 
\path[name path=u] (-7.5,0.5) -- (4,0.5); 
\path[name path=l] (-7.5,-0.5) -- (4,-0.5); 
\path[name path=L] (-7.5,-1.5) -- (4,-1.5); 

% the upwards slope and the vertical line at +-40 deg at 5 units. 
\path[name path=slope] ($(0,-6)!0.25!(40:5)$) -- ($(0,-6)!1.25!(40:5)$); 
\path[name path=fourty] ($(40:5)!0.5!(-40:5)$) -- ($(40:5)!1.25!(-40:5)$); 

% naming all the intersections. 
\path[name intersections={of=outer and slope, by={A}}]; 
\path[name intersections={of=inner and slope, by={B}}]; 

\path[name intersections={of=U and slope, by={C}}]; 
\path[name intersections={of=u and slope, by={D}}]; 
\path[name intersections={of=l and slope, by={E}}]; 
\path[name intersections={of=L and slope, by={F}}]; 

\path[name intersections={of=U and inner, by={G}}]; 
\path[name intersections={of=u and inner, by={H}}]; 
\path[name intersections={of=l and inner, by={I}}]; 
\path[name intersections={of=L and inner, by={J}}]; 

\path[name intersections={of=U and outer, by={K}}]; 
\path[name intersections={of=u and outer, by={L}}]; 
\path[name intersections={of=l and outer, by={M}}]; 
\path[name intersections={of=L and outer, by={N}}]; 

\coordinate (O) at ($(-7.5,0.5)+(C)-(D)$); 
\coordinate (P) at (-7.5,0.5); 
\coordinate (Q) at ($(-7.5,-1.5)+(E)-(F)$); 
\coordinate (R) at (-7.5,-1.5); 

\path[name intersections={of=fourty and inner, by={S}}]; 
\path[name intersections={of=fourty and outer, by={T}}]; 

% drawing the intersections 
\foreach \p in {A,...,T} \fill[red] (\p) circle (2pt) node[above left,black] {\footnotesize\p}; 

% constructing the path 
\draw (A) -- (B) (G) -- (C) -- (D) -- (H) (I) -- (E) -- (F) -- (J) (S) -- (T) (N) -- (R) -- (Q) -- (M) (L) -- (P) -- (O) -- (K); 

% missing segments 
\draw[gray,dashed] circle[radius=5] circle[radius=6]; 

\end{tikzpicture} 

UPDATE합니다 (PGF의 마린의 도움으로 g 목록 우리는 다음과 같은 솔루션에 도착)

\draw[thick,fill] let \p1=(A), \p2=(K), \p3=(L), \p4=(M), \p5=(N), \p6=(T), 
       \p7=(S), \p8=(J), \p9=(I), \p{10}=(H), \p{11}=(G), \p{12}=(B), 
       \n{aA}={atan2(\x1,\y1)}, \n{aK}={atan2(\x2,\y2)}, 
       \n{aL}={atan2(\x3,\y3)}, \n{aM}={360+atan2(\x4,\y4)}, 
       \n{aN}={360+atan2(\x5,\y5)}, \n{aT}={360+atan2(\x6,\y6)}, 
       \n{aS}={360+atan2(\x7,\y7)}, \n{aJ}={360+atan2(\x8,\y8)}, 
       \n{aI}={360+atan2(\x9,\y9)}, \n{aH}={atan2(\x{10},\y{10})}, 
       \n{aG}={atan2(\x{11},\y{11})}, \n{aB}={atan2(\x{12},\y{12})} 
       in (A) arc (\n{aA}:\n{aK}:6) -- (O) -- (P) 
       -- (L) arc (\n{aL}:\n{aM}:6) -- (Q) -- (R) 
       -- (N) arc (\n{aN}:\n{aT}:6) 
       -- (S) arc (\n{aS}:\n{aJ}:5) -- (F) -- (E) 
       -- (I) arc (\n{aI}:\n{aH}:5) -- (D) -- (C) 
       -- (G) arc (\n{aG}:\n{aB}:5) -- cycle; 
이 TikZ는 점의 각도를 계산 할 수 있습니다

하고 호하는 간단한 호출이다 기록한에서. 제게 까다로운 부분은 수학 엔진을 사용하는 것입니다. 설명서가 너무 많아 이고 중괄호를 사용하여 수학 엔진에 새 값이 할당되는 부분을 놓쳤습니다.

+1

BTW -이 질문은 주제로 다루지 만, tex.stackexchange.com에서 더 많은 라텍스 사용자가 등장합니다. 마이그레이션 경로가 없기 때문에 다시 게시해야합니다. – dmckee

답변

1

나는 오직 인출 한 것을 허용하면 1 (하나 그것을 계산) TikZ 그림,

\draw (A) arc (Aangle:Kangle:outerRadius) 
outerRadius는 6 Aangle이 40도 될 것으로 보인다 것으로 보인다

, 내가 잘못된 것입니다 제공된 데이터에서 Kangles를 즉시 보지 마십시오 (그러나 값은 완전히 제한됩니다 ... arcsin (1.5/6)처럼 보입니다).

+0

예. 올바른 방법입니다. 내가 붙어있는 곳은 각도 계산이다. – angerman