As you said, it might be good to use image.
Since I want not to draw a part of the path, I’d like to use the following code.
pic := image(origin--(2u,0)--(3u,u); (3u,0)--(4u,0););
Thank you for the reply.
Best regards,
Dalyoung
HiOn Mon, Dec 2, 2024 at 1:57 PM Jeong Dal via ntg-context<ntg-context@ntg.nl> wrote:
Dear all,
I’d like to hide a part of a path.
I can do that after changing it into an image, but it is not clearly erased.
Is there a way to do that not changing it into an image?
Thank you for reading.
Best regards,
Dalyoung
\startMPcode
path p,q;
picture pic;
numeric u; u:= 1cm;
p := origin--(2u,0)--(3u,u)--(3u,0)--(4u,0);
q := (3u,u)--(3u,0);
pic := image(draw p; draw q withcolor white;);
draw pic;
\stopMPcode
It is not clear how general you want this to be. For your example youcan draw only the parts of p you need.\startMPpage[offset=1DK] path p,q; picture pic; numeric u; u:= 1cm; p := origin--(2u,0)--(3u,u)--(3u,0)--(4u,0); q := (3u,u)--(3u,0); % pic := image(draw p; draw q withcolor white;); % draw pic; draw p withpen pencircle scaled 4 ; draw subpath (0,2) of p && subpath (3,4) of p withpen pencircle scaled 2 withcolor yellow ;\stopMPpageIf you need to "cut" in a more advanced way, I suggest to give such an example./Mikael___________________________________________________________________________________If your question is of interest to others as well, please add an entry to the Wiki!maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nlwebpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)archive : https://github.com/contextgarden/contextwiki : https://wiki.contextgarden.net___________________________________________________________________________________