How to draw special tikz borders
I am trying to draw a diagram showing the action of soap on grease and dirt. Currently I have the following diagram:
I would like the shapes that surround the large orange-yellow blobs to be the same as the shapes that are free and not bound. The code is as follows:
documentclass[10pt,a4paper]{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{graphicx}
usepackage[left=0.00cm, right=0.00cm]{geometry}
usepackage{tikz}
usetikzlibrary{calc,decorations.pathreplacing,fadings}
newcommand{lipid}[3]{
begin{scope}[xshift=#1cm,yshift=#2cm,rotate=#3]
shadedraw[shading=radial,inner color=purple!40,outer color=purple!60!black] (0,0) circle (2.5pt);
shade[shading=linear,top color=purple!60!black,bottom color=green!70!black] (-0.75pt,-2pt) rectangle (0.75pt,-12pt);
end{scope}
}
begin{document}
pgfdeclaredecoration{lipidleaflet}{initial}
{
% Place as many segments as possible along the path to decorate
% the minimum distance between two segments is set to 7 pt.
state{initial}[width=pgfdecoratedpathlength/floor(pgfdecoratedpathlength/7pt)]
{
pgfpathmoveto{pgfpoint{-0.75pt}{3pt}}
pgfpathlineto{pgfpoint{-0.75pt}{-7pt}}
pgfpathlineto{pgfpoint{0.75pt}{-7pt}}
pgfpathlineto{pgfpoint{0.75pt}{3pt}}
% Draw the head group
pgfpathmoveto{pgfpoint{1pt}{0pt}}
pgfpathcircle{pgfpoint{0pt}{5pt}}{2.5pt}
}
state{final}
{
pgfpathmoveto{pgfpointdecoratedpathlast}
}
}
begin{tikzpicture}
% BACKGROUND
shadedraw[bottom color=cyan!10,top color=cyan!60!blue] (-0.5,0) rectangle (11,7.5);
draw[thick] (-0.5,0) -- (11,0);
% LARGE MOLECULES
shadedraw[shading=radial,inner color=yellow!20,outer color=orange!40] (0,1.5) .. controls (2,1.5) and (3,2) .. (4,2) .. controls (5,2) and (5.5,2) .. (5.5,1.5) .. controls (5.5,1) and (4.5,0.5) .. (4.5,0) -- (-0.5,0) -- (-0.5,1.5) -- cycle;
shadedraw[shading=radial,inner color=yellow!20,outer color=orange!40] (7,3.5) .. controls (6.5,4) and (7.5,4.5) .. (8,5) .. controls (8.5,5.5) and (9,5.5) .. (9.5,5.5) .. controls (10,5.5) and (10.5,5) .. (10.5,4.5) .. controls (10.5,4) and (10.5,4) .. (10,3.5).. controls (9.5,3) and (9.5,3) .. (8.5,3) .. controls (8,3) and (7.5,3) .. (7,3.5);
% BOUND LIPIDS
draw[decorate, decoration={lipidleaflet}] (0,1.5) .. controls (2,1.5) and (3,2) .. (4,2) .. controls (5,2) and (5.5,2) .. (5.5,1.5) .. controls (5.5,1) and (4.5,0.5) .. (4.5,0);
draw[decorate, decoration={lipidleaflet}] (7,3.5) .. controls (6.5,4) and (7.5,4.5) .. (8,5) .. controls (8.5,5.5) and (9,5.5) .. (9.5,5.5) .. controls (10,5.5) and (10.5,5) .. (10.5,4.5) .. controls (10.5,4) and (10.5,4) .. (10,3.5).. controls (9.5,3) and (9.5,3) .. (8.5,3) .. controls (8,3) and (7.5,3) .. (7,3.5);
% FREE LIPIDS
lipid{1}{6}{20}
lipid{5.5}{5.5}{193}
lipid{0.5}{2.5}{201}
lipid{3}{7}{118}
lipid{2.5}{3.5}{217}
lipid{3.5}{5}{346}
lipid{5}{3.5}{26}
lipid{6.5}{2.5}{310}
lipid{6.5}{1}{123}
lipid{9}{1}{353}
% LABELLING
node at (2,0.5) {Grease on Surface};
node at (9,2.5) {Micelle};
draw (8.7,4.3) -- (7.5,6) node[anchor=south,align=center] {Grease particle made\soluble by soap};
end{tikzpicture}
end{document}
Some of the code comes from http://www.texample.net/tikz/examples/lipid-vesicle/
tikz-pgf
add a comment |
I am trying to draw a diagram showing the action of soap on grease and dirt. Currently I have the following diagram:
I would like the shapes that surround the large orange-yellow blobs to be the same as the shapes that are free and not bound. The code is as follows:
documentclass[10pt,a4paper]{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{graphicx}
usepackage[left=0.00cm, right=0.00cm]{geometry}
usepackage{tikz}
usetikzlibrary{calc,decorations.pathreplacing,fadings}
newcommand{lipid}[3]{
begin{scope}[xshift=#1cm,yshift=#2cm,rotate=#3]
shadedraw[shading=radial,inner color=purple!40,outer color=purple!60!black] (0,0) circle (2.5pt);
shade[shading=linear,top color=purple!60!black,bottom color=green!70!black] (-0.75pt,-2pt) rectangle (0.75pt,-12pt);
end{scope}
}
begin{document}
pgfdeclaredecoration{lipidleaflet}{initial}
{
% Place as many segments as possible along the path to decorate
% the minimum distance between two segments is set to 7 pt.
state{initial}[width=pgfdecoratedpathlength/floor(pgfdecoratedpathlength/7pt)]
{
pgfpathmoveto{pgfpoint{-0.75pt}{3pt}}
pgfpathlineto{pgfpoint{-0.75pt}{-7pt}}
pgfpathlineto{pgfpoint{0.75pt}{-7pt}}
pgfpathlineto{pgfpoint{0.75pt}{3pt}}
% Draw the head group
pgfpathmoveto{pgfpoint{1pt}{0pt}}
pgfpathcircle{pgfpoint{0pt}{5pt}}{2.5pt}
}
state{final}
{
pgfpathmoveto{pgfpointdecoratedpathlast}
}
}
begin{tikzpicture}
% BACKGROUND
shadedraw[bottom color=cyan!10,top color=cyan!60!blue] (-0.5,0) rectangle (11,7.5);
draw[thick] (-0.5,0) -- (11,0);
% LARGE MOLECULES
shadedraw[shading=radial,inner color=yellow!20,outer color=orange!40] (0,1.5) .. controls (2,1.5) and (3,2) .. (4,2) .. controls (5,2) and (5.5,2) .. (5.5,1.5) .. controls (5.5,1) and (4.5,0.5) .. (4.5,0) -- (-0.5,0) -- (-0.5,1.5) -- cycle;
shadedraw[shading=radial,inner color=yellow!20,outer color=orange!40] (7,3.5) .. controls (6.5,4) and (7.5,4.5) .. (8,5) .. controls (8.5,5.5) and (9,5.5) .. (9.5,5.5) .. controls (10,5.5) and (10.5,5) .. (10.5,4.5) .. controls (10.5,4) and (10.5,4) .. (10,3.5).. controls (9.5,3) and (9.5,3) .. (8.5,3) .. controls (8,3) and (7.5,3) .. (7,3.5);
% BOUND LIPIDS
draw[decorate, decoration={lipidleaflet}] (0,1.5) .. controls (2,1.5) and (3,2) .. (4,2) .. controls (5,2) and (5.5,2) .. (5.5,1.5) .. controls (5.5,1) and (4.5,0.5) .. (4.5,0);
draw[decorate, decoration={lipidleaflet}] (7,3.5) .. controls (6.5,4) and (7.5,4.5) .. (8,5) .. controls (8.5,5.5) and (9,5.5) .. (9.5,5.5) .. controls (10,5.5) and (10.5,5) .. (10.5,4.5) .. controls (10.5,4) and (10.5,4) .. (10,3.5).. controls (9.5,3) and (9.5,3) .. (8.5,3) .. controls (8,3) and (7.5,3) .. (7,3.5);
% FREE LIPIDS
lipid{1}{6}{20}
lipid{5.5}{5.5}{193}
lipid{0.5}{2.5}{201}
lipid{3}{7}{118}
lipid{2.5}{3.5}{217}
lipid{3.5}{5}{346}
lipid{5}{3.5}{26}
lipid{6.5}{2.5}{310}
lipid{6.5}{1}{123}
lipid{9}{1}{353}
% LABELLING
node at (2,0.5) {Grease on Surface};
node at (9,2.5) {Micelle};
draw (8.7,4.3) -- (7.5,6) node[anchor=south,align=center] {Grease particle made\soluble by soap};
end{tikzpicture}
end{document}
Some of the code comes from http://www.texample.net/tikz/examples/lipid-vesicle/
tikz-pgf
add a comment |
I am trying to draw a diagram showing the action of soap on grease and dirt. Currently I have the following diagram:
I would like the shapes that surround the large orange-yellow blobs to be the same as the shapes that are free and not bound. The code is as follows:
documentclass[10pt,a4paper]{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{graphicx}
usepackage[left=0.00cm, right=0.00cm]{geometry}
usepackage{tikz}
usetikzlibrary{calc,decorations.pathreplacing,fadings}
newcommand{lipid}[3]{
begin{scope}[xshift=#1cm,yshift=#2cm,rotate=#3]
shadedraw[shading=radial,inner color=purple!40,outer color=purple!60!black] (0,0) circle (2.5pt);
shade[shading=linear,top color=purple!60!black,bottom color=green!70!black] (-0.75pt,-2pt) rectangle (0.75pt,-12pt);
end{scope}
}
begin{document}
pgfdeclaredecoration{lipidleaflet}{initial}
{
% Place as many segments as possible along the path to decorate
% the minimum distance between two segments is set to 7 pt.
state{initial}[width=pgfdecoratedpathlength/floor(pgfdecoratedpathlength/7pt)]
{
pgfpathmoveto{pgfpoint{-0.75pt}{3pt}}
pgfpathlineto{pgfpoint{-0.75pt}{-7pt}}
pgfpathlineto{pgfpoint{0.75pt}{-7pt}}
pgfpathlineto{pgfpoint{0.75pt}{3pt}}
% Draw the head group
pgfpathmoveto{pgfpoint{1pt}{0pt}}
pgfpathcircle{pgfpoint{0pt}{5pt}}{2.5pt}
}
state{final}
{
pgfpathmoveto{pgfpointdecoratedpathlast}
}
}
begin{tikzpicture}
% BACKGROUND
shadedraw[bottom color=cyan!10,top color=cyan!60!blue] (-0.5,0) rectangle (11,7.5);
draw[thick] (-0.5,0) -- (11,0);
% LARGE MOLECULES
shadedraw[shading=radial,inner color=yellow!20,outer color=orange!40] (0,1.5) .. controls (2,1.5) and (3,2) .. (4,2) .. controls (5,2) and (5.5,2) .. (5.5,1.5) .. controls (5.5,1) and (4.5,0.5) .. (4.5,0) -- (-0.5,0) -- (-0.5,1.5) -- cycle;
shadedraw[shading=radial,inner color=yellow!20,outer color=orange!40] (7,3.5) .. controls (6.5,4) and (7.5,4.5) .. (8,5) .. controls (8.5,5.5) and (9,5.5) .. (9.5,5.5) .. controls (10,5.5) and (10.5,5) .. (10.5,4.5) .. controls (10.5,4) and (10.5,4) .. (10,3.5).. controls (9.5,3) and (9.5,3) .. (8.5,3) .. controls (8,3) and (7.5,3) .. (7,3.5);
% BOUND LIPIDS
draw[decorate, decoration={lipidleaflet}] (0,1.5) .. controls (2,1.5) and (3,2) .. (4,2) .. controls (5,2) and (5.5,2) .. (5.5,1.5) .. controls (5.5,1) and (4.5,0.5) .. (4.5,0);
draw[decorate, decoration={lipidleaflet}] (7,3.5) .. controls (6.5,4) and (7.5,4.5) .. (8,5) .. controls (8.5,5.5) and (9,5.5) .. (9.5,5.5) .. controls (10,5.5) and (10.5,5) .. (10.5,4.5) .. controls (10.5,4) and (10.5,4) .. (10,3.5).. controls (9.5,3) and (9.5,3) .. (8.5,3) .. controls (8,3) and (7.5,3) .. (7,3.5);
% FREE LIPIDS
lipid{1}{6}{20}
lipid{5.5}{5.5}{193}
lipid{0.5}{2.5}{201}
lipid{3}{7}{118}
lipid{2.5}{3.5}{217}
lipid{3.5}{5}{346}
lipid{5}{3.5}{26}
lipid{6.5}{2.5}{310}
lipid{6.5}{1}{123}
lipid{9}{1}{353}
% LABELLING
node at (2,0.5) {Grease on Surface};
node at (9,2.5) {Micelle};
draw (8.7,4.3) -- (7.5,6) node[anchor=south,align=center] {Grease particle made\soluble by soap};
end{tikzpicture}
end{document}
Some of the code comes from http://www.texample.net/tikz/examples/lipid-vesicle/
tikz-pgf
I am trying to draw a diagram showing the action of soap on grease and dirt. Currently I have the following diagram:
I would like the shapes that surround the large orange-yellow blobs to be the same as the shapes that are free and not bound. The code is as follows:
documentclass[10pt,a4paper]{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{graphicx}
usepackage[left=0.00cm, right=0.00cm]{geometry}
usepackage{tikz}
usetikzlibrary{calc,decorations.pathreplacing,fadings}
newcommand{lipid}[3]{
begin{scope}[xshift=#1cm,yshift=#2cm,rotate=#3]
shadedraw[shading=radial,inner color=purple!40,outer color=purple!60!black] (0,0) circle (2.5pt);
shade[shading=linear,top color=purple!60!black,bottom color=green!70!black] (-0.75pt,-2pt) rectangle (0.75pt,-12pt);
end{scope}
}
begin{document}
pgfdeclaredecoration{lipidleaflet}{initial}
{
% Place as many segments as possible along the path to decorate
% the minimum distance between two segments is set to 7 pt.
state{initial}[width=pgfdecoratedpathlength/floor(pgfdecoratedpathlength/7pt)]
{
pgfpathmoveto{pgfpoint{-0.75pt}{3pt}}
pgfpathlineto{pgfpoint{-0.75pt}{-7pt}}
pgfpathlineto{pgfpoint{0.75pt}{-7pt}}
pgfpathlineto{pgfpoint{0.75pt}{3pt}}
% Draw the head group
pgfpathmoveto{pgfpoint{1pt}{0pt}}
pgfpathcircle{pgfpoint{0pt}{5pt}}{2.5pt}
}
state{final}
{
pgfpathmoveto{pgfpointdecoratedpathlast}
}
}
begin{tikzpicture}
% BACKGROUND
shadedraw[bottom color=cyan!10,top color=cyan!60!blue] (-0.5,0) rectangle (11,7.5);
draw[thick] (-0.5,0) -- (11,0);
% LARGE MOLECULES
shadedraw[shading=radial,inner color=yellow!20,outer color=orange!40] (0,1.5) .. controls (2,1.5) and (3,2) .. (4,2) .. controls (5,2) and (5.5,2) .. (5.5,1.5) .. controls (5.5,1) and (4.5,0.5) .. (4.5,0) -- (-0.5,0) -- (-0.5,1.5) -- cycle;
shadedraw[shading=radial,inner color=yellow!20,outer color=orange!40] (7,3.5) .. controls (6.5,4) and (7.5,4.5) .. (8,5) .. controls (8.5,5.5) and (9,5.5) .. (9.5,5.5) .. controls (10,5.5) and (10.5,5) .. (10.5,4.5) .. controls (10.5,4) and (10.5,4) .. (10,3.5).. controls (9.5,3) and (9.5,3) .. (8.5,3) .. controls (8,3) and (7.5,3) .. (7,3.5);
% BOUND LIPIDS
draw[decorate, decoration={lipidleaflet}] (0,1.5) .. controls (2,1.5) and (3,2) .. (4,2) .. controls (5,2) and (5.5,2) .. (5.5,1.5) .. controls (5.5,1) and (4.5,0.5) .. (4.5,0);
draw[decorate, decoration={lipidleaflet}] (7,3.5) .. controls (6.5,4) and (7.5,4.5) .. (8,5) .. controls (8.5,5.5) and (9,5.5) .. (9.5,5.5) .. controls (10,5.5) and (10.5,5) .. (10.5,4.5) .. controls (10.5,4) and (10.5,4) .. (10,3.5).. controls (9.5,3) and (9.5,3) .. (8.5,3) .. controls (8,3) and (7.5,3) .. (7,3.5);
% FREE LIPIDS
lipid{1}{6}{20}
lipid{5.5}{5.5}{193}
lipid{0.5}{2.5}{201}
lipid{3}{7}{118}
lipid{2.5}{3.5}{217}
lipid{3.5}{5}{346}
lipid{5}{3.5}{26}
lipid{6.5}{2.5}{310}
lipid{6.5}{1}{123}
lipid{9}{1}{353}
% LABELLING
node at (2,0.5) {Grease on Surface};
node at (9,2.5) {Micelle};
draw (8.7,4.3) -- (7.5,6) node[anchor=south,align=center] {Grease particle made\soluble by soap};
end{tikzpicture}
end{document}
Some of the code comes from http://www.texample.net/tikz/examples/lipid-vesicle/
tikz-pgf
tikz-pgf
asked 45 mins ago
sab hoquesab hoque
1,502318
1,502318
add a comment |
add a comment |
0
active
oldest
votes
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f471073%2fhow-to-draw-special-tikz-borders%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f471073%2fhow-to-draw-special-tikz-borders%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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