Solvent-accessible and -excluded surface











up vote
3
down vote

favorite












I would like to reproduce this graph in TikZ:



enter image description here



I'm not new to TikZ and I can imagine how to draw the lines in green and black, but I cannot imagine how to draw the line in red (which is draw by th borders of the probe sphere rolling on the green atoms).










share|improve this question






















  • Perhaps you could then add a sample of the black and green lines, then people will have time to focus on getting you the red lines.
    – Phelype Oleinik
    4 hours ago












  • @PhelypeOleinik: I wanted to get the whole concept before starting to draw (and start over). I would draw the green and black line with superpostion of filled circles of different radii.
    – Kyle_the_hacker
    4 hours ago












  • I guess that the red line requires sort of a "theory" that determines the point at which the red line departs from the circle. It might be related to the position where certain tangents hit the circle. Do you have such a "theory" or prescription? Looking at the pic again, what determines the radius of the probe sphere?
    – marmot
    4 hours ago








  • 1




    @marmot: the radius of the probe sphere is fixed, the sphere rolls on the green atoms; the sphere moves in such a way that its center stays on the black line.
    – Kyle_the_hacker
    4 hours ago

















up vote
3
down vote

favorite












I would like to reproduce this graph in TikZ:



enter image description here



I'm not new to TikZ and I can imagine how to draw the lines in green and black, but I cannot imagine how to draw the line in red (which is draw by th borders of the probe sphere rolling on the green atoms).










share|improve this question






















  • Perhaps you could then add a sample of the black and green lines, then people will have time to focus on getting you the red lines.
    – Phelype Oleinik
    4 hours ago












  • @PhelypeOleinik: I wanted to get the whole concept before starting to draw (and start over). I would draw the green and black line with superpostion of filled circles of different radii.
    – Kyle_the_hacker
    4 hours ago












  • I guess that the red line requires sort of a "theory" that determines the point at which the red line departs from the circle. It might be related to the position where certain tangents hit the circle. Do you have such a "theory" or prescription? Looking at the pic again, what determines the radius of the probe sphere?
    – marmot
    4 hours ago








  • 1




    @marmot: the radius of the probe sphere is fixed, the sphere rolls on the green atoms; the sphere moves in such a way that its center stays on the black line.
    – Kyle_the_hacker
    4 hours ago















up vote
3
down vote

favorite









up vote
3
down vote

favorite











I would like to reproduce this graph in TikZ:



enter image description here



I'm not new to TikZ and I can imagine how to draw the lines in green and black, but I cannot imagine how to draw the line in red (which is draw by th borders of the probe sphere rolling on the green atoms).










share|improve this question













I would like to reproduce this graph in TikZ:



enter image description here



I'm not new to TikZ and I can imagine how to draw the lines in green and black, but I cannot imagine how to draw the line in red (which is draw by th borders of the probe sphere rolling on the green atoms).







tikz-pgf pgfplots draw






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 4 hours ago









Kyle_the_hacker

597317




597317












  • Perhaps you could then add a sample of the black and green lines, then people will have time to focus on getting you the red lines.
    – Phelype Oleinik
    4 hours ago












  • @PhelypeOleinik: I wanted to get the whole concept before starting to draw (and start over). I would draw the green and black line with superpostion of filled circles of different radii.
    – Kyle_the_hacker
    4 hours ago












  • I guess that the red line requires sort of a "theory" that determines the point at which the red line departs from the circle. It might be related to the position where certain tangents hit the circle. Do you have such a "theory" or prescription? Looking at the pic again, what determines the radius of the probe sphere?
    – marmot
    4 hours ago








  • 1




    @marmot: the radius of the probe sphere is fixed, the sphere rolls on the green atoms; the sphere moves in such a way that its center stays on the black line.
    – Kyle_the_hacker
    4 hours ago




















  • Perhaps you could then add a sample of the black and green lines, then people will have time to focus on getting you the red lines.
    – Phelype Oleinik
    4 hours ago












  • @PhelypeOleinik: I wanted to get the whole concept before starting to draw (and start over). I would draw the green and black line with superpostion of filled circles of different radii.
    – Kyle_the_hacker
    4 hours ago












  • I guess that the red line requires sort of a "theory" that determines the point at which the red line departs from the circle. It might be related to the position where certain tangents hit the circle. Do you have such a "theory" or prescription? Looking at the pic again, what determines the radius of the probe sphere?
    – marmot
    4 hours ago








  • 1




    @marmot: the radius of the probe sphere is fixed, the sphere rolls on the green atoms; the sphere moves in such a way that its center stays on the black line.
    – Kyle_the_hacker
    4 hours ago


















Perhaps you could then add a sample of the black and green lines, then people will have time to focus on getting you the red lines.
– Phelype Oleinik
4 hours ago






Perhaps you could then add a sample of the black and green lines, then people will have time to focus on getting you the red lines.
– Phelype Oleinik
4 hours ago














@PhelypeOleinik: I wanted to get the whole concept before starting to draw (and start over). I would draw the green and black line with superpostion of filled circles of different radii.
– Kyle_the_hacker
4 hours ago






@PhelypeOleinik: I wanted to get the whole concept before starting to draw (and start over). I would draw the green and black line with superpostion of filled circles of different radii.
– Kyle_the_hacker
4 hours ago














I guess that the red line requires sort of a "theory" that determines the point at which the red line departs from the circle. It might be related to the position where certain tangents hit the circle. Do you have such a "theory" or prescription? Looking at the pic again, what determines the radius of the probe sphere?
– marmot
4 hours ago






