ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* 'debug' version of METAPOST draw?
@ 2020-05-28 11:33 Gerben Wierda
  2020-05-28 19:24 ` Keith McKay
  0 siblings, 1 reply; 2+ messages in thread
From: Gerben Wierda @ 2020-05-28 11:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

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

* Re: 'debug' version of METAPOST draw?
  2020-05-28 11:33 'debug' version of METAPOST draw? Gerben Wierda
@ 2020-05-28 19:24 ` Keith McKay
  0 siblings, 0 replies; 2+ messages in thread
From: Keith McKay @ 2020-05-28 19:24 UTC (permalink / raw)
  To: ntg-context


[-- 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
___________________________________________________________________________________

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

end of thread, other threads:[~2020-05-28 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 11:33 'debug' version of METAPOST draw? Gerben Wierda
2020-05-28 19:24 ` Keith McKay

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).