ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Marc van Dongen <dongen@cs.ucc.ie>
Subject: MetaFun
Date: Mon, 11 Dec 2000 13:56:33 +0000	[thread overview]
Message-ID: <20001211135633.R1834@cs.ucc.ie> (raw)

Hello,

This time no questions.
I hope some people will enjoy the metafun appended
below. I'm sure it could have done a bit more
elegantly, but this does the trick as well. (See
also: htpp://www.cs.ucc.ie/~dongen/xmas.pdf (55020 bytes).

In case some people are wondering; I did part of
the picture in xfig first and then used the
coordinates to write the metapost code. If people
know of better (more clever) ways of doing this
then I would be delighted to find out.

Regards,

Marc van Dongen
-- 
     Marc van Dongen, CS Dept | phone:  +353 21 4903578
University College Cork, NUIC | Fax:    +353 21 4903113
  College Road, Cork, Ireland | Email: dongen@cs.ucc.ie
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Escher: drawing 87
% Ref: Doris Schattschneider,
%      M.C.~Escher {\em Visions of Symmetry},
%      ISBN: 0-7167-2126-0

beginfig(1);
  pair p[], xshift, yshift, origin, offset;
  path line[], bird, drawing;
  color WHITE, YELLOW, GREY, colour;
  YELLOW  = 0.97(1,1,0.8);
  WHITE  = (1,1,1);
  GREY   = 0.90YELLOW;
  width  = 279.4mm;
  height = 215.9mm;
  s := 0.045;
  %
  p1  = (750,8000-4950);
  p2  = (1050,8000-4950);
  p3  = (2100,8000-4800);
  p4  = (2925,8000-4650);
  p5  = (4050,8000-5100);
  p6  = (4050,8000-5550);
  p7  = (3750,8000-6075);
  p8  = (3150,8000-6900);
  p9  = (3075,8000-7500);
  p10 = (3525,8000-7950);
  p11 = (4275,8000-8775);
  p12 = (5400,8000-9300);
  p13 = (4725,8000-8550);
  p14 = (4275,8000-7725);
  p15 = (4875,8000-8325);
  p16 = (5550,8000-8700);
  p17 = (5100,8000-7950);
  p18 = (4800,8000-7125);
  p19 = (5400,8000-7725);
  p20 = (6150,8000-8100);
  p21 = (5550,8000-7275);
  p22 = (5250,8000-6375);
  p23 = (5850,8000-7050);
  p24 = (6600,8000-7500);
  p25 = (6075,8000-6675);
  p26 = (5700,8000-5775);
  p27 = (6975,8000-7125);
  p28 = (8625,8000-7950);
  p29 = (7875,8000-7350);
  p30 = (7275,8000-6750);
  p31 = (8175,8000-7200);
  p32 = (9150,8000-7425);
  p33 = (8325,8000-6975);
  p34 = (7725,8000-6375);
  p35 = (8550,8000-6750);
  p36 = (9525,8000-6825);
  p37 = (8625,8000-6450);
  p38 = (8100,8000-6000);
  p39 = (9000,8000-6300);
  p40 = (9975,8000-6300);
  p41 = (9075,8000-6000);
  p42 = (8400,8000-5550);
  p43 = (9525,8000-5925);
  p44 = (10425,8000-5925);
  p45 = (9300,8000-5550);
  p46 = (8250,8000-5100);
  p47 = (7275,8000-4875);
  p48 = (6300,8000-4800);
  p49 = (7275,8000-4500);
  p50 = (8400,8000-4500);
  p51 = (7500,8000-4050);
  p52 = (6825,8000-3900);
  p53 = (7800,8000-3825);
  p54 = (8700,8000-3975);
  p55 = (7875,8000-3375);
  p56 = (7050,8000-3075);
  p57 = (8175,8000-3150);
  p58 = (8925,8000-3450);
  p59 = (8175,8000-2775);
  p60 = (7350,8000-2400);
  p61 = (8250,8000-2475);
  p62 = (9225,8000-3000);
  p63 = (8850,8000-2100);
  p64 = (8400,8000-1650);
  p65 = (9300,8000-1200);
  p66 = (8100,8000-1875);
  p67 = (7200,8000-1575);
  p68 = (5850,8000-1500);
  p69 = (5625,8000-2025);
  p70 = (5475,8000-2400);
  p71 = (5100,8000-3000);
  p72 = (4650,8000-3750);
  p73 = (3525,8000-3450);
  p74 = (2550,8000-3075);
  p75 = (2325,8000-3375);
  p76 = (2100,8000-3600);
  p77 = (1425,8000-4050);
  p78 = (975,8000-4350);
  p79 = (525,8000-4875);
  p80 = (1840,8000-4600);
  p81 = (2375,8000-4550);
  p82 = (2475,8000-3975);
  line1  = p79..p1..p2..p3..p4..p5;
  line2  = p9..p10..p11..p12--
           p12..p13..p14--
           p14..p15..p16--
           p16..p17..p18--
           p18..p19..p20--
           p20..p21..p22--
           p22..p23..p24--
           p24..p25..p26--
           p26..p27..p28--
           p28..p29..p30--
           p30..p31..p32--
           p32..p33..p34--
           p34..p35..p36--
           p36..p37..p38--
           p38..p39..p40--
           p40..p41..p42--
           p42..p43..p44--
           p44..p45..p46--
           p46..p47..p48--
           p48..p49..p50--
           p50..p51..p52--
           p52..p53..p54--
           p54..p55..p56--
           p56..p57..p58--
           p58..p59..p60--
           p60..p61..p62--
           p62..p66..p67..p68;
  % beak (A comment at the right place does miracles.)
  line3  = p62..p63..p64;
  line4  = p72..p73..p74;
  % beak (Another carfuly positioned comment.)
  line5  = p79..p80..p81;
  line6  = p5..p6..p7..p8..p9;
  line7  = p74..p75..p76..p77..p78..p78..p79;
  line8  = p68..p69..p70..p71..p72;
  xshift = s*(p28 + p62 - p9 - p74);
  yshift = s*(p62 - p9);
  bird   = line1--line6--line2--line8--line4--line7--cycle;
  colour = YELLOW;
  fill (0,0)--(width,0)--(width,height)--(0,height)--cycle
       withcolor WHITE;
  for x=-1 upto 1:
    for y=-1 upto 3:
      offset := x*xshift + y*yshift;
      fill bird scaled s shifted offset withcolor YELLOW;
      pickup pencircle scaled 2pt;
      for i=1 upto 5:
        draw line[i] scaled s
             shifted offset withcolor GREY;
      endfor;
      pickup pencircle scaled 2pt;
      fill (-150s,0)..(0,150s)..(150s,0)..cycle shifted (s*p65+offset) withcolor WHITE;
      fill (-60s,0)..(0,60s)..(60s,0)..cycle shifted (s*p65+offset) withcolor GREY;
      draw (-150s,0)..(0,150s)..(150s,0)..cycle shifted (s*p65+offset) withcolor GREY;
      fill (-150s,0)..(0,150s)..(150s,0)..cycle shifted (s*p82+offset) withcolor WHITE;
      fill (-60s,0)..(0,60s)..(60s,0)..cycle shifted (s*p82+offset) withcolor GREY;
      draw (-150s,0)..(0,150s)..(150s,0)..cycle shifted (s*p82+offset) withcolor GREY;
      pickup pencircle xscaled 6pt;
      for i=6 upto 8:
        draw line[i] scaled s shifted offset withcolor GREY;
      endfor;
    endfor;
  endfor;
  pickup pencircle scaled 1;
  draw (0,0)--(width,0)--(width,height)--(0,height)--cycle
       withcolor WHITE;
  drawing = unitsquare xscaled width yscaled height;
  clip currentpicture to drawing;
  draw drawing;
endfig;


             reply	other threads:[~2000-12-11 13:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-11 13:56 Marc van Dongen [this message]
2000-12-12 15:35 ` MetaFun Ed L Cashin
2000-12-12 15:48   ` MetaFun Marc van Dongen
2000-12-12 16:18     ` MetaFun Ed L Cashin
  -- strict thread matches above, loose matches on Subject: below --
2021-02-20 16:27 metafun Hans Hagen
2021-02-20 17:43 ` metafun Otared Kavian
2021-02-20 21:19   ` metafun Hans Hagen
2010-10-23 19:34 metafun Herbert Voss
2010-10-23 22:14 ` metafun Aditya Mahajan
2016-03-24 17:23   ` metafun Piotr Kopszak
2016-03-24 17:24     ` metafun Piotr Kopszak
2016-03-24 18:14       ` metafun luigi scarso
2016-03-24 18:22       ` metafun Hans Hagen
2010-10-20 12:03 metafun Hans Hagen
2010-10-20 12:11 ` metafun Mojca Miklavec
2010-10-20 12:23   ` metafun Martin Schröder
2010-10-20 12:49   ` metafun Vedran Miletić
2010-10-20 12:17 ` metafun Taco Hoekwater
2010-10-20 22:42 ` metafun Kevin D. Robbins
2010-10-21  7:10   ` metafun Hans Hagen
2010-10-22 14:06   ` metafun Taco Hoekwater
2010-10-22 14:20     ` metafun Hans Hagen
2010-10-22 14:22       ` metafun Taco Hoekwater
2010-10-22 15:29         ` metafun Otared Kavian
2010-10-22 16:09         ` metafun Kevin D. Robbins
2010-10-22 15:12       ` metafun Wolfgang Schuster
2010-10-22 15:28         ` metafun Hans Hagen
2010-10-23 10:49     ` metafun Alan BRASLAU
2004-06-23 15:03 metafun jimarin
     [not found] ` <m2eko6gvg m.fsf@levana.de>
2004-06-23 15:11 ` metafun Patrick Gundlach
2004-06-23 15:26   ` metafun jimarin
2004-06-23 15:45     ` metafun Patrick Gundlach
2004-06-23 15:55       ` metafun jimarin
2004-06-23 16:03         ` metafun Patrick Gundlach
2004-06-24  8:13 ` metafun Hans Hagen
2001-09-16  9:13 metafun Hervé Rouault
2001-03-21 14:23 metafun guravage m.a.
2001-03-21 15:30 ` metafun Hans Hagen
2000-09-12 10:26 metafun Hans Hagen
2000-09-12 13:41 ` metafun Robert F. Beeger
     [not found] ` <4.3.2.7.0.20000912152319.00b2ae30@rzdspc1.informatik.uni-h amburg.de>
2000-09-12 15:06   ` metafun Hans Hagen
2000-09-13  7:39 ` metafun Michal Kvasnicka
2000-07-17  0:45 (no) hyphenation Hans Hagen
2000-07-19  7:13 ` Hans Hagen
2000-07-24 20:20   ` metafun Hraban

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=20001211135633.R1834@cs.ucc.ie \
    --to=dongen@cs.ucc.ie \
    /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).