Delineando ríos en una imagen Tikz

Delineando ríos en una imagen Tikz

Quiero bordes negros en el exterior de los ríos azules que dibujé en mi imagen de Tikz, pero el problema es que debido a que dibujé esto como componentes rectangulares, los bordes cruzan el interior del río. ¿Cómo soluciono este problema?

\begin{minipage}{\textwidth}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\definecolor{customgreen}{HTML}{a1fb7f}  
\definecolor{customblue}{HTML}{7b87ea}

% Draw the green land with a sharp border
\draw[fill=customgreen, draw=black, line width=0.5pt] (-7, -6) rectangle (7, 3);

% Then draw the blue rivers with a sharp blue border
% Extend bottom stream to the left
\draw[fill=customblue, draw=black] (-3, -2+.125) -- (-7,-2+.125) -- (-7,-1.125) -- (-3,-1.125) -- cycle;
% Extend the top stream to the right
\draw[fill=customblue, draw=black] (-3, 2) -- (7, 2) --(7, 2-.75) --(-3, 2-.75) -- cycle;
% Other parts of the river
\draw[fill=customblue, draw=black] (-3, 2) -- (-3+.75, 2) -- (-3+.75,-2+.125) -- (-3,-2+.125) -- cycle;
\draw[fill=customblue, draw=black] (3, 2-.75) -- (3-.75, 2-.75) --(3-.75, -5) --(3, -5) -- cycle;
\draw[fill=customblue, draw=black] (-3+.75, -1.125) -- (3-.75, -1.125) --(3-.75, -1.125-.75) --(-3+.75, -1.125-.75) -- cycle;
\draw[fill=customblue, draw=black] (3-.75, -5) -- (7, -5) --(7, -5+.75) --(3-.75, -5+.75) -- cycle;

% Nodes at landmasses
\node at (0, 0) {A};
\node at (5, -1.5) {B};
\node at (2.62500, 2.5) {C};
\node at (2.62500, -5.5) {D};

% Bridges with black borders
\filldraw[fill=brown, draw=black, line width=0.5pt] (-1.65, -1.125+.6) rectangle (-1.15, -1.875-.6); % Bridge 1
\filldraw[fill=brown, draw=black, line width=0.5pt] (-.25, -1.125+.6) rectangle (0.25, -1.875-.6); % Bridge 2
\filldraw[fill=brown, draw=black, line width=0.5pt] (-1.65, 2+.6) rectangle (-1.15, 1.25-.6); % Bridge 3
\filldraw[fill=brown, draw=black, line width=0.5pt] (-.25, 2+.6) rectangle (0.25, 1.25-.6); % Bridge 4
\filldraw[fill=brown, draw=black, line width=0.5pt] (2.25-.6, .25) rectangle (3+.6, -.25); % Bridge 5
\filldraw[fill=brown, draw=black, line width=0.5pt] (5-.25, 2+.6) rectangle (5.25, 1.25-.6); % Bridge 7
\filldraw[fill=brown, draw=black, line width=0.5pt] (5-.25, -5+.75+.6) rectangle (5.25, -5-.6); % Bridge 8
\end{tikzpicture}
\caption{Map of Königsberg. The blue represents the Pregel River while 
the green represents land. There are seven brown rectangles 
representing bridges connecting land masses.} \label{fig:figure1}
\end{figure}
\end{minipage}

Producción:

ingrese la descripción de la imagen aquí

Respuesta1

Puedes hacer esto con la doubleopción. Simplemente use un solo \drawcomando. Puedes hacer lo mismo con los puentes. Usar line cap=buttdibujará el borde completo alrededor del color, mientras que line cap=rectno incluirá los extremos. Pero la tapa de la culata se extenderá más allá de las coordenadas.

ingrese la descripción de la imagen aquí

\documentclass{article}

\usepackage{tikz}
\definecolor{customgreen}{HTML}{a1fb7f}  
\definecolor{customblue}{HTML}{7b87ea}

\begin{document}

\begin{tikzpicture}
\draw[thick, fill=customgreen](0,-4)rectangle(11,4);
\draw[line cap=butt, thick, double=customblue, double distance=6mm]
    (0,0)--(7,0)
    (3,0)--(3,3)--(11,3)
    (7,3)--(7,-3)--(11,-3);
\draw[line cap=rect, thick, double=brown, double distance=4mm]
    (4,-.5)--(4,.5)
    (6,-.5)--(6,.5)
    (4,2.5)--(4,3.5)
    (6,2.5)--(6,3.5)
    (9,2.5)--(9,3.5)
    (9,-2.5)--(9,-3.5)
    (6.5,1.5)--(7.5,1.5);
\end{tikzpicture}

información relacionada