ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Draw a line with Metafun
@ 2005-08-08  9:43 Jessica Holle
  2005-08-08 12:03 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Jessica Holle @ 2005-08-08  9:43 UTC (permalink / raw)



Hi,

I want to draw a line myself with Metafun.
This line should looks like in the module pre-05.

I've copied a few lines and try to understand what there happend.
But it failed. I've also read in the metafun.pdf, but it ist very
hard to understand.

I don't see the context between the numbers of x ond y. When I
change the numbers the output varies but in no relation to the
numbers.

Can anyone help to explain this to me or has another documentation?

so looks my test:

\setupoutput[pdftex]
\setupcolors[state=start]
\definecolor[back2][r=.6,g=.7,b=.8]
\definecolor[back][s=.95]
\starttext
\startMPinclusions
def random_hash_frame (expr width, height, offset, linewidth ) =
def delta = ((uniformdeviate .5offset) + .25offset) enddef ;
x1 := 0.5cm ; y1 :=0.5cm ; x2 := 16cm ; y2 := 3cm ;
drawoptions(withpen pencircle scaled linewidth withcolor
\MPcolor{back2}) ;
fill z1--(x2,y1)--z2--(x1,y2)--cycle ;
enddef;
\stopMPinclusions
\startuseMPgraphic{jessi}
random_hash_frame(height,width, 0.5cm,0.5cm)
\stopuseMPgraphic
\useMPgraphic{jessi}
\stoptext


Greetings Jessi

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

* Re: Draw a line with Metafun
  2005-08-08  9:43 Draw a line with Metafun Jessica Holle
@ 2005-08-08 12:03 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2005-08-08 12:03 UTC (permalink / raw)


Jessica Holle wrote:

>Hi,
>
>I want to draw a line myself with Metafun.
>This line should looks like in the module pre-05.
>
>I've copied a few lines and try to understand what there happend.
>But it failed. I've also read in the metafun.pdf, but it ist very
>hard to understand.
>
>I don't see the context between the numbers of x ond y. When I
>change the numbers the output varies but in no relation to the
>numbers.
>
>Can anyone help to explain this to me or has another documentation?
>
>so looks my test:
>
>\setupoutput[pdftex]
>\setupcolors[state=start]
>\definecolor[back2][r=.6,g=.7,b=.8]
>\definecolor[back][s=.95]
>\starttext
>\startMPinclusions
>def random_hash_frame (expr width, height, offset, linewidth ) =
>def delta = ((uniformdeviate .5offset) + .25offset) enddef ;
>x1 := 0.5cm ; y1 :=0.5cm ; x2 := 16cm ; y2 := 3cm ;
>drawoptions(withpen pencircle scaled linewidth withcolor
>\MPcolor{back2}) ;
>fill z1--(x2,y1)--z2--(x1,y2)--cycle ;
>enddef;
>\stopMPinclusions
>\startuseMPgraphic{jessi}
>random_hash_frame(height,width, 0.5cm,0.5cm)
>  
>
                                        10cm,5cm

or whatever, you need to provide some known measures

>\stopuseMPgraphic
>\useMPgraphic{jessi}
>\stoptext
>  
>
think of z1 being equivalent to (x1,y1) 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2005-08-08 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-08  9:43 Draw a line with Metafun Jessica Holle
2005-08-08 12:03 ` Hans Hagen

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