Tikz bzw. Circuitikz: Problem mit relativen Koordinaten

Tabellen und Grafiken erstellen und anordnen


Rolli
Forum-Guru
Forum-Guru
Beiträge: 382
Registriert: Mi 15. Feb 2017, 08:50
Wohnort: Mittelfranken

Tikz bzw. Circuitikz: Problem mit relativen Koordinaten

Beitrag von Rolli »

Hallo liebe Community,

was ist falsch an meinem Beispiel (die rot eingekreisten Artefakte)?

Gruß vom Rolli
\documentclass[parskip=half]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage[european]{circuitikz}
\usetikzlibrary{calc}

\begin{document}
   
   \begin{circuitikz} 
   	\draw (0,0) node [op amp,yscale=-1] (OP1) {};
        \draw (0,5) node [op amp,yscale=-1] (OP2) {};
 
	\path (OP1.out) ++ (0.5,0) node (P1) {};
	\path (OP2.out) ++ (0.5,0) node (P2) {};

	\draw (OP1.-) -- ++(-0.5,0)
        	 -- ++(0,-1.5) to [R,l=$R_3$]
	         ++(3.25,0) |- (P1) node [circ]{} -- (OP1.out);

	\draw (P1) to [R,l=$R_4$] ++ (3,0);
	
	\draw (OP2.-) -- ++(-0.5,0)
        	 -- ++(0,-1.5) to [R,l=$R_1$]
	         ++(3.25,0) -| (P2) node [circ]{} -- (OP2.out);

	\draw (P2) to [R,l=$R_2$] ++ (3,0);			

        \draw [red] (P1) circle (4mm);
	\draw [red] (P2) circle (4mm);

   \end{circuitikz}
   
\end{document}


Bartman
Forum-Meister
Forum-Meister
Beiträge: 2456
Registriert: Do 16. Jul 2009, 21:41
Wohnort: Hessische Provinz

Beitrag von Bartman »

Space between equal points circuitikz

Eine mögliche Variante:
\documentclass[border=5pt]{standalone}
\usepackage[european]{circuitikz}

\begin{document}
\begin{circuitikz} 
\draw (0,0) node [op amp, yscale=-1] (OP1) {}
      (0,5) node [op amp, yscale=-1] (OP2) {};
 
\path [draw, red] 
	(OP1.out) ++ (0.5,0) coordinate (P1) circle (4mm)
	(OP2.out) ++ (0.5,0) coordinate (P2) circle (4mm);

\draw (OP1.-) -- ++(-0.5,0)
	-- ++(0,-1.5) to [R, l=$R_3$]
	++(3.25,0) -| (P1.center) node [circ]{} -- (OP1.out);% |- durch -| ersetzt und .center ergänzt

\draw (P1) to [R,l=$R_4$] ++ (3,0);
   
\draw (OP2.-) -- ++(-0.5,0)
	-- ++(0,-1.5) to [R, l=$R_1$]
	++(3.25,0) -| (P2.center) node [circ]{} -- (OP2.out);% .center hinzugefügt

\draw (P2) to [R, l=$R_2$] ++ (3,0);         
\end{circuitikz}
\end{document}

Rolli
Forum-Guru
Forum-Guru
Beiträge: 382
Registriert: Mi 15. Feb 2017, 08:50
Wohnort: Mittelfranken

Beitrag von Rolli »

Danke Dir für den Link - ja, das löst das Problem. Ich verstehe es aber nicht. Mein MB war Teil einer größeren Schaltung; manchmal geht es wie erwartet, wenn man an den Knoten noch einen weiteren path anhängt. Merkwürdig ... vermutlich ein Bug?
Gruß vom Rolli

Antworten