ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gavin via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: shivshankar.dayal@gmail.com, Gavin <gavinpublic@icloud.com>
Subject: [NTG-context] Re: Status of Asymptote
Date: Sat, 30 Dec 2023 13:33:25 -0700	[thread overview]
Message-ID: <9AFB6603-C7F9-4335-89BA-768606484541@icloud.com> (raw)
In-Reply-To: <b2b8da4a-898f-45fa-8155-13f81cef8f5a@gmail.com>

Hi Shiv and Fabrice,

> On Dec 30, 2023, Shiv Shankar Dayal wrote:
> It would be nice to either support Metapost 3D or Asymptote.

> On Dec 6, 2021, Fabrice L wrote:
> I would be very interested to see an example of a Metafun drawing made with the help of LuaTeX to speed up some calculations.

I made a module that draws 3D globes with MetaPost and Lua. This was my first step toward drawing general projections. If anyone would like to join this project, I’d love some help. The globes module is only about 300 lines of code, and most of the challenge was hiding paths and parts of paths that are on the back side of the globe. Anybody could get up to speed pretty quickly. (I am completely new to both MetaPost and Lua, so I tried to be very clear in my coding.)

My goal is a drawing process which starts with Lua tables containing data in arbitrary coordinates. The data could be any number of dimensions, and need not be rectangular. (For the globes the data is latitude and longitude points on the countries' boundaries.) The tables could be from an outside source (like the geographic data) or it could be calculated in Lua (for graphing functions or doing simulations).

Lua does all of the calculations to project this data down to two dimensional, rectangular coordinates. Lua then passes these two dimensional points, or paths made from them, to MetaPost. MetaPost uses the points and paths to draw dots, curves and areas, to place labels, etc. The only transformation performed by MetaPost is the final scaling for drawing everything on the page.

You can find the globe module on GitHub:

https://github.com/GavinPolhemus/luageo

I am relatively new to Git as well, so have patience if you start commenting or contributing there. I’ll learn fastest if there are collaborators!

Gavin
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________

  reply	other threads:[~2023-12-30 20:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06  8:43 Alexandre Christe via ntg-context
2021-12-06 15:11 ` Gavin via ntg-context
2021-12-06 17:33   ` Fabrice L via ntg-context
2021-12-07  6:29 ` Aditya Mahajan via ntg-context
2021-12-07  8:42   ` Hans Hagen via ntg-context
2023-12-30 19:04     ` [NTG-context] " Shiv Shankar Dayal
2023-12-30 20:33       ` Gavin via ntg-context [this message]
2023-12-30 20:44       ` Alan Braslau via ntg-context
2023-12-30 21:48       ` Hans Hagen
2023-12-30 23:33       ` Aditya Mahajan
2024-01-03 11:39         ` Jeroen
2024-01-11  6:00           ` shivshankar.dayal

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=9AFB6603-C7F9-4335-89BA-768606484541@icloud.com \
    --to=ntg-context@ntg.nl \
    --cc=gavinpublic@icloud.com \
    --cc=shivshankar.dayal@gmail.com \
    /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).