ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Question about defining a path with Metapost
@ 2018-12-20 23:17 Fabrice Couvreur
  2018-12-20 23:54 ` Alan Braslau
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Couvreur @ 2018-12-20 23:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 790 bytes --]

Hi,
I need to make a figure with shaded areas and I found this code proposed by
Hans. Why does the definition of the r path that Hans proposed give the
same result as what I propose ?
Thank you.
Fabrice

\starttext
\startMPpage[offset=2pt]
     path p, q, r ; pair z ;
     p := unitsquare scaled 4cm ;
     z := point 3.6 of p ;
     q := z--urcorner p ;
     r := z--urcorner p--lrcorner p--llcorner p--cycle ;
  %r := q -- reverse bottomboundary p -- cycle ; definition of Hans
     draw p ;
     draw r numberstriped (.25,10,5) withcolor magenta ;
     draw thetextext.llft("B", llcorner p) ;
     draw thetextext.lrt ("C", lrcorner p) ;
     draw thetextext.ulft("A", ulcorner p) ;
     draw thetextext.urt ("D", urcorner p) ;
     draw thetextext.lft ("M", z) ;
\stopMPpage
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 1567 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question about defining a path with Metapost
  2018-12-20 23:17 Question about defining a path with Metapost Fabrice Couvreur
@ 2018-12-20 23:54 ` Alan Braslau
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Braslau @ 2018-12-20 23:54 UTC (permalink / raw)
  To: Fabrice Couvreur; +Cc: mailing list for ConTeXt users

On Fri, 21 Dec 2018 00:17:25 +0100
Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:

> Why does the definition of the r path that Hans proposed give the
> same result as what I propose ?

Look at the definition of bottomboundary in mp-tool.mpiv
Use whatever you prefer.

You might also be interested in the modification that I added to
label:

label.llft("B", p) ;
label.lrt ("C", p) ;

etc.

Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-20 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20 23:17 Question about defining a path with Metapost Fabrice Couvreur
2018-12-20 23:54 ` Alan Braslau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).