From: Henning Hraban Ramm <texml@fiee.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Fuzzy lines
Date: Wed, 12 May 2021 20:07:41 +0200 [thread overview]
Message-ID: <92120216-E4E5-48B7-9B64-B47D9F553F4C@fiee.net> (raw)
In-Reply-To: <nycvar.YAK.7.78.908.2105111156370.845768@nqv-guvaxcnq>
Hi Aditya,
thanks for the code (that also Mikael pointed to)!
> 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
I came up with this simple cover layout:
input mp-sketch;
beginfig(1)
color darkblue ; darkblue := (40/255,67/255,117/255) ;
pen pillpen ; pillpen := makepen ((-1bp,-0.5bp)--(1bp,-0.5bp)..(1bp,0.5bp)--(-1bp,0.5bp)..cycle) ;
pickup pillpen xyscaled 3bp ;
sketchypaths;
sketch_amount := 5bp;
% insert some extra points to add fuzzyness - automate?
% path one ; one := (-3mm,249mm) -- (185mm,249mm) -- (185mm,300mm) ; % links-oben
path onep ; onep := (-3mm,249mm) .. (25.5mm,249mm) .. (150mm,249mm) -- (185mm,249mm) -- (185mm,300mm) ; % links-oben
% path two ; two := (25.5mm,-3mm) -- (25.5mm,167mm) -- (213mm,167mm) ; % unten-rechts
path twop ; twop := (25.5mm,-3mm) .. (25.5mm,25.5mm) .. (25.5mm,120mm) -- (25.5mm,167mm) .. (120mm,167mm) -- (213mm,167mm) ; % unten-rechts
% draw paths several times - automate?
numeric max ; max := 5;
for i=0 upto max :
draw onep withcolor darkblue withtransparency ("multiply", 1/max) ;
draw twop withcolor darkblue withtransparency ("multiply", 1/max) ;
endfor
naturalizepaths;
% draw crop box (paper size)
pickup pencircle xyscaled 0.5bp;
draw (0,0)--(0,297mm)--(210mm,297mm)--(210mm,0)--cycle withcolor magenta;
endfig
This begins to look like I imagined, even if I’d like to add some noise (pattern, shading).
Jairo’s suggestion looks too regular.
(Finally, I’ll overlay the whole page with a transparent image for structure.)
As you see, both paths use only three points, but I added some more to add fuzzyness.
Also they get drawn several times with transparency to get a irregular width and some blur.
I’m quite sure this could be added to your macro, but I’m still too inexperienced with Metapost.
Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2021-05-12 18:07 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 [this message]
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 ` Fuzzy lines Hans Hagen
2021-05-12 17:55 ` 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=92120216-E4E5-48B7-9B64-B47D9F553F4C@fiee.net \
--to=texml@fiee.net \
--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).