Dear  Mikael,

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

> 2024. 12. 2. 오후 10:13, Mikael Sundqvist <mic...@gmail.com> 작성:
> 
> Hi
> 
> On Mon, Dec 2, 2024 at 1:57 PM Jeong Dal via ntg-context
> <ntg-context@ntg.nl <mailto: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 you
> can 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 ;
> \stopMPpage
> 
> If 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.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to