ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Mikael P. Sundqvist" <mickep@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: graphics
Date: Fri, 7 Dec 2018 09:06:03 +0100	[thread overview]
Message-ID: <CAHy-LL-5bkb7CWeQDhhZbHcnJ17RxZi225y6rCLouNiZxu80zw@mail.gmail.com> (raw)
In-Reply-To: <807bc4e1-bd8f-d874-30c1-508f3a5ac4e3@xs4all.nl>

On Tue, Dec 4, 2018 at 6:03 PM Hans Hagen <j.hagen@xs4all.nl> wrote:
>
> Hi,
>
> As most mechanism are reasonable okay now we can look into what future
> versions of ConteXt should provide in terms of functionality. The
> (luatex) engine is also more of less finished or at least stable in
> terms of functionality.
>
> One possible area of further development is graphics so I'd like to know
> if there are (reasonable) demands for more graphics support using
> metapost. Alan and I are on-and-off working on some extensions and one
> of the things we discuss is visualization of data. The question is of
> course what should be done in the lua/mp/tex combination and what
> externally but the combination has some advantages. There has been
> presentations and discussions at the last meeting and graphics is always
> a nice topic, and also kind of rewarding in terms of development.
>
> Of course other demands can be formulated too, but these then need to
> come with well defined descriptions (or mockup examples).
>
> 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
> ___________________________________________________________________________________

Hi,

I don't know if what I describe below is along the lines you ask for,
but here comes two wishes:

1) Full support for drawing implicit curve plots. For some curves,
like a lemniscate
(https://en.wikipedia.org/wiki/Lemniscate_of_Bernoulli) one can easily
succeed by using a parametrisation, but sometimes one end up with
equations and to find a parametrisation might be difficult (not to say
impossible). I asked about this a while ago and got a simple solution
working for that curve, but I think a general working solution would
be neat. I think the bernoulli lemniscate could be a good test curve,
since it intersect itself.

2) Support for transforming images in a more general way. With the
zscaled, slanted, ... we are able to transform any object in an affine
way. It would be nice to be able to transform any object in a more
general way (i.e. by a mapping defined by the user). The example code
below shows what happens in the complex plane with a grid and a curve
when the mapping z to z^2 is applied. Perhaps I am missing something,
but I'm not able to apply this to a piece of text for example, or to
apply it directly to a picture. Instead, I have to loop over all
separate paths. I think the ideal would be to have a "ftransformed"
(or with some other name), and then just define a function (as fun in
the example below), and then be able to do "draw X ftransformed fun;",
where X is some(any?) general object. Is that doable?

/Mikael

%%% Example code
\starttext
\startMPpage[offset=3bp]
u:=3cm;

def fun(expr x,y) = (x**2-y**2,2*x*y) enddef;

def sq(expr kv,s) =
fun(xpart point 0 along kv,ypart point 0 along kv)
  for i=s step s until 1: -- fun(xpart point i along kv,ypart point i
along kv) endfor
enddef;

path rp;
rp = (0,-0.8)..(0.7,-0.2)..(0.7,0.6){dir
150}..(-0.7,0.4)..(-0.4,-0.5){dir 0}..cycle;


% Draw the original grid and the path
for i = -1 step 1/10 until 1+eps:
 for j = -1 step 1/10 until 1+eps:
  draw ((i,-1)--(i,1)) scaled u;
  draw ((-1,j)--(1,j)) scaled u;
 endfor;
endfor;

draw rp scaled u withcolor darkred withpen pencircle scaled 2bp;

% Draw the grid and curve after map z->z^2
draw image(
for i = -1 step 1/10 until 1+eps:
 for j = 0 step 1/10 until 1+eps:
  draw (sq(((i,0)--(i,1)),1/100)) scaled u;
  draw (sq(((-1,j)--(1,j)),1/100)) scaled u;
 endfor;
endfor;
draw (sq(rp,1/100)) scaled u withcolor darkred withpen pencircle scaled 2bp;
) xshifted 2.5u;

\stopMPpage
\stoptext
___________________________________________________________________________________
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:[~2018-12-07  8:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 17:03 graphics Hans Hagen
2018-12-04 18:54 ` graphics Alan Braslau
2018-12-05  9:02   ` graphics Taco Hoekwater
2018-12-05 12:59     ` graphics Hans Hagen
2018-12-05 15:24       ` graphics Alan Braslau
2018-12-06  7:31   ` graphics Procházka Lukáš Ing.
2018-12-05  9:14 ` graphics Henri Menke
2018-12-05  9:22   ` graphics luigi scarso
2018-12-05 12:37   ` graphics Hans Hagen
2018-12-05 12:55     ` graphics luigi scarso
2018-12-07  8:06 ` Mikael P. Sundqvist [this message]
2018-12-07 12:20   ` graphics luigi scarso
2018-12-07 15:15   ` graphics Alan Braslau
2018-12-08  8:31     ` graphics Mikael P. Sundqvist
2018-12-08 15:15       ` graphics Alan Braslau
2018-12-12 19:42         ` graphics Mikael P. Sundqvist
2018-12-12 19:56           ` graphics Alan Braslau
2018-12-12 20:02             ` graphics Henri Menke
2018-12-12 20:12               ` graphics Alan Braslau
2018-12-12 21:03                 ` graphics Henri Menke
2018-12-12 21:39                   ` graphics Alan Braslau
2018-12-12 23:56                     ` graphics Henri Menke
2018-12-12 20:13               ` graphics Mikael P. Sundqvist
2018-12-13 13:32                 ` graphics Otared Kavian
2018-12-13 15:44                   ` graphics Alan Braslau
2018-12-13 16:07                     ` graphics luigi scarso
2018-12-13 20:33                       ` graphics Henri Menke
2018-12-12 13:51 ` graphics Mathias Schickel
2018-12-12 18:36   ` graphics Alan Braslau

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=CAHy-LL-5bkb7CWeQDhhZbHcnJ17RxZi225y6rCLouNiZxu80zw@mail.gmail.com \
    --to=mickep@gmail.com \
    --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).