From: Keith McKay <mckaymeister@gmail.com>
To: ntg-context@ntg.nl
Subject: Re: 'debug' version of METAPOST draw?
Date: Thu, 28 May 2020 20:24:52 +0100 [thread overview]
Message-ID: <c121aa2f-3678-c92f-b2c7-ab7bb28a4c16@gmail.com> (raw)
In-Reply-To: <7BCD7589-E126-49E9-91B9-11C8D582E040@rna.nl>
[-- Attachment #1.1: Type: text/plain, Size: 1857 bytes --]
Would Chapter 11, section 11.1 Showing Paths of the MetaPost manual, be
any help here?
Below is a MWE of a random path of curves and straight lines. The points
are shown using drawpoints. The arrow path and control lines are also
shown and are better described in the Metapost manual.
%%%%%%%%%%%%MWE%%%%%%%%%%%
\setuppapersize [A4,landscape]
\starttext
\startMPpage[instance=doublefun]
StartPage;
width := PaperWidth ; height := PaperHeight ; unit := cm ;
path p ;
path pat;
pat := (5cm,5cm);
for a = 1 step 1 until 10:
x:= uniformdeviate(10) +10;
y:= uniformdeviate(10) +10;
if odd a:
pat := pat .. (x*cm,y*cm);
else:
pat := pat -- (x*cm,y*cm);
fi;
draw pat withpen pencircle scaled 5mm withcolor .5green;
endfor;
drawarrowpath pat;
drawpoints pat;
drawcontrollines pat withcolor .625red ;
StopPage;
\stopMPpage
\stoptext
%%%%%%%%%%%%%%% end MWE %%%%%%%%%%%%%%%%%
A better coder than me may be able to incorporate it into what you require.
Best Wishes
Keith McKay
On 28/05/2020 12:33, Gerben Wierda wrote:
> I would like to be able (during development) to draw paths where the points of the path (and maybe thing slike directions) are visualised. E.g. a path where each pair in teh path is also drawn as a dot and maybe teh directions drawn as small arrows.
>
> Does someone have such a beast lying around?
>
> G
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
[-- Attachment #1.2: Type: text/html, Size: 6397 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 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
___________________________________________________________________________________
prev parent reply other threads:[~2020-05-28 19:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-28 11:33 Gerben Wierda
2020-05-28 19:24 ` Keith McKay [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c121aa2f-3678-c92f-b2c7-ab7bb28a4c16@gmail.com \
--to=mckaymeister@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).