ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem with shading when using rotation (Metapost)
@ 2020-02-29 10:01 Fabrice Couvreur
  2020-03-03 20:57 ` Fabrice Couvreur
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Couvreur @ 2020-02-29 10:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,
Sorry to come back with my match problem. In fact, I do not understand why
a rotation of 90 influences the degraded color of the ends of the matches.
Thank you.
Fabrice

\starttext
\startMPcode

  def match (expr alpha, pos) =
    numeric l;
    l = 4.6cm;
    picture pic;
    pic = image (
    fill unitsquare xscaled 4cm  yscaled 0.2cm  withcolor yellow ;
    fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) --
    cycle withcolor(.6yellow + black);
    draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
    -- (0.1cm,-0.05cm) -- cycle ;
    fill fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm) shaded
    withshademethod "circular"
    withshadefactor 0.75
    withshadecolors (white,red););
    draw (fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm));
    draw pic rotated alpha shifted pos;
    enddef;

    picture house ;
    house = image (
    match(90,(0,0));
    match(0,(0,0));
    match(90,(l,0));
    match(120,(l,l));
    match(60,(0,l)););

    draw house;

\stopMPcode

[-- Attachment #1.2: Type: text/html, Size: 1859 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

* Re: Problem with shading when using rotation (Metapost)
  2020-02-29 10:01 Problem with shading when using rotation (Metapost) Fabrice Couvreur
@ 2020-03-03 20:57 ` Fabrice Couvreur
  0 siblings, 0 replies; 2+ messages in thread
From: Fabrice Couvreur @ 2020-03-03 20:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,
No idea ?
Thanks
Fabrice

Le sam. 29 févr. 2020 à 11:01, Fabrice Couvreur <fabrice1.couvreur@gmail.com>
a écrit :

> Hi,
> Sorry to come back with my match problem. In fact, I do not understand
> why a rotation of 90 influences the degraded color of the ends of the
> matches.
> Thank you.
> Fabrice
>
> \starttext
> \startMPcode
>
>   def match (expr alpha, pos) =
>     numeric l;
>     l = 4.6cm;
>     picture pic;
>     pic = image (
>     fill unitsquare xscaled 4cm  yscaled 0.2cm  withcolor yellow ;
>     fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) --
>     cycle withcolor(.6yellow + black);
>     draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
>     -- (0.1cm,-0.05cm) -- cycle ;
>     fill fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm) shaded
>     withshademethod "circular"
>     withshadefactor 0.75
>     withshadecolors (white,red););
>     draw (fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm));
>     draw pic rotated alpha shifted pos;
>     enddef;
>
>     picture house ;
>     house = image (
>     match(90,(0,0));
>     match(0,(0,0));
>     match(90,(l,0));
>     match(120,(l,l));
>     match(60,(0,l)););
>
>     draw house;
>
> \stopMPcode
>

[-- Attachment #1.2: Type: text/html, Size: 2393 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-03-03 20:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-29 10:01 Problem with shading when using rotation (Metapost) Fabrice Couvreur
2020-03-03 20:57 ` Fabrice Couvreur

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