Re: Coons and Tensor-product patch mesh shading in MetaPost

Florent Michel <[email protected]> Wed, 8 Jul 2026 11:21:44 +0100
Newsgroups gmane.comp.tex.context
Message-ID <CALOhoeJ-353UgU1oLfNkZawjmcLnbdU34O3p1RjOW0MdXRXRfg@mail.gmail.com>
Hi Hans,

To be honest, I can't think of a use-case that would justify the work of
implementing these shadings if they are not already there. I am not able to
share the specific example I'm working on, but the idea is to draw a
surface plot with neater interpolation than, say, a linear shading can
provide with a relatively small number of patches (see the example ‘A Coons
patch’ for an example with a single patch
https://tikz.dev/pgfplots/libs-patchplots).

Nothing that can't be achieved with existing tools, though, e.g. MetaPost
with linear / radial shadings and a finer sub-division in patches.

Cheers,
Florent

Le mer. 8 juil. 2026 à 09:32, Hans Hagen <[email protected]> a écrit :

> On 7/8/2026 9:42 AM, Florent Michel wrote:
> > Hi,
> >
> > Is there a way to fill a closed path with Coons or Tensor-product
> > shading in MetaPost/MetaFun?
> >
> > Apparently they are implemented in luamplib (https://mirrors.mit.edu/
> > CTAN/macros/luatex/generic/luamplib/luamplib.pdf <https://
> > mirrors.mit.edu/CTAN/macros/luatex/generic/luamplib/luamplib.pdf> ; see
> > sections 1.2.20 and 1.2.21), but unless I am missing something not in
> > the versions of MetaPost/MetaFun in the LMTX distribution, or at least
> > not in the way described in the luamplib manual.
> >
> > (If I understand correctly, luamplib intercepts the relevant keywords in
> > Lua instead of passing them to MetaPost, which could explain the
> > difference. Not sure my understanding is correct, though.)
> >
> > One alternative is to use PGFPlots for figures that require these
> > shadings; but I'm wondering if there is a way to use them while
> > benefiting from the close integration of MetaFun with LMTX.
>
> what is a realistic use case, apart from showing that it can be done and
> adding a lot of code
>
> these are somewhat special shading tricks that date from ps times
>
> what y kind of graphic (PGFPlots) do you have in mind ? example?
>
> 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 : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________