ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Aditya Mahajan <adityam@umich.edu>
Subject: Re: Fuzzy lines
Date: Fri, 14 May 2021 12:05:01 +0200	[thread overview]
Message-ID: <17d1bde0-6da4-4b1e-7675-ca456c51e3c8@xs4all.nl> (raw)
In-Reply-To: <nycvar.YAK.7.78.908.2105131219040.845768@nqv-guvaxcnq>

On 5/13/2021 6:36 PM, Aditya Mahajan wrote:
> On Thu, 13 May 2021, Henning Hraban Ramm wrote:
> 
>>
>>> Am 11.05.2021 um 18:02 schrieb Aditya Mahajan <adityam@umich.edu>:
>>>
>>> Look at this old code on how hide such code behind a macro to have a clean interface:
>>>
>>> https://github.com/adityam/mp-sketch/blob/master/mp-sketch.mp
>>
>> Hi Aditya,
>> I’m trying to include my additions into your code, but it doesn’t work.
>>
>>
>> numeric sketch_amount; sketch_amount := 3bp;
>> numeric sketch_passes; sketch_passes := 5;
>>
>> def sketchdraw expr p =
>>    do_sketchdraw(p if (path p): randomized sketch_amount fi)
>> enddef;
>>
>> def do_sketchdraw(expr p) text t =
>>      normaldraw p t ;
>> enddef;
>>
>>
>> Now I want to draw that path several times.
>>
>> If I understand it right, I can’t put that into "sketchdraw" because that leaves the end open for path additions like "withcolor".
>>
>> But it also doesn’t work in "do_sketchdraw"; I thought it might like this:
> 
> A slightly different approach is needed. See attached. I also added a bit a error protection in case someone sets sketch_passes to be negative by mistake.
> 
> It may be interesting to rewrite these macros using the new key-value interface for metapost, so that something like this works:
> 
> \sketchdraw[amount=3bp, passes=5, transparency=yes] fullsquare scaled 1cm withcolor red;
one resembles present-weird-001.pdf (in the doc tree) ... it was from 
the times one could rely on acrobat to jump around a large page ... i 
used that one for a presentation about mathml (decades ago) ... in times 
that the main question one got was "why use something else than latex 
for math" or "why use tex if you don't do math" which put context in a 
weird spot (but also permitted to come up with weird presentation styles 
that didn't look too tex)

Hans


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

  parent reply	other threads:[~2021-05-14 10:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 10:58 Henning Hraban Ramm
2021-05-11 11:30 ` Mikael Sundqvist
2021-05-11 12:33   ` Henning Hraban Ramm
2021-05-11 12:56   ` Jairo A. del Rio
2021-05-11 16:02     ` Aditya Mahajan
2021-05-12 18:07       ` Henning Hraban Ramm
2021-05-13 13:08       ` Henning Hraban Ramm
2021-05-13 16:36         ` Aditya Mahajan
2021-05-13 16:55           ` Henning Hraban Ramm
2021-05-13 17:17             ` Aditya Mahajan
2021-05-13 18:02               ` Henning Hraban Ramm
2021-05-13 18:26                 ` Thomas A. Schmitz
2021-05-13 19:42                   ` Henning Hraban Ramm
2021-05-14 15:08                     ` Thomas A. Schmitz
2021-05-13 22:39                 ` Aditya Mahajan
2021-05-14  9:43                   ` Hans Hagen
2021-05-14 20:33                   ` Henning Hraban Ramm
2021-09-03 16:04                 ` Henning Hraban Ramm via ntg-context
2022-01-21 18:00                   ` Iterating over MP paths (was: Fuzzy lines) Henning Hraban Ramm via ntg-context
2021-05-14 10:05           ` Hans Hagen [this message]
2021-05-12 17:55     ` Fuzzy lines Henning Hraban Ramm
     [not found]       ` <CAKyqqaaosis=BjOD_mArY5VM+bzcj-ar4uMtnt8SRJ2WLL9ykw@mail.gmail.com>
2021-05-12 21:21         ` Fwd: " Jairo A. del Rio
2021-05-13 13:23           ` Henning Hraban Ramm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17d1bde0-6da4-4b1e-7675-ca456c51e3c8@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).