ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Making metafun pictures fainter (shading, uncolored clash)
@ 2021-10-11  4:30 Gavin via ntg-context
  2021-10-11  8:53 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Gavin via ntg-context @ 2021-10-11  4:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Gavin

[-- Attachment #1: Type: text/plain, Size: 136 bytes --]

Hi List,

I made good progress producing fainter pictures in metafun. Here is a uniformly accelerated cow in the style of my book.


[-- Attachment #2: PastedGraphic-2.pdf --]
[-- Type: application/pdf, Size: 25462 bytes --]

[-- Attachment #3: Type: text/plain, Size: 1274 bytes --]



I abandoned transparency, since I actually don’t want to see through anything. I am using uncolored to get the fade. It works great with a picture that is made with fill and draw, but it doesn’t work with shading. The example below has a flat disk and a round ball. The disk looks fine, but the shaded ball is not surviving the application of inverted / uncolored.


\startMPinclusions
  picture disk, ball;
  disk := image(
    fill fullcircle scaled 1cm withcolor .4white;
    draw fullcircle scaled 1cm withpen pencircle scaled 0.8pt ;);
  ball := image(
    fill fullcircle scaled 1cm
      withshademethod "circular"
      withshadecenter (.25,.25)
      withshadecolors (.8white, black);
    draw fullcircle scaled 1cm withpen pencircle scaled 0.8pt ;);
\stopMPinclusions

\startMPpage
   draw inverted (disk uncolored .1white) ;
   draw inverted (disk uncolored .2white) shifted (0.25cm,0) ;
   draw inverted (disk uncolored .5white) shifted (1cm,0) ;
   draw disk shifted (2.25cm,0) ;

   draw inverted (ball uncolored .1white) shifted (0, -2cm) ;
   draw inverted (ball uncolored .2white) shifted (0.25cm, -2cm) ;
   draw inverted (ball uncolored .5white) shifted (1cm, -2cm) ;
   draw ball shifted (2.25cm, -2cm) ;
\stopMPpage


[-- Attachment #4: Gracht.pdf --]
[-- Type: application/pdf, Size: 4543 bytes --]

[-- Attachment #5: Type: text/plain, Size: 255 bytes --]



Same result in LMTX and MkIV. (ConTeXt  ver: 2021.09.17 10:01 LMTX  fmt: 2021.9.21  int: english/english)

I’m pretty happy with this uncolored trick, and will be even happier if I can get it to work with the shadings.

Any suggestions?

Gavin

[-- Attachment #6: 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] 4+ messages in thread

* Re: Making metafun pictures fainter (shading, uncolored clash)
  2021-10-11  4:30 Making metafun pictures fainter (shading, uncolored clash) Gavin via ntg-context
@ 2021-10-11  8:53 ` Hans Hagen via ntg-context
  2021-10-11 15:49   ` Solved: Making metafun pictures fainter Gavin via ntg-context
  2021-10-12 12:33   ` Gavin via ntg-context
  0 siblings, 2 replies; 4+ messages in thread
From: Hans Hagen via ntg-context @ 2021-10-11  8:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

On 10/11/2021 6:30 AM, Gavin via ntg-context wrote:
> Hi List,
> 
> I made good progress producing fainter pictures in metafun. Here is a uniformly accelerated cow in the style of my book.
> 
> 
> 
> 
> I abandoned transparency, since I actually don’t want to see through anything. I am using uncolored to get the fade. It works great with a picture that is made with fill and draw, but it doesn’t work with shading. The example below has a flat disk and a round ball. The disk looks fine, but the shaded ball is not surviving the application of inverted / uncolored.
> 
> 
> \startMPinclusions
>    picture disk, ball;
>    disk := image(
>      fill fullcircle scaled 1cm withcolor .4white;
>      draw fullcircle scaled 1cm withpen pencircle scaled 0.8pt ;);
>    ball := image(
>      fill fullcircle scaled 1cm
>        withshademethod "circular"
>        withshadecenter (.25,.25)
>        withshadecolors (.8white, black);
>      draw fullcircle scaled 1cm withpen pencircle scaled 0.8pt ;);
> \stopMPinclusions
> 
> \startMPpage
>     draw inverted (disk uncolored .1white) ;
>     draw inverted (disk uncolored .2white) shifted (0.25cm,0) ;
>     draw inverted (disk uncolored .5white) shifted (1cm,0) ;
>     draw disk shifted (2.25cm,0) ;
> 
>     draw inverted (ball uncolored .1white) shifted (0, -2cm) ;
>     draw inverted (ball uncolored .2white) shifted (0.25cm, -2cm) ;
>     draw inverted (ball uncolored .5white) shifted (1cm, -2cm) ;
>     draw ball shifted (2.25cm, -2cm) ;
> \stopMPpage
> 
> 
> 
> 
> Same result in LMTX and MkIV. (ConTeXt  ver: 2021.09.17 10:01 LMTX  fmt: 2021.9.21  int: english/english)
> 
> I’m pretty happy with this uncolored trick, and will be even happier if I can get it to work with the shadings.
> 
> Any suggestions?
\startMPpage
     fill fullcircle scaled 10cm
         shifted (3cm,0)
         withcolor white ;
     fill fullcircle scaled 10cm
         shifted (3cm,0)
         withcolor black
         withtransparency (1,.25) ;

     fill fullcircle scaled 5cm
         shifted (3cm,0)
         withcolor .25[red,white] ;
\stopMPpage


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 4+ messages in thread

* Solved: Making metafun pictures fainter
  2021-10-11  8:53 ` Hans Hagen via ntg-context
@ 2021-10-11 15:49   ` Gavin via ntg-context
  2021-10-12 12:33   ` Gavin via ntg-context
  1 sibling, 0 replies; 4+ messages in thread
From: Gavin via ntg-context @ 2021-10-11 15:49 UTC (permalink / raw)
  To: Hans Hagen; +Cc: Gavin, mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Hi List,

Thanks, Hans, for your suggestion. In the end, I decided that I actually liked the silhouettes better than a faint version of the whole picture. Silhouettes clearly show the motion, but are far less visually distracting. In the figure below, the projectile motion’s are clear, including the cow’s constant angular velocity, but the final state still pops out.

[-- Attachment #2: Gracht.pdf --]
[-- Type: application/pdf, Size: 102674 bytes --]

[-- Attachment #3: Type: text/plain, Size: 3423 bytes --]


I used “redecorated" to get the pictures with light, solid grays. Below is code for producing just the ball, if anyone wants to see the details. It includes a simple “shadow" macro that produces a shadow of any picture with an adjustable gray.

I’m having lots of metafun!
Gavin


\startMPinclusions
  picture ball;
  ball := image(
    fill fullcircle scaled 1cm
      withshademethod "circular"
      withshadecenter (.25,.25)
      withshadecolors (.8white, black);
    draw fullcircle scaled 1cm withpen pencircle scaled 0.8pt ;);
  vardef shadow(expr p, t) = 
    draw redecorated (draw p) withcolor t[background,0.8background];
  enddef; 
\stopMPinclusions

\startMPpage
  pair p;
  for i=0 upto 10:
    p := (i*cm/10, -((i-7.33)**2)*cm/7);
    shadow(ball shifted p, (i+1)/10) ;
  endfor
  draw ball shifted(1.1cm, -1.92cm) ;
\stopMPpage


> On Oct 11, 2021, at 2:53 AM, Hans Hagen <j.hagen@xs4all.nl> wrote:
> 
> On 10/11/2021 6:30 AM, Gavin via ntg-context wrote:
>> Hi List,
>> I made good progress producing fainter pictures in metafun. Here is a uniformly accelerated cow in the style of my book.
>> I abandoned transparency, since I actually don’t want to see through anything. I am using uncolored to get the fade. It works great with a picture that is made with fill and draw, but it doesn’t work with shading. The example below has a flat disk and a round ball. The disk looks fine, but the shaded ball is not surviving the application of inverted / uncolored.
>> \startMPinclusions
>>   picture disk, ball;
>>   disk := image(
>>     fill fullcircle scaled 1cm withcolor .4white;
>>     draw fullcircle scaled 1cm withpen pencircle scaled 0.8pt ;);
>>   ball := image(
>>     fill fullcircle scaled 1cm
>>       withshademethod "circular"
>>       withshadecenter (.25,.25)
>>       withshadecolors (.8white, black);
>>     draw fullcircle scaled 1cm withpen pencircle scaled 0.8pt ;);
>> \stopMPinclusions
>> \startMPpage
>>    draw inverted (disk uncolored .1white) ;
>>    draw inverted (disk uncolored .2white) shifted (0.25cm,0) ;
>>    draw inverted (disk uncolored .5white) shifted (1cm,0) ;
>>    draw disk shifted (2.25cm,0) ;
>>    draw inverted (ball uncolored .1white) shifted (0, -2cm) ;
>>    draw inverted (ball uncolored .2white) shifted (0.25cm, -2cm) ;
>>    draw inverted (ball uncolored .5white) shifted (1cm, -2cm) ;
>>    draw ball shifted (2.25cm, -2cm) ;
>> \stopMPpage
>> Same result in LMTX and MkIV. (ConTeXt  ver: 2021.09.17 10:01 LMTX  fmt: 2021.9.21  int: english/english)
>> I’m pretty happy with this uncolored trick, and will be even happier if I can get it to work with the shadings.
>> Any suggestions?
> \startMPpage
>    fill fullcircle scaled 10cm
>        shifted (3cm,0)
>        withcolor white ;
>    fill fullcircle scaled 10cm
>        shifted (3cm,0)
>        withcolor black
>        withtransparency (1,.25) ;
> 
>    fill fullcircle scaled 5cm
>        shifted (3cm,0)
>        withcolor .25[red,white] ;
> \stopMPpage
> 
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------


[-- Attachment #4: 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] 4+ messages in thread

* Solved: Making metafun pictures fainter
  2021-10-11  8:53 ` Hans Hagen via ntg-context
  2021-10-11 15:49   ` Solved: Making metafun pictures fainter Gavin via ntg-context
@ 2021-10-12 12:33   ` Gavin via ntg-context
  1 sibling, 0 replies; 4+ messages in thread
From: Gavin via ntg-context @ 2021-10-12 12:33 UTC (permalink / raw)
  To: Hans Hagen; +Cc: Gavin, mailing list for ConTeXt users


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

Hi List,

Thanks, Hans, for your suggestion. In the end, I decided that I actually liked the silhouettes better than a faint version of the whole picture. Silhouettes clearly show the motion, but are far less visually distracting. In the figure below, the projectile motion’s are clear, including the cow’s constant angular velocity, but the final state still pops out.


I used “redecorated" to get the pictures with light, solid grays. Below is code for producing just the ball, if anyone wants to see the details. It includes a simple “shadow" macro that produces a shadow of any picture with an adjustable gray.

I’m having lots of metafun!
Gavin


\startMPinclusions
 picture ball;
 ball := image(
   fill fullcircle scaled 1cm
     withshademethod "circular"
     withshadecenter (.25,.25)
     withshadecolors (.8white, black);
   draw fullcircle scaled 1cm withpen pencircle scaled 0.8pt ;);
 vardef shadow(expr p, t) = 
   draw redecorated (draw p) withcolor t[background,0.8background];
 enddef; 
\stopMPinclusions

\startMPpage
 pair p;
 for i=0 upto 10:
   p := (i*cm/10, -((i-7.33)**2)*cm/7);
   shadow(ball shifted p, (i+1)/10) ;
 endfor
 draw ball shifted(1.1cm, -1.92cm) ;
\stopMPpage

[-- Attachment #1.2.1: Type: text/html, Size: 1120 bytes --]

[-- Attachment #1.2.2: Gracht.pdf --]
[-- Type: application/pdf, Size: 59371 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 2101 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] 4+ messages in thread

end of thread, other threads:[~2021-10-12 12:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11  4:30 Making metafun pictures fainter (shading, uncolored clash) Gavin via ntg-context
2021-10-11  8:53 ` Hans Hagen via ntg-context
2021-10-11 15:49   ` Solved: Making metafun pictures fainter Gavin via ntg-context
2021-10-12 12:33   ` Gavin via ntg-context

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