KTUG 한국 텍 사용자 그룹

Menu

KTUG :: Q&A 마당 › Circuitikz에서 전구(lamp) 모양을 바꿀 수는 없을까요?

Wool | 2018.09.09 13:28:38 | 메뉴 건너뛰기 쓰기

안녕하세요. 반갑습니다. 늘 도움만 받고 있는데 이렇게 또다시 도움을 청합니다.

다름이 아니라 tikz에 빠져들어 지내다 circuitikz를 알게되어 신세계에 다시 한번 눈을 뜨고 있는 중입니다.

수업 자료의 많은 회로도들을 이걸로 만들면 되겠다고 싶은데....

lamp 모양이 우리나라 교과서와 너무 다르네요.

물론 첫 수업에서 lamp를 이렇게 쓴다고 이야기를 해도 되지만

다른 곳에 소개를 하기에도 불편한 감이 있습니다. (ㅠㅠ)

circuitikz램프 모양은 원 가운데가 X입니다.

lamp1.png

우리나라 교과서에 등장하는 램프 모양은 꼬인선이죠

lamp2.png

수정해서 쓰려면 circuitikz 라이브러리를 받아서 해당 lamp부분을 변경해야하는건가요?

라이브러리에서 lamp부분은 다음과 같은데... 이것도 tikz로 그린걸까요? tikz에서 이런걸 못본거 같아서요. 

\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{

    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}

    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
    \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
    \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
    \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
    \pgfusepath{draw}
}


\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tline/height}
                        }{tline}{\ctikzvalof{bipoles/tline/height}
                                 }{\ctikzvalof{bipoles/tline/width}
                                   }    
          {
          \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
          \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
          \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0}}
                         {\pgfpoint{\pgf@circ@res@step}{0}}
                         {\pgfpoint{0}{-\pgf@circ@res@up}}
          \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
          \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
          \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
          \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
          \pgfusepath{draw}
}
 

첨부 [2]

댓글 [1]

댓글 쓰기

목록

KTUG 한국 텍 사용자 그룹