Eraser tool for TikZ
Clash Royale CLAN TAG#URR8PPP
up vote
10
down vote
favorite
I am asking for a style (or something similar), let us call it ERASE
. The imaginary tool works as a convenient inverse clip or eraser within a scope. The specific way is asked within the comment in the following MWE. The MWE is an abstract form of my use cases (if you do not like the background, think of color wheel graphs from complex analysis to smooth your ruffled feathers).
documentclassmemoir
usepackagefontspec,amsmath,tikz
usetikzlibraryshadings,calc
tikzsetnodeStyle/.style=draw,rounded corners,thick
tikzsetERASE/.style=% just a placeholder
begindocument
begintikzpicture
shade[shading=color wheel white center] (0,0) rectangle (10,10);
draw[thick] (0,0) -- (10,5);
node[nodeStyle,fill=white] at (5,2.5) bfseriesfilled;
%This is readable but removes the background.
draw[thick] (0,2) -- (10,7);
node[nodeStyle] at (5,4.5) bfseriesnot filled;
beginscope
draw[thick] (0,4) -- (10,9);
node[nodeStyle,ERASE] at (5,6.5) bfseriesERASE to be implemented;
% erases everything in this scope "behind" this new object
% such that the diagonal line in this node is not visible and
% the text is easy to read and the coding is convenient
endscope
beginscope
% This just illustrates that clip can be used inside ascope
% thus the desired EREASE instruction might be possible.
clip (1,7) rectangle (8,10);
draw[thick] (0,6) -- (8,10);
endscope
endtikzpicture
enddocument
This imaginary tool might be unsuited for more complex use cases within several paths involved. Any suggestions on improving the use case are welcome.
tikz-pgf clip
add a comment |Â
up vote
10
down vote
favorite
I am asking for a style (or something similar), let us call it ERASE
. The imaginary tool works as a convenient inverse clip or eraser within a scope. The specific way is asked within the comment in the following MWE. The MWE is an abstract form of my use cases (if you do not like the background, think of color wheel graphs from complex analysis to smooth your ruffled feathers).
documentclassmemoir
usepackagefontspec,amsmath,tikz
usetikzlibraryshadings,calc
tikzsetnodeStyle/.style=draw,rounded corners,thick
tikzsetERASE/.style=% just a placeholder
begindocument
begintikzpicture
shade[shading=color wheel white center] (0,0) rectangle (10,10);
draw[thick] (0,0) -- (10,5);
node[nodeStyle,fill=white] at (5,2.5) bfseriesfilled;
%This is readable but removes the background.
draw[thick] (0,2) -- (10,7);
node[nodeStyle] at (5,4.5) bfseriesnot filled;
beginscope
draw[thick] (0,4) -- (10,9);
node[nodeStyle,ERASE] at (5,6.5) bfseriesERASE to be implemented;
% erases everything in this scope "behind" this new object
% such that the diagonal line in this node is not visible and
% the text is easy to read and the coding is convenient
endscope
beginscope
% This just illustrates that clip can be used inside ascope
% thus the desired EREASE instruction might be possible.
clip (1,7) rectangle (8,10);
draw[thick] (0,6) -- (8,10);
endscope
endtikzpicture
enddocument
This imaginary tool might be unsuited for more complex use cases within several paths involved. Any suggestions on improving the use case are welcome.
tikz-pgf clip
1
You can achieve that with the reverseclip trick.
– marmot
Sep 1 at 22:17
@marmot Is this a duplicate, do you think? I immediately thought of that kind of solution when I saw this. (Though I thought it was called 'inverse clip' or something like that.)
– cfr
Sep 2 at 3:18
add a comment |Â
up vote
10
down vote
favorite
up vote
10
down vote
favorite
I am asking for a style (or something similar), let us call it ERASE
. The imaginary tool works as a convenient inverse clip or eraser within a scope. The specific way is asked within the comment in the following MWE. The MWE is an abstract form of my use cases (if you do not like the background, think of color wheel graphs from complex analysis to smooth your ruffled feathers).
documentclassmemoir
usepackagefontspec,amsmath,tikz
usetikzlibraryshadings,calc
tikzsetnodeStyle/.style=draw,rounded corners,thick
tikzsetERASE/.style=% just a placeholder
begindocument
begintikzpicture
shade[shading=color wheel white center] (0,0) rectangle (10,10);
draw[thick] (0,0) -- (10,5);
node[nodeStyle,fill=white] at (5,2.5) bfseriesfilled;
%This is readable but removes the background.
draw[thick] (0,2) -- (10,7);
node[nodeStyle] at (5,4.5) bfseriesnot filled;
beginscope
draw[thick] (0,4) -- (10,9);
node[nodeStyle,ERASE] at (5,6.5) bfseriesERASE to be implemented;
% erases everything in this scope "behind" this new object
% such that the diagonal line in this node is not visible and
% the text is easy to read and the coding is convenient
endscope
beginscope
% This just illustrates that clip can be used inside ascope
% thus the desired EREASE instruction might be possible.
clip (1,7) rectangle (8,10);
draw[thick] (0,6) -- (8,10);
endscope
endtikzpicture
enddocument
This imaginary tool might be unsuited for more complex use cases within several paths involved. Any suggestions on improving the use case are welcome.
tikz-pgf clip
I am asking for a style (or something similar), let us call it ERASE
. The imaginary tool works as a convenient inverse clip or eraser within a scope. The specific way is asked within the comment in the following MWE. The MWE is an abstract form of my use cases (if you do not like the background, think of color wheel graphs from complex analysis to smooth your ruffled feathers).
documentclassmemoir
usepackagefontspec,amsmath,tikz
usetikzlibraryshadings,calc
tikzsetnodeStyle/.style=draw,rounded corners,thick
tikzsetERASE/.style=% just a placeholder
begindocument
begintikzpicture
shade[shading=color wheel white center] (0,0) rectangle (10,10);
draw[thick] (0,0) -- (10,5);
node[nodeStyle,fill=white] at (5,2.5) bfseriesfilled;
%This is readable but removes the background.
draw[thick] (0,2) -- (10,7);
node[nodeStyle] at (5,4.5) bfseriesnot filled;
beginscope
draw[thick] (0,4) -- (10,9);
node[nodeStyle,ERASE] at (5,6.5) bfseriesERASE to be implemented;
% erases everything in this scope "behind" this new object
% such that the diagonal line in this node is not visible and
% the text is easy to read and the coding is convenient
endscope
beginscope
% This just illustrates that clip can be used inside ascope
% thus the desired EREASE instruction might be possible.
clip (1,7) rectangle (8,10);
draw[thick] (0,6) -- (8,10);
endscope
endtikzpicture
enddocument
This imaginary tool might be unsuited for more complex use cases within several paths involved. Any suggestions on improving the use case are welcome.
tikz-pgf clip
edited Sep 1 at 22:18
asked Sep 1 at 21:36
CampanIgnis
1,7562628
1,7562628
1
You can achieve that with the reverseclip trick.
– marmot
Sep 1 at 22:17
@marmot Is this a duplicate, do you think? I immediately thought of that kind of solution when I saw this. (Though I thought it was called 'inverse clip' or something like that.)
– cfr
Sep 2 at 3:18
add a comment |Â
1
You can achieve that with the reverseclip trick.
– marmot
Sep 1 at 22:17
@marmot Is this a duplicate, do you think? I immediately thought of that kind of solution when I saw this. (Though I thought it was called 'inverse clip' or something like that.)
– cfr
Sep 2 at 3:18
1
1
You can achieve that with the reverseclip trick.
– marmot
Sep 1 at 22:17
You can achieve that with the reverseclip trick.
– marmot
Sep 1 at 22:17
@marmot Is this a duplicate, do you think? I immediately thought of that kind of solution when I saw this. (Though I thought it was called 'inverse clip' or something like that.)
– cfr
Sep 2 at 3:18
@marmot Is this a duplicate, do you think? I immediately thought of that kind of solution when I saw this. (Though I thought it was called 'inverse clip' or something like that.)
– cfr
Sep 2 at 3:18
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
15
down vote
accepted
Here is a version using the reverseclip trick. I am not sure if one can easily implement this as a robust style that can be added to the node since clip
does not allow extra options. However, apart from that this does it, I think. EDIT: Simplified the matters by employing use path
.
documentclassmemoir
usepackagefontspec,amsmath,tikz
usetikzlibraryshadings,calc,backgrounds
tikzsetnodeStyle/.style=draw,rounded corners,thick
makeatletter % https://tex.stackexchange.com/a/38995/121799
tikzset
use path/.code=pgfsyssoftpath@setcurrentpath#1
makeatother
tikzsetERASE/.style=save path=tmprotect
% append after command=pgfextraclip[overlay]
% (tikzlastnode.south east) rectangle (tikzlastnode.north west)
% [reverseclip];
%
% just a placeholder
tikzsetreverseclip/.style=insert path=(current bounding box.north
east) rectangle (current bounding box.south west)
begindocument
begintikzpicture
shade[shading=color wheel white center] (0,0) rectangle (10,10);
draw[thick] (0,0) -- (10,5);
node[nodeStyle,fill=white,font=bfseries] at (5,2.5) filled;
%This is readable but removes the background.
draw[thick] (0,2) -- (10,7);
node[nodeStyle,font=bfseries] at (5,4.5) not filled;
beginscope
node[nodeStyle,ERASE,font=bfseries] at (5,6.5) (erase) ERASE has been implemented;
% erases everything in this scope "behind" this new object
% such that the diagonal line in this node is not visible and
% the text is easy to read and the coding is convenient
clip[use path=tmprotect,reverseclip];
draw[thick] (0,4) -- (10,9);
draw [ultra thick,red] (0,6.05) -- (10,6.95);
endscope
beginscope
% This just illustrates that clip can be used inside ascope
% thus the desired EREASE instruction might be possible.
clip (1,7) rectangle (8,10);
draw[thick] (0,6) -- (8,10);
endscope
endtikzpicture
enddocument
Now also the rounded corners are respected.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
15
down vote
accepted
Here is a version using the reverseclip trick. I am not sure if one can easily implement this as a robust style that can be added to the node since clip
does not allow extra options. However, apart from that this does it, I think. EDIT: Simplified the matters by employing use path
.
documentclassmemoir
usepackagefontspec,amsmath,tikz
usetikzlibraryshadings,calc,backgrounds
tikzsetnodeStyle/.style=draw,rounded corners,thick
makeatletter % https://tex.stackexchange.com/a/38995/121799
tikzset
use path/.code=pgfsyssoftpath@setcurrentpath#1
makeatother
tikzsetERASE/.style=save path=tmprotect
% append after command=pgfextraclip[overlay]
% (tikzlastnode.south east) rectangle (tikzlastnode.north west)
% [reverseclip];
%
% just a placeholder
tikzsetreverseclip/.style=insert path=(current bounding box.north
east) rectangle (current bounding box.south west)
begindocument
begintikzpicture
shade[shading=color wheel white center] (0,0) rectangle (10,10);
draw[thick] (0,0) -- (10,5);
node[nodeStyle,fill=white,font=bfseries] at (5,2.5) filled;
%This is readable but removes the background.
draw[thick] (0,2) -- (10,7);
node[nodeStyle,font=bfseries] at (5,4.5) not filled;
beginscope
node[nodeStyle,ERASE,font=bfseries] at (5,6.5) (erase) ERASE has been implemented;
% erases everything in this scope "behind" this new object
% such that the diagonal line in this node is not visible and
% the text is easy to read and the coding is convenient
clip[use path=tmprotect,reverseclip];
draw[thick] (0,4) -- (10,9);
draw [ultra thick,red] (0,6.05) -- (10,6.95);
endscope
beginscope
% This just illustrates that clip can be used inside ascope
% thus the desired EREASE instruction might be possible.
clip (1,7) rectangle (8,10);
draw[thick] (0,6) -- (8,10);
endscope
endtikzpicture
enddocument
Now also the rounded corners are respected.
add a comment |Â
up vote
15
down vote
accepted
Here is a version using the reverseclip trick. I am not sure if one can easily implement this as a robust style that can be added to the node since clip
does not allow extra options. However, apart from that this does it, I think. EDIT: Simplified the matters by employing use path
.
documentclassmemoir
usepackagefontspec,amsmath,tikz
usetikzlibraryshadings,calc,backgrounds
tikzsetnodeStyle/.style=draw,rounded corners,thick
makeatletter % https://tex.stackexchange.com/a/38995/121799
tikzset
use path/.code=pgfsyssoftpath@setcurrentpath#1
makeatother
tikzsetERASE/.style=save path=tmprotect
% append after command=pgfextraclip[overlay]
% (tikzlastnode.south east) rectangle (tikzlastnode.north west)
% [reverseclip];
%
% just a placeholder
tikzsetreverseclip/.style=insert path=(current bounding box.north
east) rectangle (current bounding box.south west)
begindocument
begintikzpicture
shade[shading=color wheel white center] (0,0) rectangle (10,10);
draw[thick] (0,0) -- (10,5);
node[nodeStyle,fill=white,font=bfseries] at (5,2.5) filled;
%This is readable but removes the background.
draw[thick] (0,2) -- (10,7);
node[nodeStyle,font=bfseries] at (5,4.5) not filled;
beginscope
node[nodeStyle,ERASE,font=bfseries] at (5,6.5) (erase) ERASE has been implemented;
% erases everything in this scope "behind" this new object
% such that the diagonal line in this node is not visible and
% the text is easy to read and the coding is convenient
clip[use path=tmprotect,reverseclip];
draw[thick] (0,4) -- (10,9);
draw [ultra thick,red] (0,6.05) -- (10,6.95);
endscope
beginscope
% This just illustrates that clip can be used inside ascope
% thus the desired EREASE instruction might be possible.
clip (1,7) rectangle (8,10);
draw[thick] (0,6) -- (8,10);
endscope
endtikzpicture
enddocument
Now also the rounded corners are respected.
add a comment |Â
up vote
15
down vote
accepted
up vote
15
down vote
accepted
Here is a version using the reverseclip trick. I am not sure if one can easily implement this as a robust style that can be added to the node since clip
does not allow extra options. However, apart from that this does it, I think. EDIT: Simplified the matters by employing use path
.
documentclassmemoir
usepackagefontspec,amsmath,tikz
usetikzlibraryshadings,calc,backgrounds
tikzsetnodeStyle/.style=draw,rounded corners,thick
makeatletter % https://tex.stackexchange.com/a/38995/121799
tikzset
use path/.code=pgfsyssoftpath@setcurrentpath#1
makeatother
tikzsetERASE/.style=save path=tmprotect
% append after command=pgfextraclip[overlay]
% (tikzlastnode.south east) rectangle (tikzlastnode.north west)
% [reverseclip];
%
% just a placeholder
tikzsetreverseclip/.style=insert path=(current bounding box.north
east) rectangle (current bounding box.south west)
begindocument
begintikzpicture
shade[shading=color wheel white center] (0,0) rectangle (10,10);
draw[thick] (0,0) -- (10,5);
node[nodeStyle,fill=white,font=bfseries] at (5,2.5) filled;
%This is readable but removes the background.
draw[thick] (0,2) -- (10,7);
node[nodeStyle,font=bfseries] at (5,4.5) not filled;
beginscope
node[nodeStyle,ERASE,font=bfseries] at (5,6.5) (erase) ERASE has been implemented;
% erases everything in this scope "behind" this new object
% such that the diagonal line in this node is not visible and
% the text is easy to read and the coding is convenient
clip[use path=tmprotect,reverseclip];
draw[thick] (0,4) -- (10,9);
draw [ultra thick,red] (0,6.05) -- (10,6.95);
endscope
beginscope
% This just illustrates that clip can be used inside ascope
% thus the desired EREASE instruction might be possible.
clip (1,7) rectangle (8,10);
draw[thick] (0,6) -- (8,10);
endscope
endtikzpicture
enddocument
Now also the rounded corners are respected.
Here is a version using the reverseclip trick. I am not sure if one can easily implement this as a robust style that can be added to the node since clip
does not allow extra options. However, apart from that this does it, I think. EDIT: Simplified the matters by employing use path
.
documentclassmemoir
usepackagefontspec,amsmath,tikz
usetikzlibraryshadings,calc,backgrounds
tikzsetnodeStyle/.style=draw,rounded corners,thick
makeatletter % https://tex.stackexchange.com/a/38995/121799
tikzset
use path/.code=pgfsyssoftpath@setcurrentpath#1
makeatother
tikzsetERASE/.style=save path=tmprotect
% append after command=pgfextraclip[overlay]
% (tikzlastnode.south east) rectangle (tikzlastnode.north west)
% [reverseclip];
%
% just a placeholder
tikzsetreverseclip/.style=insert path=(current bounding box.north
east) rectangle (current bounding box.south west)
begindocument
begintikzpicture
shade[shading=color wheel white center] (0,0) rectangle (10,10);
draw[thick] (0,0) -- (10,5);
node[nodeStyle,fill=white,font=bfseries] at (5,2.5) filled;
%This is readable but removes the background.
draw[thick] (0,2) -- (10,7);
node[nodeStyle,font=bfseries] at (5,4.5) not filled;
beginscope
node[nodeStyle,ERASE,font=bfseries] at (5,6.5) (erase) ERASE has been implemented;
% erases everything in this scope "behind" this new object
% such that the diagonal line in this node is not visible and
% the text is easy to read and the coding is convenient
clip[use path=tmprotect,reverseclip];
draw[thick] (0,4) -- (10,9);
draw [ultra thick,red] (0,6.05) -- (10,6.95);
endscope
beginscope
% This just illustrates that clip can be used inside ascope
% thus the desired EREASE instruction might be possible.
clip (1,7) rectangle (8,10);
draw[thick] (0,6) -- (8,10);
endscope
endtikzpicture
enddocument
Now also the rounded corners are respected.
edited Sep 2 at 1:53
answered Sep 1 at 22:30


marmot
56.2k461123
56.2k461123
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448920%2feraser-tool-for-tikz%23new-answer', 'question_page');
);
Post as a guest
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
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
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
1
You can achieve that with the reverseclip trick.
– marmot
Sep 1 at 22:17
@marmot Is this a duplicate, do you think? I immediately thought of that kind of solution when I saw this. (Though I thought it was called 'inverse clip' or something like that.)
– cfr
Sep 2 at 3:18