I guess that the red line requires sort of a "theory" that determines the point at which the red line departs from the circle. It might be related to the position where certain tangents hit the circle. Do you have such a "theory" or prescription? Looking at the pic again, what determines the radius of the probe sphere?
– marmot
4 hours ago






1




1




@marmot: the radius of the probe sphere is fixed, the sphere rolls on the green atoms; the sphere moves in such a way that its center stays on the black line.
– Kyle_the_hacker
4 hours ago






@marmot: the radius of the probe sphere is fixed, the sphere rolls on the green atoms; the sphere moves in such a way that its center stays on the black line.
– Kyle_the_hacker
4 hours ago












1 Answer
1






active

oldest

votes

















up vote
2
down vote













Here is a proposal (essentially repeating the tricks from here). Each of the arcs is computed from the probe sphere touching two neighboring atoms. The corresponding path is computed with merge circles. The paths along the boundaries of the atoms are done with path along circle. And this answer comes also with the styles get circle intersections and midcircle that allows one to conveniently wipe out the overlaps.



documentclass[tikz,border=3.14mm]{standalone}
usetikzlibrary{calc}
tikzset{merge circles/.style n args={4}{insert path={
let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
n2={atan2(y2-y1,x2-x1)},
n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
in %pgfextra{typeout{n1,n2,n3,n4}}
($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
}},
path along circle/.style args={with center #1 from #2 to #3}{insert path={
let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
n5={ifthenelse(n2<n1,n2,n2-360)}
in %pgfextra{typeout{n1,n2,n5}}
(#2) arc(n1:n5:n3)}},
get circle intersections/.style n args={6}{insert path={
let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
n2={atan2(y2-y1,x2-x1)},
n3={mangle(#4,n1,#3)},
n4={mangle(n1,#4,#3)}
in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
midcircle/.style args={of #1 and #2}{insert path={
let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
}
begin{document}

begin{tikzpicture}[font=sffamily,declare function={%
mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
probe sphere radius=1}
% define radii and center coordinates of the atoms
edeflstR{{0,1.7,1,1.8,1.8,1,1.7,1}}
edeflstCoords{(-4,1.5),(-1.2,2),(1.3,0.4),(4.5,0.1),(2.4,-2.3),(-2.3,-0.9),(-5.1,-1.4)}
% draw halo
foreach Coord [count=Z] in lstCoords
{pgfmathsetmacro{myR}{lstR[Z]+0.8}
draw[dashed,thick] Coord coordinate (cZ) circle (myR);}
foreach X/Y in {1/2,1/6,1/7,2/6,2/3,3/4,3/5,3/6,4/5,6/7}
{pgfmathsetmacro{myRone}{lstR[X]+0.8}
pgfmathsetmacro{myRtwo}{lstR[Y]+0.8}
fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
[midcircle=of aux1 and aux2];}
% draw atoms
foreach Coord [count=Z] in lstCoords
{pgfmathsetmacro{myR}{lstR[Z]}
draw[green!40!black,thick] Coord coordinate (cZ)
node{atom Z} circle (myR);}
% merge atoms
foreach X/Y in {1/6,3/4}
{pgfmathsetmacro{myRone}{lstR[X]}
pgfmathsetmacro{myRtwo}{lstR[Y]}
fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
[midcircle=of aux1 and aux2];}
draw[red,thick]
[merge circles={c1}{c2}{lstR[1]}{lstR[2]}] coordinate[pos=0](p0) coordinate[pos=1](p1)
[merge circles={c2}{c3}{lstR[2]}{lstR[3]}] coordinate[pos=0](p2) coordinate[pos=1](p3)
[merge circles={c3}{c4}{lstR[3]}{lstR[4]}] coordinate[pos=0](p4) coordinate[pos=1](p5)
[merge circles={c4}{c5}{lstR[4]}{lstR[5]}] coordinate[pos=0](p6) coordinate[pos=1](p7)
[merge circles={c5}{c3}{lstR[5]}{lstR[3]}] coordinate[pos=0](p8) coordinate[pos=1](p9)
[merge circles={c3}{c6}{lstR[3]}{lstR[6]}] coordinate[pos=0](p10) coordinate[pos=1](p11)
[merge circles={c6}{c7}{lstR[6]}{lstR[7]}] coordinate[pos=0](p12) coordinate[pos=1](p13)
[merge circles={c7}{c1}{lstR[7]}{lstR[1]}] coordinate[pos=0](p14) coordinate[pos=1](p15)
;
draw[red,thick]
[path along circle=with center c2 from p1 to p2,
path along circle=with center c3 from p3 to p4,
path along circle=with center c4 from p5 to p6,
path along circle=with center c5 from p7 to p8,
path along circle=with center c3 from p9 to p10,
path along circle=with center c6 from p11 to p12,
path along circle=with center c7 from p13 to p14,
path along circle=with center c1 from p15 to p0];
end{tikzpicture}
end{document}


enter image description here



The following animation explains how that works.



documentclass{beamer}
beamertemplatenavigationsymbolsempty
usepackage{tikz}
usetikzlibrary{calc}
tikzset{merge circles/.style n args={4}{insert path={
let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
n2={atan2(y2-y1,x2-x1)},
n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
in %pgfextra{typeout{n1,n2,n3,n4}}
($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
}},
path along circle/.style args={with center #1 from #2 to #3}{insert path={
let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
n5={ifthenelse(n2<n1,n2,n2-360)}
in %pgfextra{typeout{n1,n2,n5}}
(#2) arc(n1:n5:n3)}},
get circle intersections/.style n args={6}{insert path={
let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
n2={atan2(y2-y1,x2-x1)},
n3={mangle(#4,n1,#3)},
n4={mangle(n1,#4,#3)}
in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
midcircle/.style args={of #1 and #2}{insert path={
let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
}
begin{document}
begin{frame}[t]
frametitle{}
centerline{begin{tikzpicture}[scale=0.9,declare function={%
mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
probe sphere radius=1}
draw (0,0) coordinate (c1) circle (3);
draw (4,1) coordinate (c2) circle (2);
draw (3,-2) coordinate (c3) circle (2);
only<2->{fill[white,get circle intersections={c1}{c2}{3}{2}{x1}{x2}]
[midcircle=of x1 and x2];
fill[white,get circle intersections={c2}{c3}{2}{2}{x3}{x4}]
[midcircle=of x3 and x4];
fill[white,get circle intersections={c3}{c1}{2}{3}{x5}{x6}]
[midcircle=of x5 and x6];
}
only<3->{
draw[red]
[merge circles={c1}{c2}{3}{2}] coordinate[pos=0](p0) coordinate[pos=1](p1)
[merge circles={c2}{c3}{2}{2}] coordinate[pos=0](p2) coordinate[pos=1](p3)
[merge circles={c3}{c1}{2}{3}] coordinate[pos=0](p4) coordinate[pos=1](p5)
[path along circle=with center c2 from p1 to p2,
path along circle=with center c3 from p3 to p4,
path along circle=with center c1 from p5 to p0];}
end{tikzpicture}}
begin{enumerate}
item Draw the circles.
item<2-> Wipe out the overlaps. only<2>{First determine the coordinates at
which the circles intersect with texttt{get circle intersections}
and then fill the midcircles with texttt{midcircle}.}
item<3-> Draw the arcs between the circles with texttt{merge circles}
as well as the arcs along the circles with texttt{path along circle}.
end{enumerate}
end{frame}
end{document}


enter image description here






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463219%2fsolvent-accessible-and-excluded-surface%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    Here is a proposal (essentially repeating the tricks from here). Each of the arcs is computed from the probe sphere touching two neighboring atoms. The corresponding path is computed with merge circles. The paths along the boundaries of the atoms are done with path along circle. And this answer comes also with the styles get circle intersections and midcircle that allows one to conveniently wipe out the overlaps.



    documentclass[tikz,border=3.14mm]{standalone}
    usetikzlibrary{calc}
    tikzset{merge circles/.style n args={4}{insert path={
    let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
    n2={atan2(y2-y1,x2-x1)},
    n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
    n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
    in %pgfextra{typeout{n1,n2,n3,n4}}
    ($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
    }},
    path along circle/.style args={with center #1 from #2 to #3}{insert path={
    let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
    n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
    n5={ifthenelse(n2<n1,n2,n2-360)}
    in %pgfextra{typeout{n1,n2,n5}}
    (#2) arc(n1:n5:n3)}},
    get circle intersections/.style n args={6}{insert path={
    let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
    n2={atan2(y2-y1,x2-x1)},
    n3={mangle(#4,n1,#3)},
    n4={mangle(n1,#4,#3)}
    in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
    ($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
    midcircle/.style args={of #1 and #2}{insert path={
    let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
    }
    begin{document}

    begin{tikzpicture}[font=sffamily,declare function={%
    mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
    pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
    probe sphere radius=1}
    % define radii and center coordinates of the atoms
    edeflstR{{0,1.7,1,1.8,1.8,1,1.7,1}}
    edeflstCoords{(-4,1.5),(-1.2,2),(1.3,0.4),(4.5,0.1),(2.4,-2.3),(-2.3,-0.9),(-5.1,-1.4)}
    % draw halo
    foreach Coord [count=Z] in lstCoords
    {pgfmathsetmacro{myR}{lstR[Z]+0.8}
    draw[dashed,thick] Coord coordinate (cZ) circle (myR);}
    foreach X/Y in {1/2,1/6,1/7,2/6,2/3,3/4,3/5,3/6,4/5,6/7}
    {pgfmathsetmacro{myRone}{lstR[X]+0.8}
    pgfmathsetmacro{myRtwo}{lstR[Y]+0.8}
    fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
    [midcircle=of aux1 and aux2];}
    % draw atoms
    foreach Coord [count=Z] in lstCoords
    {pgfmathsetmacro{myR}{lstR[Z]}
    draw[green!40!black,thick] Coord coordinate (cZ)
    node{atom Z} circle (myR);}
    % merge atoms
    foreach X/Y in {1/6,3/4}
    {pgfmathsetmacro{myRone}{lstR[X]}
    pgfmathsetmacro{myRtwo}{lstR[Y]}
    fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
    [midcircle=of aux1 and aux2];}
    draw[red,thick]
    [merge circles={c1}{c2}{lstR[1]}{lstR[2]}] coordinate[pos=0](p0) coordinate[pos=1](p1)
    [merge circles={c2}{c3}{lstR[2]}{lstR[3]}] coordinate[pos=0](p2) coordinate[pos=1](p3)
    [merge circles={c3}{c4}{lstR[3]}{lstR[4]}] coordinate[pos=0](p4) coordinate[pos=1](p5)
    [merge circles={c4}{c5}{lstR[4]}{lstR[5]}] coordinate[pos=0](p6) coordinate[pos=1](p7)
    [merge circles={c5}{c3}{lstR[5]}{lstR[3]}] coordinate[pos=0](p8) coordinate[pos=1](p9)
    [merge circles={c3}{c6}{lstR[3]}{lstR[6]}] coordinate[pos=0](p10) coordinate[pos=1](p11)
    [merge circles={c6}{c7}{lstR[6]}{lstR[7]}] coordinate[pos=0](p12) coordinate[pos=1](p13)
    [merge circles={c7}{c1}{lstR[7]}{lstR[1]}] coordinate[pos=0](p14) coordinate[pos=1](p15)
    ;
    draw[red,thick]
    [path along circle=with center c2 from p1 to p2,
    path along circle=with center c3 from p3 to p4,
    path along circle=with center c4 from p5 to p6,
    path along circle=with center c5 from p7 to p8,
    path along circle=with center c3 from p9 to p10,
    path along circle=with center c6 from p11 to p12,
    path along circle=with center c7 from p13 to p14,
    path along circle=with center c1 from p15 to p0];
    end{tikzpicture}
    end{document}


    enter image description here



    The following animation explains how that works.



    documentclass{beamer}
    beamertemplatenavigationsymbolsempty
    usepackage{tikz}
    usetikzlibrary{calc}
    tikzset{merge circles/.style n args={4}{insert path={
    let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
    n2={atan2(y2-y1,x2-x1)},
    n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
    n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
    in %pgfextra{typeout{n1,n2,n3,n4}}
    ($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
    }},
    path along circle/.style args={with center #1 from #2 to #3}{insert path={
    let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
    n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
    n5={ifthenelse(n2<n1,n2,n2-360)}
    in %pgfextra{typeout{n1,n2,n5}}
    (#2) arc(n1:n5:n3)}},
    get circle intersections/.style n args={6}{insert path={
    let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
    n2={atan2(y2-y1,x2-x1)},
    n3={mangle(#4,n1,#3)},
    n4={mangle(n1,#4,#3)}
    in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
    ($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
    midcircle/.style args={of #1 and #2}{insert path={
    let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
    }
    begin{document}
    begin{frame}[t]
    frametitle{}
    centerline{begin{tikzpicture}[scale=0.9,declare function={%
    mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
    pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
    probe sphere radius=1}
    draw (0,0) coordinate (c1) circle (3);
    draw (4,1) coordinate (c2) circle (2);
    draw (3,-2) coordinate (c3) circle (2);
    only<2->{fill[white,get circle intersections={c1}{c2}{3}{2}{x1}{x2}]
    [midcircle=of x1 and x2];
    fill[white,get circle intersections={c2}{c3}{2}{2}{x3}{x4}]
    [midcircle=of x3 and x4];
    fill[white,get circle intersections={c3}{c1}{2}{3}{x5}{x6}]
    [midcircle=of x5 and x6];
    }
    only<3->{
    draw[red]
    [merge circles={c1}{c2}{3}{2}] coordinate[pos=0](p0) coordinate[pos=1](p1)
    [merge circles={c2}{c3}{2}{2}] coordinate[pos=0](p2) coordinate[pos=1](p3)
    [merge circles={c3}{c1}{2}{3}] coordinate[pos=0](p4) coordinate[pos=1](p5)
    [path along circle=with center c2 from p1 to p2,
    path along circle=with center c3 from p3 to p4,
    path along circle=with center c1 from p5 to p0];}
    end{tikzpicture}}
    begin{enumerate}
    item Draw the circles.
    item<2-> Wipe out the overlaps. only<2>{First determine the coordinates at
    which the circles intersect with texttt{get circle intersections}
    and then fill the midcircles with texttt{midcircle}.}
    item<3-> Draw the arcs between the circles with texttt{merge circles}
    as well as the arcs along the circles with texttt{path along circle}.
    end{enumerate}
    end{frame}
    end{document}


    enter image description here






    share|improve this answer



























      up vote
      2
      down vote













      Here is a proposal (essentially repeating the tricks from here). Each of the arcs is computed from the probe sphere touching two neighboring atoms. The corresponding path is computed with merge circles. The paths along the boundaries of the atoms are done with path along circle. And this answer comes also with the styles get circle intersections and midcircle that allows one to conveniently wipe out the overlaps.



      documentclass[tikz,border=3.14mm]{standalone}
      usetikzlibrary{calc}
      tikzset{merge circles/.style n args={4}{insert path={
      let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
      n2={atan2(y2-y1,x2-x1)},
      n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
      n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
      in %pgfextra{typeout{n1,n2,n3,n4}}
      ($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
      }},
      path along circle/.style args={with center #1 from #2 to #3}{insert path={
      let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
      n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
      n5={ifthenelse(n2<n1,n2,n2-360)}
      in %pgfextra{typeout{n1,n2,n5}}
      (#2) arc(n1:n5:n3)}},
      get circle intersections/.style n args={6}{insert path={
      let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
      n2={atan2(y2-y1,x2-x1)},
      n3={mangle(#4,n1,#3)},
      n4={mangle(n1,#4,#3)}
      in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
      ($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
      midcircle/.style args={of #1 and #2}{insert path={
      let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
      }
      begin{document}

      begin{tikzpicture}[font=sffamily,declare function={%
      mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
      pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
      probe sphere radius=1}
      % define radii and center coordinates of the atoms
      edeflstR{{0,1.7,1,1.8,1.8,1,1.7,1}}
      edeflstCoords{(-4,1.5),(-1.2,2),(1.3,0.4),(4.5,0.1),(2.4,-2.3),(-2.3,-0.9),(-5.1,-1.4)}
      % draw halo
      foreach Coord [count=Z] in lstCoords
      {pgfmathsetmacro{myR}{lstR[Z]+0.8}
      draw[dashed,thick] Coord coordinate (cZ) circle (myR);}
      foreach X/Y in {1/2,1/6,1/7,2/6,2/3,3/4,3/5,3/6,4/5,6/7}
      {pgfmathsetmacro{myRone}{lstR[X]+0.8}
      pgfmathsetmacro{myRtwo}{lstR[Y]+0.8}
      fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
      [midcircle=of aux1 and aux2];}
      % draw atoms
      foreach Coord [count=Z] in lstCoords
      {pgfmathsetmacro{myR}{lstR[Z]}
      draw[green!40!black,thick] Coord coordinate (cZ)
      node{atom Z} circle (myR);}
      % merge atoms
      foreach X/Y in {1/6,3/4}
      {pgfmathsetmacro{myRone}{lstR[X]}
      pgfmathsetmacro{myRtwo}{lstR[Y]}
      fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
      [midcircle=of aux1 and aux2];}
      draw[red,thick]
      [merge circles={c1}{c2}{lstR[1]}{lstR[2]}] coordinate[pos=0](p0) coordinate[pos=1](p1)
      [merge circles={c2}{c3}{lstR[2]}{lstR[3]}] coordinate[pos=0](p2) coordinate[pos=1](p3)
      [merge circles={c3}{c4}{lstR[3]}{lstR[4]}] coordinate[pos=0](p4) coordinate[pos=1](p5)
      [merge circles={c4}{c5}{lstR[4]}{lstR[5]}] coordinate[pos=0](p6) coordinate[pos=1](p7)
      [merge circles={c5}{c3}{lstR[5]}{lstR[3]}] coordinate[pos=0](p8) coordinate[pos=1](p9)
      [merge circles={c3}{c6}{lstR[3]}{lstR[6]}] coordinate[pos=0](p10) coordinate[pos=1](p11)
      [merge circles={c6}{c7}{lstR[6]}{lstR[7]}] coordinate[pos=0](p12) coordinate[pos=1](p13)
      [merge circles={c7}{c1}{lstR[7]}{lstR[1]}] coordinate[pos=0](p14) coordinate[pos=1](p15)
      ;
      draw[red,thick]
      [path along circle=with center c2 from p1 to p2,
      path along circle=with center c3 from p3 to p4,
      path along circle=with center c4 from p5 to p6,
      path along circle=with center c5 from p7 to p8,
      path along circle=with center c3 from p9 to p10,
      path along circle=with center c6 from p11 to p12,
      path along circle=with center c7 from p13 to p14,
      path along circle=with center c1 from p15 to p0];
      end{tikzpicture}
      end{document}


      enter image description here



      The following animation explains how that works.



      documentclass{beamer}
      beamertemplatenavigationsymbolsempty
      usepackage{tikz}
      usetikzlibrary{calc}
      tikzset{merge circles/.style n args={4}{insert path={
      let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
      n2={atan2(y2-y1,x2-x1)},
      n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
      n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
      in %pgfextra{typeout{n1,n2,n3,n4}}
      ($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
      }},
      path along circle/.style args={with center #1 from #2 to #3}{insert path={
      let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
      n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
      n5={ifthenelse(n2<n1,n2,n2-360)}
      in %pgfextra{typeout{n1,n2,n5}}
      (#2) arc(n1:n5:n3)}},
      get circle intersections/.style n args={6}{insert path={
      let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
      n2={atan2(y2-y1,x2-x1)},
      n3={mangle(#4,n1,#3)},
      n4={mangle(n1,#4,#3)}
      in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
      ($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
      midcircle/.style args={of #1 and #2}{insert path={
      let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
      }
      begin{document}
      begin{frame}[t]
      frametitle{}
      centerline{begin{tikzpicture}[scale=0.9,declare function={%
      mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
      pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
      probe sphere radius=1}
      draw (0,0) coordinate (c1) circle (3);
      draw (4,1) coordinate (c2) circle (2);
      draw (3,-2) coordinate (c3) circle (2);
      only<2->{fill[white,get circle intersections={c1}{c2}{3}{2}{x1}{x2}]
      [midcircle=of x1 and x2];
      fill[white,get circle intersections={c2}{c3}{2}{2}{x3}{x4}]
      [midcircle=of x3 and x4];
      fill[white,get circle intersections={c3}{c1}{2}{3}{x5}{x6}]
      [midcircle=of x5 and x6];
      }
      only<3->{
      draw[red]
      [merge circles={c1}{c2}{3}{2}] coordinate[pos=0](p0) coordinate[pos=1](p1)
      [merge circles={c2}{c3}{2}{2}] coordinate[pos=0](p2) coordinate[pos=1](p3)
      [merge circles={c3}{c1}{2}{3}] coordinate[pos=0](p4) coordinate[pos=1](p5)
      [path along circle=with center c2 from p1 to p2,
      path along circle=with center c3 from p3 to p4,
      path along circle=with center c1 from p5 to p0];}
      end{tikzpicture}}
      begin{enumerate}
      item Draw the circles.
      item<2-> Wipe out the overlaps. only<2>{First determine the coordinates at
      which the circles intersect with texttt{get circle intersections}
      and then fill the midcircles with texttt{midcircle}.}
      item<3-> Draw the arcs between the circles with texttt{merge circles}
      as well as the arcs along the circles with texttt{path along circle}.
      end{enumerate}
      end{frame}
      end{document}


      enter image description here






      share|improve this answer

























        up vote
        2
        down vote










        up vote
        2
        down vote









        Here is a proposal (essentially repeating the tricks from here). Each of the arcs is computed from the probe sphere touching two neighboring atoms. The corresponding path is computed with merge circles. The paths along the boundaries of the atoms are done with path along circle. And this answer comes also with the styles get circle intersections and midcircle that allows one to conveniently wipe out the overlaps.



        documentclass[tikz,border=3.14mm]{standalone}
        usetikzlibrary{calc}
        tikzset{merge circles/.style n args={4}{insert path={
        let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
        n2={atan2(y2-y1,x2-x1)},
        n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
        n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
        in %pgfextra{typeout{n1,n2,n3,n4}}
        ($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
        }},
        path along circle/.style args={with center #1 from #2 to #3}{insert path={
        let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
        n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
        n5={ifthenelse(n2<n1,n2,n2-360)}
        in %pgfextra{typeout{n1,n2,n5}}
        (#2) arc(n1:n5:n3)}},
        get circle intersections/.style n args={6}{insert path={
        let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
        n2={atan2(y2-y1,x2-x1)},
        n3={mangle(#4,n1,#3)},
        n4={mangle(n1,#4,#3)}
        in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
        ($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
        midcircle/.style args={of #1 and #2}{insert path={
        let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
        }
        begin{document}

        begin{tikzpicture}[font=sffamily,declare function={%
        mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
        pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
        probe sphere radius=1}
        % define radii and center coordinates of the atoms
        edeflstR{{0,1.7,1,1.8,1.8,1,1.7,1}}
        edeflstCoords{(-4,1.5),(-1.2,2),(1.3,0.4),(4.5,0.1),(2.4,-2.3),(-2.3,-0.9),(-5.1,-1.4)}
        % draw halo
        foreach Coord [count=Z] in lstCoords
        {pgfmathsetmacro{myR}{lstR[Z]+0.8}
        draw[dashed,thick] Coord coordinate (cZ) circle (myR);}
        foreach X/Y in {1/2,1/6,1/7,2/6,2/3,3/4,3/5,3/6,4/5,6/7}
        {pgfmathsetmacro{myRone}{lstR[X]+0.8}
        pgfmathsetmacro{myRtwo}{lstR[Y]+0.8}
        fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
        [midcircle=of aux1 and aux2];}
        % draw atoms
        foreach Coord [count=Z] in lstCoords
        {pgfmathsetmacro{myR}{lstR[Z]}
        draw[green!40!black,thick] Coord coordinate (cZ)
        node{atom Z} circle (myR);}
        % merge atoms
        foreach X/Y in {1/6,3/4}
        {pgfmathsetmacro{myRone}{lstR[X]}
        pgfmathsetmacro{myRtwo}{lstR[Y]}
        fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
        [midcircle=of aux1 and aux2];}
        draw[red,thick]
        [merge circles={c1}{c2}{lstR[1]}{lstR[2]}] coordinate[pos=0](p0) coordinate[pos=1](p1)
        [merge circles={c2}{c3}{lstR[2]}{lstR[3]}] coordinate[pos=0](p2) coordinate[pos=1](p3)
        [merge circles={c3}{c4}{lstR[3]}{lstR[4]}] coordinate[pos=0](p4) coordinate[pos=1](p5)
        [merge circles={c4}{c5}{lstR[4]}{lstR[5]}] coordinate[pos=0](p6) coordinate[pos=1](p7)
        [merge circles={c5}{c3}{lstR[5]}{lstR[3]}] coordinate[pos=0](p8) coordinate[pos=1](p9)
        [merge circles={c3}{c6}{lstR[3]}{lstR[6]}] coordinate[pos=0](p10) coordinate[pos=1](p11)
        [merge circles={c6}{c7}{lstR[6]}{lstR[7]}] coordinate[pos=0](p12) coordinate[pos=1](p13)
        [merge circles={c7}{c1}{lstR[7]}{lstR[1]}] coordinate[pos=0](p14) coordinate[pos=1](p15)
        ;
        draw[red,thick]
        [path along circle=with center c2 from p1 to p2,
        path along circle=with center c3 from p3 to p4,
        path along circle=with center c4 from p5 to p6,
        path along circle=with center c5 from p7 to p8,
        path along circle=with center c3 from p9 to p10,
        path along circle=with center c6 from p11 to p12,
        path along circle=with center c7 from p13 to p14,
        path along circle=with center c1 from p15 to p0];
        end{tikzpicture}
        end{document}


        enter image description here



        The following animation explains how that works.



        documentclass{beamer}
        beamertemplatenavigationsymbolsempty
        usepackage{tikz}
        usetikzlibrary{calc}
        tikzset{merge circles/.style n args={4}{insert path={
        let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
        n2={atan2(y2-y1,x2-x1)},
        n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
        n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
        in %pgfextra{typeout{n1,n2,n3,n4}}
        ($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
        }},
        path along circle/.style args={with center #1 from #2 to #3}{insert path={
        let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
        n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
        n5={ifthenelse(n2<n1,n2,n2-360)}
        in %pgfextra{typeout{n1,n2,n5}}
        (#2) arc(n1:n5:n3)}},
        get circle intersections/.style n args={6}{insert path={
        let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
        n2={atan2(y2-y1,x2-x1)},
        n3={mangle(#4,n1,#3)},
        n4={mangle(n1,#4,#3)}
        in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
        ($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
        midcircle/.style args={of #1 and #2}{insert path={
        let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
        }
        begin{document}
        begin{frame}[t]
        frametitle{}
        centerline{begin{tikzpicture}[scale=0.9,declare function={%
        mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
        pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
        probe sphere radius=1}
        draw (0,0) coordinate (c1) circle (3);
        draw (4,1) coordinate (c2) circle (2);
        draw (3,-2) coordinate (c3) circle (2);
        only<2->{fill[white,get circle intersections={c1}{c2}{3}{2}{x1}{x2}]
        [midcircle=of x1 and x2];
        fill[white,get circle intersections={c2}{c3}{2}{2}{x3}{x4}]
        [midcircle=of x3 and x4];
        fill[white,get circle intersections={c3}{c1}{2}{3}{x5}{x6}]
        [midcircle=of x5 and x6];
        }
        only<3->{
        draw[red]
        [merge circles={c1}{c2}{3}{2}] coordinate[pos=0](p0) coordinate[pos=1](p1)
        [merge circles={c2}{c3}{2}{2}] coordinate[pos=0](p2) coordinate[pos=1](p3)
        [merge circles={c3}{c1}{2}{3}] coordinate[pos=0](p4) coordinate[pos=1](p5)
        [path along circle=with center c2 from p1 to p2,
        path along circle=with center c3 from p3 to p4,
        path along circle=with center c1 from p5 to p0];}
        end{tikzpicture}}
        begin{enumerate}
        item Draw the circles.
        item<2-> Wipe out the overlaps. only<2>{First determine the coordinates at
        which the circles intersect with texttt{get circle intersections}
        and then fill the midcircles with texttt{midcircle}.}
        item<3-> Draw the arcs between the circles with texttt{merge circles}
        as well as the arcs along the circles with texttt{path along circle}.
        end{enumerate}
        end{frame}
        end{document}


        enter image description here






        share|improve this answer














        Here is a proposal (essentially repeating the tricks from here). Each of the arcs is computed from the probe sphere touching two neighboring atoms. The corresponding path is computed with merge circles. The paths along the boundaries of the atoms are done with path along circle. And this answer comes also with the styles get circle intersections and midcircle that allows one to conveniently wipe out the overlaps.



        documentclass[tikz,border=3.14mm]{standalone}
        usetikzlibrary{calc}
        tikzset{merge circles/.style n args={4}{insert path={
        let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
        n2={atan2(y2-y1,x2-x1)},
        n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
        n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
        in %pgfextra{typeout{n1,n2,n3,n4}}
        ($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
        }},
        path along circle/.style args={with center #1 from #2 to #3}{insert path={
        let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
        n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
        n5={ifthenelse(n2<n1,n2,n2-360)}
        in %pgfextra{typeout{n1,n2,n5}}
        (#2) arc(n1:n5:n3)}},
        get circle intersections/.style n args={6}{insert path={
        let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
        n2={atan2(y2-y1,x2-x1)},
        n3={mangle(#4,n1,#3)},
        n4={mangle(n1,#4,#3)}
        in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
        ($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
        midcircle/.style args={of #1 and #2}{insert path={
        let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
        }
        begin{document}

        begin{tikzpicture}[font=sffamily,declare function={%
        mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
        pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
        probe sphere radius=1}
        % define radii and center coordinates of the atoms
        edeflstR{{0,1.7,1,1.8,1.8,1,1.7,1}}
        edeflstCoords{(-4,1.5),(-1.2,2),(1.3,0.4),(4.5,0.1),(2.4,-2.3),(-2.3,-0.9),(-5.1,-1.4)}
        % draw halo
        foreach Coord [count=Z] in lstCoords
        {pgfmathsetmacro{myR}{lstR[Z]+0.8}
        draw[dashed,thick] Coord coordinate (cZ) circle (myR);}
        foreach X/Y in {1/2,1/6,1/7,2/6,2/3,3/4,3/5,3/6,4/5,6/7}
        {pgfmathsetmacro{myRone}{lstR[X]+0.8}
        pgfmathsetmacro{myRtwo}{lstR[Y]+0.8}
        fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
        [midcircle=of aux1 and aux2];}
        % draw atoms
        foreach Coord [count=Z] in lstCoords
        {pgfmathsetmacro{myR}{lstR[Z]}
        draw[green!40!black,thick] Coord coordinate (cZ)
        node{atom Z} circle (myR);}
        % merge atoms
        foreach X/Y in {1/6,3/4}
        {pgfmathsetmacro{myRone}{lstR[X]}
        pgfmathsetmacro{myRtwo}{lstR[Y]}
        fill[white,get circle intersections={cX}{cY}{myRone}{myRtwo}{aux1}{aux2}]
        [midcircle=of aux1 and aux2];}
        draw[red,thick]
        [merge circles={c1}{c2}{lstR[1]}{lstR[2]}] coordinate[pos=0](p0) coordinate[pos=1](p1)
        [merge circles={c2}{c3}{lstR[2]}{lstR[3]}] coordinate[pos=0](p2) coordinate[pos=1](p3)
        [merge circles={c3}{c4}{lstR[3]}{lstR[4]}] coordinate[pos=0](p4) coordinate[pos=1](p5)
        [merge circles={c4}{c5}{lstR[4]}{lstR[5]}] coordinate[pos=0](p6) coordinate[pos=1](p7)
        [merge circles={c5}{c3}{lstR[5]}{lstR[3]}] coordinate[pos=0](p8) coordinate[pos=1](p9)
        [merge circles={c3}{c6}{lstR[3]}{lstR[6]}] coordinate[pos=0](p10) coordinate[pos=1](p11)
        [merge circles={c6}{c7}{lstR[6]}{lstR[7]}] coordinate[pos=0](p12) coordinate[pos=1](p13)
        [merge circles={c7}{c1}{lstR[7]}{lstR[1]}] coordinate[pos=0](p14) coordinate[pos=1](p15)
        ;
        draw[red,thick]
        [path along circle=with center c2 from p1 to p2,
        path along circle=with center c3 from p3 to p4,
        path along circle=with center c4 from p5 to p6,
        path along circle=with center c5 from p7 to p8,
        path along circle=with center c3 from p9 to p10,
        path along circle=with center c6 from p11 to p12,
        path along circle=with center c7 from p13 to p14,
        path along circle=with center c1 from p15 to p0];
        end{tikzpicture}
        end{document}


        enter image description here



        The following animation explains how that works.



        documentclass{beamer}
        beamertemplatenavigationsymbolsempty
        usepackage{tikz}
        usetikzlibrary{calc}
        tikzset{merge circles/.style n args={4}{insert path={
        let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
        n2={atan2(y2-y1,x2-x1)},
        n3={mangle((#4+ProbeSphereRadius),n1,(#3+ProbeSphereRadius))},
        n4={mangle(n1,(#4+ProbeSphereRadius),(#3+ProbeSphereRadius))}
        in %pgfextra{typeout{n1,n2,n3,n4}}
        ($(#1)+(+n2+n3:#3)$) arc(180+n2+n3:180+n2+n3+n4:ProbeSphereRadius)
        }},
        path along circle/.style args={with center #1 from #2 to #3}{insert path={
        let p1=($(#2)-(#1)$), p2=($(#3)-(#1)$),
        n1={atan2(y1,x1)}, n2={atan2(y2,x2)}, n3={veclen(x1,y1)},
        n5={ifthenelse(n2<n1,n2,n2-360)}
        in %pgfextra{typeout{n1,n2,n5}}
        (#2) arc(n1:n5:n3)}},
        get circle intersections/.style n args={6}{insert path={
        let p1=(#1),p2=(#2),n1={veclen(x1-x2,y1-y2)*1pt/1cm},
        n2={atan2(y2-y1,x2-x1)},
        n3={mangle(#4,n1,#3)},
        n4={mangle(n1,#4,#3)}
        in ($(#1)+(+n2+n3:#3)$) coordinate (#5)
        ($(#1)+(+n2-n3:#3)$) coordinate (#6)}},
        midcircle/.style args={of #1 and #2}{insert path={
        let p1=($(#2)-(#1)$),n1={veclen(x1,y1)/2} in ($(#1)!0.5!(#2)$) circle (n1)}}
        }
        begin{document}
        begin{frame}[t]
        frametitle{}
        centerline{begin{tikzpicture}[scale=0.9,declare function={%
        mangle(a,b,c)=acos((b/c+c/b-(a/b)*(a/c))/2);}]
        pgfkeys{probe sphere radius/.store in=ProbeSphereRadius,
        probe sphere radius=1}
        draw (0,0) coordinate (c1) circle (3);
        draw (4,1) coordinate (c2) circle (2);
        draw (3,-2) coordinate (c3) circle (2);
        only<2->{fill[white,get circle intersections={c1}{c2}{3}{2}{x1}{x2}]
        [midcircle=of x1 and x2];
        fill[white,get circle intersections={c2}{c3}{2}{2}{x3}{x4}]
        [midcircle=of x3 and x4];
        fill[white,get circle intersections={c3}{c1}{2}{3}{x5}{x6}]
        [midcircle=of x5 and x6];
        }
        only<3->{
        draw[red]
        [merge circles={c1}{c2}{3}{2}] coordinate[pos=0](p0) coordinate[pos=1](p1)
        [merge circles={c2}{c3}{2}{2}] coordinate[pos=0](p2) coordinate[pos=1](p3)
        [merge circles={c3}{c1}{2}{3}] coordinate[pos=0](p4) coordinate[pos=1](p5)
        [path along circle=with center c2 from p1 to p2,
        path along circle=with center c3 from p3 to p4,
        path along circle=with center c1 from p5 to p0];}
        end{tikzpicture}}
        begin{enumerate}
        item Draw the circles.
        item<2-> Wipe out the overlaps. only<2>{First determine the coordinates at
        which the circles intersect with texttt{get circle intersections}
        and then fill the midcircles with texttt{midcircle}.}
        item<3-> Draw the arcs between the circles with texttt{merge circles}
        as well as the arcs along the circles with texttt{path along circle}.
        end{enumerate}
        end{frame}
        end{document}


        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 15 mins ago

























        answered 3 hours ago









        marmot

        80.6k491172




        80.6k491172






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463219%2fsolvent-accessible-and-excluded-surface%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Lallio

            Unable to find Lightning Node

            Futebolista