ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Radius attribute and scaling in lmt_shade[ ]
@ 2022-01-06 15:57 Keith McKay via ntg-context
  2022-01-09 15:53 ` Keith McKay via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Keith McKay via ntg-context @ 2022-01-06 15:57 UTC (permalink / raw)
  To: ntg-context; +Cc: Keith McKay


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

Hi

In the code below you will see that I have created a closed path and 
performed scaling, and shading on the path with lmt_shade [ ]. I have 
noticed a few features which may or may not be bugs depending on whether 
scaled is applied to the path within the square brackets or outside.

1) Applying scaled to the path within the square brackets and 
incrementing the radius key I can see the shaded areas changing, however 
the first two shapes show incorrect scaling and have ragged edges.

2) When scaled is applied outside the square brackets all shapes are the 
same size and no ragged edges, however the shading is not showing 
correctly with increasing radius.

Am I missing something?

Best Wishes

Keith McKay

*******************MWE*****************

\setuppapersize[A4, landscape]

\starttext

\dorecurse{10}{

\startMPpage

StartPage;

width := 27; height := 18;

path r;

r := (0.25cm,0cm)--(0cm,1.5cm)..(0.25cm,1.75cm)..(0.5cm,1.5cm) -- cycle;

definecolor [ name = "MyColor1", r = uniformdeviate(1), g = 
uniformdeviate(1), b = uniformdeviate(1) ] ;

definecolor [ name = "MyColor2", r = uniformdeviate(1), g = 
uniformdeviate(1), b = uniformdeviate(1) ] ;

     for k = 0.5 step 0.25 until 2:

         draw lmt_shade [

             path = r ,

             direction = "up",

             alternative = "circular",

             radius = k*cm,

             colors = { "MyColor1", "MyColor2" },

             ] scaled 4.5 shifted((k *12)*cm,12*cm);

         draw lmt_shade [

             path = r scaled 4.5,

             direction = "up",

             alternative = "circular",

             radius = k*cm,

             colors = { "MyColor1", "MyColor2" },

             ] shifted((k *12)*cm,1cm);

endfor;

StopPage;

\stopMPpage

}

\stoptext

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

* Re: Radius attribute and scaling in lmt_shade[ ]
  2022-01-06 15:57 Radius attribute and scaling in lmt_shade[ ] Keith McKay via ntg-context
@ 2022-01-09 15:53 ` Keith McKay via ntg-context
  2022-01-09 22:26   ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Keith McKay via ntg-context @ 2022-01-09 15:53 UTC (permalink / raw)
  To: ntg-context; +Cc: Keith McKay


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

Since "a picture paints a thousand words", I attach a pdf showing the 
results of the execution of the code.

Are these bugs or... ?

Best Wishes

Keith

On 06/01/2022 15:57, Keith McKay wrote:
>
> Hi
>
> In the code below you will see that I have created a closed path and 
> performed scaling, and shading on the path with lmt_shade [ ]. I have 
> noticed a few features which may or may not be bugs depending on 
> whether scaled is applied to the path within the square brackets or 
> outside.
>
> 1) Applying scaled to the path within the square brackets and 
> incrementing the radius key I can see the shaded areas changing, 
> however the first two shapes show incorrect scaling and have ragged edges.
>
> 2) When scaled is applied outside the square brackets all shapes are 
> the same size and no ragged edges, however the shading is not showing 
> correctly with increasing radius.
>
> Am I missing something?
>
> Best Wishes
>
> Keith McKay
>
> *******************MWE*****************
>
> \setuppapersize[A4, landscape]
>
> \starttext
>
> \dorecurse{10}{
>
> \startMPpage
>
> StartPage;
>
> width := 27; height := 18;
>
> path r;
>
> r := (0.25cm,0cm)--(0cm,1.5cm)..(0.25cm,1.75cm)..(0.5cm,1.5cm) -- cycle;
>
> definecolor [ name = "MyColor1", r = uniformdeviate(1), g = 
> uniformdeviate(1), b = uniformdeviate(1) ] ;
>
> definecolor [ name = "MyColor2", r = uniformdeviate(1), g = 
> uniformdeviate(1), b = uniformdeviate(1) ] ;
>
>     for k = 0.5 step 0.25 until 2:
>
>         draw lmt_shade [
>
>             path = r ,
>
>             direction = "up",
>
>             alternative = "circular",
>
>             radius = k*cm,
>
>             colors = { "MyColor1", "MyColor2" },
>
>             ] scaled 4.5 shifted((k *12)*cm,12*cm);
>
>         draw lmt_shade [
>
>             path = r scaled 4.5,
>
>             direction = "up",
>
>             alternative = "circular",
>
>             radius = k*cm,
>
>             colors = { "MyColor1", "MyColor2" },
>
>             ] shifted((k *12)*cm,1cm);
>
> endfor;
>
> StopPage;
>
> \stopMPpage
>
> }
>
> \stoptext
>

[-- Attachment #1.2: Type: text/html, Size: 7485 bytes --]

[-- Attachment #2: RS4 copy.pdf --]
[-- Type: application/pdf, Size: 4654 bytes --]

[-- Attachment #3: 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: Radius attribute and scaling in lmt_shade[ ]
  2022-01-09 15:53 ` Keith McKay via ntg-context
@ 2022-01-09 22:26   ` Hans Hagen via ntg-context
  2022-01-12 11:24     ` Keith McKay via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen via ntg-context @ 2022-01-09 22:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen, Keith McKay

On 1/9/2022 4:53 PM, Keith McKay via ntg-context wrote:
> Since "a picture paints a thousand words", I attach a pdf showing the 
> results of the execution of the code.
> 
> Are these bugs or... ?
more interplay between parameters ...

             draw lmt_shade [
                 trace       = true,
                 path        = r shifted - center r,
                 direction   = "up",
                 alternative = "circular",
                 radius      = k*cm,
                 colors      = { "MyColor1", "MyColor2" },
             ] scaled 4 shifted((k *12)*cm,12*cm);



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

* Re: Radius attribute and scaling in lmt_shade[ ]
  2022-01-09 22:26   ` Hans Hagen via ntg-context
@ 2022-01-12 11:24     ` Keith McKay via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: Keith McKay via ntg-context @ 2022-01-12 11:24 UTC (permalink / raw)
  To: Hans Hagen; +Cc: Keith McKay, mailing list for ConTeXt users


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

Thanks Hans. Something else I've learned.
Best Wishes
Keith


On Sun, 9 Jan 2022, 22:26 Hans Hagen, <j.hagen@xs4all.nl> wrote:

> On 1/9/2022 4:53 PM, Keith McKay via ntg-context wrote:
> > Since "a picture paints a thousand words", I attach a pdf showing the
> > results of the execution of the code.
> >
> > Are these bugs or... ?
> more interplay between parameters ...
>
>              draw lmt_shade [
>                  trace       = true,
>                  path        = r shifted - center r,
>                  direction   = "up",
>                  alternative = "circular",
>                  radius      = k*cm,
>                  colors      = { "MyColor1", "MyColor2" },
>              ] scaled 4 shifted((k *12)*cm,12*cm);
>
>
>
> -----------------------------------------------------------------
>                                            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 #1.2: Type: text/html, Size: 1860 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:[~2022-01-12 11:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-06 15:57 Radius attribute and scaling in lmt_shade[ ] Keith McKay via ntg-context
2022-01-09 15:53 ` Keith McKay via ntg-context
2022-01-09 22:26   ` Hans Hagen via ntg-context
2022-01-12 11:24     ` Keith McKay 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).