Können Sie helfen, diese Figur zu zeichnen?
\documentclass[10pt]{standalone}
\usepackage{tikz}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
%upper ring
\draw[fill=yellow](0,0) ellipse(2 cm and .7 cm);
\draw[fill=white](0,0) ellipse(1.67 cm and .5 cm);
\def\d{1.5}
\draw(2,0)--++(0,-\d) coordinate(X1);
\draw(-2,0)--++(0,-\d) coordinate(X2);
\draw (X1) arc(0:-180:2cm and .6cm);
%lower ring
\draw[fill=yellow](0,-4) ellipse(2 cm and .7 cm);
\draw[fill=white](0,-4) ellipse(1.67 cm and .5 cm);
\def\d{1.95}
\draw(2,-4)--++(0,-\d) coordinate(X1a);
\draw(-2,-4)--++(0,-\d) coordinate(X2a);
\draw (X1a) arc(0:-180:2cm and .6cm);
\foreach\y in{-4.1,-4.15, ..., -5.9} \draw(2,\y) arc(0:-180: 2cm and .6cm);
%the cylinder
\draw[fill=yellow](0,3) ellipse(1.3 cm and .5 cm);
\def\d{11}
\draw(1.3,3)--++(0,-\d) coordinate(X1);
\draw(-1.3,3)--++(0,-\d) coordinate(X2);
\draw (X1) arc(0:-180:1.3cm and .5cm);
%circuit
\draw(2,-4.5)--(2.7,-4.5)--++(0,1.5)--++(.5,0)--++(.8,.3);
\draw(2,-5.5)--(2.7,-5.5)--++(0,-1.5)--++(1,0);
\coordinate(K1)at(5,-3);
\coordinate(K0)at(5,-5);
\coordinate(K2)at(5,-7);
\draw(K1)to[battery] (K0);
\draw(K0)to[battery] (K2);
\draw(K1)--++(-.9,0);
\draw(K2)--++(-1.3,0);
%labels
\scriptsize
\draw(-2.3,2)node[left] {ferrous core}--++(1,-.2);
\draw(-2.6,0)node[left] {aluminium ring}--++(.7,-.2);
\draw(-2.6,-5)node[left] {coil of insulated wire}--++(.7,-.2);
\end{circuitikz}
\end{document}
Antwort1
UPDATE 2:
Auch eine monochrome Version ist erhältlich, allerdings mit Beibehaltung der aufgesetzten Metallic-Töne.
U2 ERGEBNIS:
U2 MWE:
\documentclass[border=3.14pt,tikz]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\pgfdeclarelayer{background layer}
\pgfdeclarelayer{foreground layer}
\pgfsetlayers{background layer,main,foreground layer}
\begin{document}
\begin{tikzpicture}
\def\alt{0.55}
\def\Ring#1#2#3#4#5[#6]{%\Ring{position}{Radious}{widht}{height}{color}[ID]
\begin{scope}[shift={(#1)}]
\coordinate (#6--east) at (0:#2);
\coordinate (#6--west) at (180:#2);
\begin{pgfonlayer}{background layer}
\fill[fill=#5,even odd rule]
(0:#2)
arc (0:180:#2 and #2*\alt)
-- (180:#2-#3)
arc (180:0:#2-#3 and #2*\alt-#3*\alt);
\fill[draw,fill=#5]
(0:#2-#3)
arc (0:180:#2-#3 and #2*\alt-#3*\alt)
--++(0,-#4)
arc (180:0:#2-#3 and #2*\alt-#3*\alt)
-- cycle;
\draw[black](0:#2) arc (0:180:#2 and #2*\alt);
\draw[black](0:#2-#3) arc (0:180:#2-#3 and #2*\alt-#3*\alt);
\foreach \r in {45,135}{%forced radial shade
\foreach \i [evaluate={\s=20}] in {0,2,...,20}{
\fill [black, fill opacity=1/50]
(\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt) -- (\r-\s+\i:#2-#3 and #2*\alt-#3*\alt)
arc (\r-\s+\i:\r+\s-\i:#2-#3 and #2*\alt-#3*\alt) -- cycle;
}
}
\end{pgfonlayer}
\begin{pgfonlayer}{foreground layer}
\fill[fill=#5,even odd rule]
(180-1:#2)
arc (180-1:360+1:#2 and #2*\alt)
-- (360+1:#2-#3)
arc (360+1:180-1:#2-#3 and #2*\alt-#3*\alt);
\fill[fill=#5]
(0:#2)
arc (360:180:#2 and #2*\alt)
--++(0,-#4)
arc (180:360:#2 and #2*\alt)
-- cycle;
\draw[black]
(0:#2)
--++(0,-#4)
arc (360:180:#2 and #2*\alt)
--++(0,#4);
\draw[black](180-1:#2) arc (180-1:360+1:#2 and #2*\alt);
\draw[black](180-1:#2-#3) arc (180-1:360+1:#2-#3 and #2*\alt-#3*\alt);
\foreach \r in {-45,-135}{%forced radial shade
\foreach \i [evaluate={\s=20}] in {0,2,...,20}{
\fill [black, fill opacity=1/50]
(\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt) -- (\r-\s+\i:#2-#3 and #2*\alt-#3*\alt)
arc (\r-\s+\i:\r+\s-\i:#2-#3 and #2*\alt-#3*\alt) -- cycle;
}
}
\foreach \r in {-45,-90}{%forced radial side shade
\foreach \i [evaluate={\s=20}] in {0,2,...,20}{
\fill [black, fill opacity=1/50]
(\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt)-- ++(0,-#4) arc (\r-\s+\i:\r+\s-\i:#2 and #2*\alt) -- cycle;
}
}
\end{pgfonlayer}
\end{scope}
}
\def\cilinder#1#2#3#4[#5]{%\cilinder{position}{Radious}{height}{color}[ID]
\begin{scope}[shift={(#1)}]
\coordinate (#5--east) at (0:#2);
\coordinate (#5--west) at (180:#2);
\fill[draw,fill=#4] (0:#2) arc (0:180:#2 and #2*\alt) -- ++ (0,-#3) arc (180:360:#2 and #2*\alt) -- cycle;
\draw[black](0:#2) arc (0:360:#2 and #2*\alt);
\foreach \r in {135,45,-45,-135}{%forced radial shade
\foreach \i [evaluate={\s=20}] in {0,2,...,20}{
\fill [black, fill opacity=1/50]
(0,0) -- (\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt)-- cycle;
}
}
\foreach \r in {-85,-135}{%forced radial side shade
\foreach \i [evaluate={\s=20}] in {0,2,...,20}{
\fill [black, fill opacity=1/50]
(\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt)-- ++(0,-#3) arc (\r-\s+\i:\r+\s-\i:#2 and #2*\alt) -- cycle;
}
}
\end{scope}
}
%The metals
\cilinder{0,0}{1}{5}{white}[A]
\Ring{0,-1}{1.8}{0.5}{1}{white}[B]
\foreach \i in {1,...,18}{%Generate 18 named rings from CuRing-1 to CuRing-18
\Ring{0,-4.5+0.06*\i}{1.1}{0.1}{0mm}{white}[C\i]
}
%The circuit
\draw
(C14--east)%From te coordinate east of CuRing-14
-| ++(1,1)% Squared path first horizontal then vertical to x+1 and y+1 from previous coordinate (x,y)
to [nos] ++(2,0)%Normal Open Switch from previous coordinate (x',y') to (x'+2,y'+0)
to [battery] ++ (0,-1.4)
to [battery] ++ (0,-1.4)
-- ++ (-2,0)
|- (C2--east);
%labels
\scriptsize
\begin{pgfonlayer}{foreground layer}
\draw($(A--west)+(0.5,0)$) -- ++(-1,0.5)node[left] {ferrous core};
\draw($(B--west)+(0.25,0)$) -- ++(-1.2,0.5)node[left] {Aluminium ring};
\draw($(C18--west)+(0.07,0)$) -- ++(-1,0.5)node[left] {Coil of insulated wire};
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
AKTUALISIEREN:
Dies ist nur die Option mit weißen Füllungen.
U-ERGEBNIS:
U-MWE:
\documentclass[border=3.14pt,tikz]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\pgfdeclarelayer{background layer}
\pgfdeclarelayer{foreground layer}
\pgfsetlayers{background layer,main,foreground layer}
\begin{document}
\begin{tikzpicture}
\def\alt{0.55}
\def\Ring#1#2#3#4#5[#6]{%\Ring{position}{Radious}{widht}{height}{color}[ID]
\begin{scope}[shift={(#1)}]
\coordinate (#6--east) at (0:#2);
\coordinate (#6--west) at (180:#2);
\begin{pgfonlayer}{background layer}
\fill[fill=#5,even odd rule]
(0:#2)
arc (0:180:#2 and #2*\alt)
-- (180:#2-#3)
arc (180:0:#2-#3 and #2*\alt-#3*\alt);
\fill[draw,fill=#5]
(0:#2-#3)
arc (0:180:#2-#3 and #2*\alt-#3*\alt)
--++(0,-#4)
arc (180:0:#2-#3 and #2*\alt-#3*\alt)
-- cycle;
\draw[black](0:#2) arc (0:180:#2 and #2*\alt);
\draw[black](0:#2-#3) arc (0:180:#2-#3 and #2*\alt-#3*\alt);
\end{pgfonlayer}
\begin{pgfonlayer}{foreground layer}
\fill[fill=#5,even odd rule]
(180-1:#2)
arc (180-1:360+1:#2 and #2*\alt)
-- (360+1:#2-#3)
arc (360+1:180-1:#2-#3 and #2*\alt-#3*\alt);
\fill[fill=#5]
(0:#2)
arc (360:180:#2 and #2*\alt)
--++(0,-#4)
arc (180:360:#2 and #2*\alt)
-- cycle;
\draw[black]
(0:#2)
--++(0,-#4)
arc (360:180:#2 and #2*\alt)
--++(0,#4);
\draw[black](180-1:#2) arc (180-1:360+1:#2 and #2*\alt);
\draw[black](180-1:#2-#3) arc (180-1:360+1:#2-#3 and #2*\alt-#3*\alt);
\end{pgfonlayer}
\end{scope}
}
\def\cilinder#1#2#3#4[#5]{%\cilinder{position}{Radious}{height}{color}[ID]
\begin{scope}[shift={(#1)}]
\coordinate (#5--east) at (0:#2);
\coordinate (#5--west) at (180:#2);
\fill[draw,fill=#4] (0:#2) arc (0:180:#2 and #2*\alt) -- ++ (0,-#3) arc (180:360:#2 and #2*\alt) -- cycle;
\draw[black](0:#2) arc (0:360:#2 and #2*\alt);
\end{scope}
}
%The metals
\cilinder{0,0}{1}{5}{white}[A]
\Ring{0,-1}{1.8}{0.5}{1}{white}[B]
\foreach \i in {1,...,18}{%Generate 18 named rings from CuRing-1 to CuRing-18
\Ring{0,-4.5+0.06*\i}{1.1}{0.1}{0mm}{white}[C\i]
}
%The circuit
\draw
(C14--east)%From te coordinate east of CuRing-14
-| ++(1,1)% Squared path first horizontal then vertical to x+1 and y+1 from previous coordinate (x,y)
to [nos] ++(2,0)%Normal Open Switch from previous coordinate (x',y') to (x'+2,y'+0)
to [battery] ++ (0,-1.4)
to [battery] ++ (0,-1.4)
-- ++ (-2,0)
|- (C2--east);
%labels
\scriptsize
\begin{pgfonlayer}{foreground layer}
\draw($(A--west)+(0.5,0)$) -- ++(-1,0.5)node[left] {ferrous core};
\draw($(B--west)+(0.25,0)$) -- ++(-1.2,0.5)node[left] {Aluminium ring};
\draw($(C18--west)+(0.07,0)$) -- ++(-1,0.5)node[left] {Coil of insulated wire};
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
Nun, Sie haben praktisch alles gezeichnet. Was noch zu klären bleibt, ist, wie man es als 3D-Objekte anzeigt. Dazu muss man mit zwei zusätzlichen Ebenen arbeiten, eine für die Objekte dahinter und eine für die Objekte davor. Da es sich um Metalle handelt, habe ich alle mir zur Verfügung stehenden Schattierungsarten hinzugefügt. Um nicht alles wiederholen zu müssen, habe ich es in zwei Zeichenobjekte gruppiert, nämlich den Ring und den Zylinder. Nach einigem Herumprobieren habe ich sie so fixiert, dass Sie sie an einer bestimmten Position mit einem bestimmten Radius, einer bestimmten Breite, Länge, Farbe und einem bestimmten Namen zeichnen können. Auf diese Weise kann ich die Schattierungen auf alle Objekte anwenden, ohne alles erneut eingeben zu müssen. Da sich der Ring in den vorderen und hinteren Ebenen und der Zylinder in der Standardebene befindet, erwecken sie den Eindruck, dass der Zylinder durch die Mitte des Rings verläuft. Es gibt eine Variable \alt
, mit der Sie die Höhe der scheinbaren 3D-Ansicht ändern können.
ERGEBNIS:
MWE: (Hinweis: Die Kompilierung kann einige Sekunden länger als üblich dauern, da die erzwungenen Schattierungen viele Male wiederholt werden.)
\documentclass[border=3.14pt,tikz]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\pgfdeclarelayer{background layer}
\pgfdeclarelayer{foreground layer}
\pgfsetlayers{background layer,main,foreground layer}
\definecolor{cooper}{HTML}{CC9671}
\definecolor{aluminium}{HTML}{F1F1F2}
\definecolor{iron}{HTML}{646464}
\begin{document}
\begin{tikzpicture}
\def\alt{0.55}
\def\Ring#1#2#3#4#5[#6]{%\Ring{position}{Radious}{widht}{height}{color}[ID]
\begin{scope}[shift={(#1)}]
\coordinate (#6--east) at (0:#2);
\coordinate (#6--west) at (180:#2);
\begin{pgfonlayer}{background layer}
\shade[left color=#5,even odd rule](0:#2) arc (0:180:#2 and #2*\alt) -- (180:#2-#3) arc (180:0:#2-#3 and #2*\alt-#3*\alt);
\shade[draw,right color=black,left color=#5]
(0:#2-#3)
arc (0:180:#2-#3 and #2*\alt-#3*\alt)
--++(0,-#4)
arc (180:0:#2-#3 and #2*\alt-#3*\alt)
-- cycle;
\draw[black](0:#2) arc (0:180:#2 and #2*\alt);
\draw[black](0:#2-#3) arc (0:180:#2-#3 and #2*\alt-#3*\alt);
\foreach \r in {45,135}{%forced radial shade
\foreach \i [evaluate={\s=30}] in {0,2,...,30}{
\fill [black, fill opacity=1/50]
(\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt) -- (\r-\s+\i:#2-#3 and #2*\alt-#3*\alt)
arc (\r-\s+\i:\r+\s-\i:#2-#3 and #2*\alt-#3*\alt) -- cycle;
}
}
\end{pgfonlayer}
\begin{pgfonlayer}{foreground layer}
\shade[left color=#5,even odd rule]
(180-1:#2)
arc (180-1:360+1:#2 and #2*\alt)
-- (360+1:#2-#3)
arc (360+1:180-1:#2-#3 and #2*\alt-#3*\alt);
\shade[draw,left color=black!60!#5,middle color=#5,right color=#5!50!white]
(0:#2)
arc (360:180:#2 and #2*\alt)
--++(0,-#4)
arc (180:360:#2 and #2*\alt)
-- cycle;
\draw[black](180-1:#2) arc (180-1:360+1:#2 and #2*\alt);
\draw[black](180-1:#2-#3) arc (180-1:360+1:#2-#3 and #2*\alt-#3*\alt);
\foreach \r in {-45,-135}{%forced radial shade
\foreach \i [evaluate={\s=30}] in {0,2,...,30}{
\fill [black, fill opacity=1/50]
(\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt) -- (\r-\s+\i:#2-#3 and #2*\alt-#3*\alt)
arc (\r-\s+\i:\r+\s-\i:#2-#3 and #2*\alt-#3*\alt) -- cycle;
}
}
\foreach \r in {-45,-90}{%forced radial side shade
\foreach \i [evaluate={\s=30}] in {0,2,...,30}{
\fill [black, fill opacity=1/50]
(\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt)-- ++(0,-#4) arc (\r-\s+\i:\r+\s-\i:#2 and #2*\alt) -- cycle;
}
}
\end{pgfonlayer}
\end{scope}
}
\def\cilinder#1#2#3#4[#5]{%\cilinder{position}{Radious}{height}{color}[ID]
\begin{scope}[shift={(#1)}]
\coordinate (#5--east) at (0:#2);
\coordinate (#5--west) at (180:#2);
\shade[draw,left color=black!60!#4,middle color=#4,right color=#4!50!white] (0:#2) arc (0:180:#2 and #2*\alt) -- ++ (0,-#3) arc (180:360:#2 and #2*\alt) -- cycle;
\shade[draw,left color=#4](0:#2) arc (0:360:#2 and #2*\alt);
\foreach \r in {135,45,-45,-135}{%forced radial shade
\foreach \i [evaluate={\s=30}] in {0,2,...,30}{
\fill [black, fill opacity=1/50]
(0,0) -- (\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt)-- cycle;
}
}
\foreach \r in {-85,-135}{%forced radial side shade
\foreach \i [evaluate={\s=30}] in {0,2,...,30}{
\fill [black, fill opacity=1/50]
(\r+\s-\i:#2 and #2*\alt)
arc (\r+\s-\i:\r-\s+\i:#2 and #2*\alt)-- ++(0,-#3) arc (\r-\s+\i:\r+\s-\i:#2 and #2*\alt) -- cycle;
}
}
\end{scope}
}
%The metals
\cilinder{0,0}{1}{5}{iron}[FeCore-1]
\Ring{0,-1}{1.8}{0.5}{1}{aluminium}[AlRing-1]
\foreach \i in {1,...,18}{%Generate 18 named rings from CuRing-1 to CuRing-18
\Ring{0,-4.5+0.06*\i}{1.1}{0.1}{0mm}{cooper}[CuRing-\i]
}
%The circuit
\draw
(CuRing-14--east)%From te coordinate east of CuRing-14
-| ++(1,1)% Squared path first horizontal then vertical to x+1 and y+1 from previous coordinate (x,y)
to [nos] ++(2,0)%Normal Open Switch from previous coordinate (x',y') to (x'+2,y'+0)
to [battery] ++ (0,-1.4)
to [battery] ++ (0,-1.4)
-- ++ (-2,0)
|- (CuRing-2--east);
%labels
\scriptsize
\begin{pgfonlayer}{foreground layer}
\draw($(FeCore-1--west)+(0.5,0)$) -- ++(-1,0.5)node[left] {ferrous core};
\draw($(AlRing-1--west)+(0.25,0)$) -- ++(-1.2,0.5)node[left] {Aluminium ring};
\draw($(CuRing-18--west)+(0.07,0)$) -- ++(-1,0.5)node[left] {Coil of insulated wire};
\end{pgfonlayer}
\end{tikzpicture}
\end{document}