ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@xs4all.nl>
Subject: Re: Vector Brushes for MetaFun?
Date: Wed, 1 Sep 2021 14:06:36 +0200	[thread overview]
Message-ID: <21c38c0e-5b0c-b889-227a-ae3d01ccdd97@xs4all.nl> (raw)
In-Reply-To: <190845A1-FAC2-4C8C-8737-F966916B2CE1@fiee.net>

On 9/1/2021 12:48 PM, Henning Hraban Ramm via ntg-context wrote:
> Hi, since Jacob started the pony mode, here’s one I’d like to ride:
> 
> MetaPost pens are constant, i.e. they never change over the length of a path.
> 
> Commercial vector graphics apps have “vector brushes”, e.g. Adobe Fresco:
> https://helpx.adobe.com/fresco/using/vector-brushes.html
> The page nicely shows the necessary variables.
> 
> In Inkscape you can combine “brush images” like
> https://publicdomainvectors.org/en/free-clipart/Paintbrushes-for-Inkscape/86586.html
> with pen shapes:
> https://logosbynick.com/custom-brushes-in-inkscape/
> 
> This stretches the whole shape over the path – not perfect but good enough (and the same what e.g. “my” Affinity Designer does).
> (https://affinity.serif.com/designer/)
> 
> Is this possible with MetaFun, i.e. use a closed path and distort/stretch it along an open path?
> If, how?
you can try to 'reverse engineer the result' and see what is done by 
looking at the output

anyway, i guess it some mix of existing basics, as in

\starttext

\startMPcode
     path p ; p := fullcircle scaled 4cm ;
     for i=1 upto 10 :
         nodraw p xscaled (1 randomized .1) yscaled (1 randomized .1) ;
     endfor ;
     dodraw p xscaled (1 randomized .1) yscaled (1 randomized .1)
         withtransparency (1,.5) ;
\stopMPcode

\startMPcode
     path p ; p := fullcircle scaled 4cm ;
     for i=1 upto 10 :
         draw p xscaled (1 randomized .1) yscaled (1 randomized .1)
         withtransparency (1,.5) ;
     endfor ;
     draw p xscaled (1 randomized .1) yscaled (1 randomized .1)
         withtransparency (1,.5) ;
\stopMPcode

\startMPcode
     path p ; p :=
         (         unitcircle xscaled (5cm randomized 5mm) yscaled (4cm 
randomized 3mm)) --
         (reverse (unitcircle xscaled (5cm randomized 3mm) yscaled (4cm 
randomized 5mm))) -- cycle;
     draw (p)
%         withpattern image (fill fullcircle scaled 2mm withcolor 
"darkyellow" ;)
%         withpattern image (draw figure "mill.png" ;)
         withpattern image (draw figure "hacker.jpg" ;)
         withpatternscale (1/40,1/80)
     ;

\stopMPcode

\stoptext

so, fills, eofills, patterns and such

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
___________________________________________________________________________________

  reply	other threads:[~2021-09-01 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 10:48 Henning Hraban Ramm via ntg-context
2021-09-01 12:06 ` Hans Hagen via ntg-context [this message]
2021-09-01 12:52   ` Henning Hraban Ramm via ntg-context

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=21c38c0e-5b0c-b889-227a-ae3d01ccdd97@xs4all.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@xs4all.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).