From - Thu Jul  5 14:28:07 2001
Return-Path: <ktarik@Bilkent.EDU.TR>
Received: from firat.bcc.bilkent.edu.tr (firat.bcc.bilkent.edu.tr
    [139.179.10.13]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f65CRsb02073 for <metafont@ens.fr>; Thu, 5 Jul 2001 14:27:55 +0200 (CEST)
Received: from sumak (ktarik@sumak [139.179.30.9]) by
    firat.bcc.bilkent.edu.tr (8.11.4/8.11.4) with ESMTP id f65CR4J07390 for
    <metafont@ens.fr>; Thu, 5 Jul 2001 15:29:34 +0300 (EET DST)
Date: Thu, 5 Jul 2001 15:39:17 +0300 (EET DST)
From: Tarik Kara <ktarik@Bilkent.EDU.TR>
X-Sender: ktarik@sumak
To: metafont@ens.fr
Message-Id: <Pine.GSO.4.05.10107051534230.27323-100000@sumak>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 465
Precedence: list
Subject: [metafont] [MetaObj question] tree with colored edges

Denis this is probabily a question just for you.
Is it possible to draw a tree such that some of the edges (not necessarily
a subtree) are of different color. Thanks 

Tar{\i}k


From - Fri Jul  6 15:51:06 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f66Dotb20091 for
    <metafont@ens.fr>; Fri, 6 Jul 2001 15:50:55 +0200 (CEST)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id PAA17170;
    Fri, 6 Jul 2001 15:50:53 +0200 (MET DST)
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id PAA24308; Fri, 6 Jul 2001 15:50:53 +0200
    (MET DST)
Date: Fri, 6 Jul 2001 15:50:53 +0200
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
To: Tarik Kara <ktarik@Bilkent.EDU.TR>
Cc: metafont@ens.fr
Subject: Re: [metafont] [MetaObj question] tree with colored edges
Message-Id: <20010706155053.A8676@bar.loria.fr>
References: <Pine.GSO.4.05.10107051534230.27323-100000@sumak>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.1i
In-Reply-To: <Pine.GSO.4.05.10107051534230.27323-100000@sumak>;
    from ktarik@Bilkent.EDU.TR on Thu, Jul 05, 2001 at 03:39:17PM +0300
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 466
Precedence: list

On Thu, Jul 05, 2001 at 03:39:17PM +0300, Tarik Kara wrote:
> Denis this is probabily a question just for you.
> Is it possible to draw a tree such that some of the edges (not necessarily
> a subtree) are of different color. Thanks 

Yes, you first use a color for all edges (with the "linecolor" option,
or the default color if you give no option)
and then you can change individual edges with setTreeEdge.
There are two examples on page 105 of the manual:
 
  setTreeEdge(Obj(t))(1)(linestyle)("dashed evenly"); 
  setTreeEdge(treepos(Obj(t))(2))(1)(linestyle)("dashed evenly");

You can write

  setTreeEdge(Obj(t))(2)(linecolor)(red);
  setTreeEdge(Obj(t))(3)(linecolor)((1,1,0));

(these examples assumes that `t' is a numeric, as returned by T_, or _T;
if you use newTree, you can just put the name of the object,
and `Obj' should not be used)

The first argument is an object, the second is an edge number,
the third is an attribute, the fourth is the value of the attribute.

Denis Roegel


From - Fri Jul  6 17:57:36 2001
Return-Path: <ktarik@Bilkent.EDU.TR>
Received: from firat.bcc.bilkent.edu.tr (firat.bcc.bilkent.edu.tr
    [139.179.10.13]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f66FvJb33449 for <metafont@ens.fr>; Fri, 6 Jul 2001 17:57:20 +0200 (CEST)
Received: from sumak (sumak [139.179.30.9]) by firat.bcc.bilkent.edu.tr
    (8.11.4/8.11.4) with ESMTP id f66Fx5c07680; Fri, 6 Jul 2001 18:59:05 +0300
    (EET DST)
Date: Fri, 6 Jul 2001 19:11:12 +0300 (EET DST)
From: Tarik Kara <ktarik@Bilkent.EDU.TR>
X-Sender: ktarik@sumak
To: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Cc: metafont@ens.fr
Subject: Re: [metafont] [MetaObj question] tree with colored edges
In-Reply-To: <20010706155053.A8676@bar.loria.fr>
Message-Id: <Pine.GSO.4.05.10107061907240.38-100000@sumak>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 467
Precedence: list

Thanks Denis. Sorry I did not notice the examples on page 105. I was
seaching the document for the word "color". I should have been more
careful. Thanks again for the time you spend for writing such a nice
package and answering my questions.

Tar{\i}k
On Fri, 6 Jul 2001, Denis B. Roegel wrote:

> On Thu, Jul 05, 2001 at 03:39:17PM +0300, Tarik Kara wrote:
> > Denis this is probabily a question just for you.
> > Is it possible to draw a tree such that some of the edges (not necessarily
> > a subtree) are of different color. Thanks 
> 
> Yes, you first use a color for all edges (with the "linecolor" option,
> or the default color if you give no option)
> and then you can change individual edges with setTreeEdge.
> There are two examples on page 105 of the manual:
>  
>   setTreeEdge(Obj(t))(1)(linestyle)("dashed evenly"); 
>   setTreeEdge(treepos(Obj(t))(2))(1)(linestyle)("dashed evenly");
> 
> You can write
> 
>   setTreeEdge(Obj(t))(2)(linecolor)(red);
>   setTreeEdge(Obj(t))(3)(linecolor)((1,1,0));
> 
> (these examples assumes that `t' is a numeric, as returned by T_, or _T;
> if you use newTree, you can just put the name of the object,
> and `Obj' should not be used)
> 
> The first argument is an object, the second is an edge number,
> the third is an attribute, the fourth is the value of the attribute.
> 
> Denis Roegel
> 


From - Sun Jul 22 11:26:02 2001
Return-Path: <smidi@gmx.at>
Received: from smtp1.utaiop.at (mx2.utanet.at [195.70.253.46]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f6M9Ppm49596 for
    <metafont@ens.fr>; Sun, 22 Jul 2001 11:25:51 +0200 (CEST)
Received: from multi1.utaiop.at ([10.70.253.35]) by smtp1.utaiop.at
    (Netscape Messaging Server 4.15 smtp1 Jun 13 2001 14:38:13) with ESMTP id
    GGVBIX0B.R1T for <metafont@ens.fr>; Sun, 22 Jul 2001 11:25:45 +0200
Received: from gmx.at ([212.152.219.82]) by multi1.utaiop.at (Netscape
    Messaging Server 4.15 multi1 Jun 13 2001 14:38:13) with ESMTP id
    GGVBEQ01.52B for <metafont@ens.fr>; Sun, 22 Jul 2001 11:23:14 +0200
Message-Id: <3B5A9BA2.19D1B899@gmx.at>
Date: Sun, 22 Jul 2001 11:23:46 +0200
From: Roland Smiderkal <smidi@gmx.at>
X-Mailer: Mozilla 4.7 [de] (Win98; I)
X-Accept-Language: de
Mime-Version: 1.0
To: "metafont@ens.fr" <metafont@ens.fr>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 468
Precedence: list
Subject: [metafont] Global static variables in MetaPost?

Hi there!

In C there are so-called global static variables. These can be accessed
by all functions inside the same source file, but are invisible to
functions from other source files.

Is there something similar in MetaPost? Or any workaround?

I have a set of macros which share some information stored in global
variables and I want to avoid conflicts with other macros.

Regards
Roland Smiderkal


From - Tue Jul 24 21:52:58 2001
Return-Path: <walter.kehowski@gcmail.maricopa.edu>
Received: from email2.dist.maricopa.edu (email2.dist.maricopa.edu
    [140.198.8.39]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f6OJqim63594 for <metafont@ens.fr>; Tue, 24 Jul 2001 21:52:44 +0200 (CEST)
Received: from gcmail.maricopa.edu (140.198.35.44) by
    email2.dist.maricopa.edu (5.5.034) (authenticated as
    walter.kehowski@gcmail.maricopa.edu) id 3B5D9DEA00000B74 for
    metafont@ens.fr; Tue, 24 Jul 2001 12:52:29 -0700
Message-Id: <3B5DD1B6.2B6EA64A@gcmail.maricopa.edu>
Date: Tue, 24 Jul 2001 12:51:18 -0700
From: walter kehowski <walter.kehowski@gcmail.maricopa.edu>
Organization: Glendale Community College
X-Mailer: Mozilla 4.72 [en] (Win95; U)
X-Accept-Language: en
Mime-Version: 1.0
To: "metafont@ens.fr" <metafont@ens.fr>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 469
Precedence: list
Subject: [metafont] metapost: graph of sin(x^2)

MetaPost:

I tried to plot sin(x^2) with metapost just for fun (what other reason
do I need?) and kept getting an overflow error message. Presumably this
is because the argument of sind must be in degrees. Anyway around this?

Walter Kehowski



From - Wed Jul 25 00:04:22 2001
Return-Path: <hartmut_henkel@gmx.de>
Received: from hahepc1.hahe (c-163-73.cvx-mannheim.ipdial.viaginterkom.de
    [62.134.73.163]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f6OM4Am71787 for <metafont@ens.fr>; Wed, 25 Jul 2001 00:04:10 +0200 (CEST)
Received: from hahe (helo=localhost) by hahepc1.hahe with local-esmtp
    (Exim 3.12 #1 (Debian)) id 15PAHn-0002LI-00 for <metafont@ens.fr>;
    Wed, 25 Jul 2001 00:04:15 +0200
Date: Wed, 25 Jul 2001 00:04:15 +0200 (CEST)
From: Hartmut Henkel <hartmut_henkel@gmx.de>
To: MetaFont List <metafont@ens.fr>
Subject: [metafont] RCS Scanning Macro for MetaPost
Message-Id: <Pine.LNX.4.21.0107242349250.8751-100000@hahepc1.hahe>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 470
Precedence: list

Dear MetaPost fans,

below please find a code snipplet for your experimenting.

Have fun!

Hartmut


% $Id: rcsscan.mp,v 1.16 2001/07/24 22:02:16 hahe Exp hahe $
%
% rcsscan.mp --- Scanning RCS Strings in MetaPost
%
% Written by Hartmut Henkel, July 2001.
% E-Mail: hartmut_henkel@gmx.de
%
% Code placed in the public domain.
%
% The macro `rcsscan' allows annotating of MetaPost drawings
% by various strings extracted from the current RCS revision string
% in the .mp source file.
% See the `co' man page.
%
% The macro `rcsscan' defines strings rcsstring, rcsfilename,
% rcsmpfilename, rcsrevnum, rcsdate, rcsdate.de, rcsdate.iso,
% rcstime, rcsauthor, csstate, rcslocker from a valid RCS string.
% These strings are empty before the first `ci'/`co' action.
% After `co' they contain the fields of the current RCS string,
% which should look similar e. g. to the first line of this file.
%
% Usage: In the MetaPost source file, write:
%
% input rcsscan;
% rcsscan ("$-Id$"); % But do NOT type the dash!
%
% (Without the shown dash, the Id-string would be interpreted
% by the RCS system already in this file.)

def rcsscan(text _rcsstring) =
  begingroup;

  save scanit;

  def scanit(text _istr)(text _sep)(text _ostr) =
    save _ostr; string _ostr[];
    save sepcount, seppos, i;
    save q; string q;
    seppos := 0;
    q := _istr & _sep;
    sepcount := 1;
    for i := 1 upto length q:
      if substring (i-1,i) of q = _sep:
        _ostr[sepcount] := substring(seppos,i-1) of q;
        seppos := i;
        sepcount := sepcount + 1;
      fi;
    endfor;
  enddef;

  save rcsleader, rcstrailer;

  forsuffixes i = rcsstring, rcsleader, rcsfilename, rcsrevnum,
    rcsdate, rcstime, rcsauthor, rcsstate, rcslocker, rcstrailer,
    rcsdate.de, rcsdate.iso, rcsmpfilename:
      string i; i = "";
  endfor;

  rcsstring := _rcsstring;

  scanit(rcsstring)(" ")(splitrcs);
  if unknown splitrcs[9]: else:
    rcsleader := splitrcs[1];
    rcsfilename := splitrcs[2];
    rcsrevnum := splitrcs[3];
    rcsdate := splitrcs[4];
    rcstime := splitrcs[5];
    rcsauthor := splitrcs[6];
    rcsstate := splitrcs[7];
    rcslocker := splitrcs[8];
    rcstrailer := splitrcs[9];

    scanit(rcsdate)("/")(splitdate);
    rcsdate.de := splitdate[3] & "." & splitdate[2] & "." & splitdate[1];
    rcsdate.iso := splitdate[1] & "-" & splitdate[2] & "-" & splitdate[3];

    scanit(rcsfilename)(",")(splitrcsfilename);
    rcsmpfilename := splitrcsfilename[1];
  fi;

  endgroup;
enddef;
% End of file rcsscan.mp


------------------------------------------------------------------------
Dr.-Ing. Hartmut Henkel
In den Auwiesen 6, D-68723 Oftersheim, Germany
E-Mail: hartmut_henkel@gmx.de
http://www.circuitwizard.de
------------------------------------------------------------------------


From - Wed Jul 25 00:30:07 2001
Return-Path: <hartmut_henkel@gmx.de>
Received: from hahepc1.hahe (c-228-73.cvx-mannheim.ipdial.viaginterkom.de
    [62.134.73.228]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f6OMTsm73039 for <metafont@ens.fr>; Wed, 25 Jul 2001 00:29:54 +0200 (CEST)
Received: from hahe (helo=localhost) by hahepc1.hahe with local-esmtp
    (Exim 3.12 #1 (Debian)) id 15PAgh-0002aI-00 for <metafont@ens.fr>;
    Wed, 25 Jul 2001 00:29:59 +0200
Date: Wed, 25 Jul 2001 00:29:59 +0200 (CEST)
From: Hartmut Henkel <hartmut_henkel@gmx.de>
To: MetaFont List <metafont@ens.fr>
Subject: [metafont] RCS Scanning Macro for MetaPost, 2nd Try
In-Reply-To: <Pine.LNX.4.21.0107242349250.8751-100000@hahepc1.hahe>
Message-Id: <Pine.LNX.4.21.0107250024260.9765-100000@hahepc1.hahe>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 471
Precedence: list

Oops, there are different $Id$ strings when files are locked (co -l) or
not (co). This is corrected below. Sorry for the trouble.

Greetings Hartmut


% $Id: rcsscan.mp,v 1.17 2001/07/24 22:22:39 hahe Exp hahe $
%
% rcsscan.mp --- Scanning RCS Strings in MetaPost
%
% Written by Hartmut Henkel, July 2001.
% E-Mail: hartmut_henkel@gmx.de
%
% Code placed in the public domain.
%
% The macro `rcsscan' allows annotating of MetaPost drawings
% by various strings extracted from the current RCS revision string
% in the .mp source file.
% See the `co' man page.
%
% The macro `rcsscan' defines strings rcsstring, rcsfilename,
% rcsmpfilename, rcsrevnum, rcsdate, rcsdate.de, rcsdate.iso,
% rcstime, rcsauthor, csstate, rcslocker from a valid RCS string.
% These strings are empty before the first `ci'/`co' action.
% After `co' they contain the fields of the current RCS string,
% which should look similar e. g. to the first line of this file.
%
% Usage: In the MetaPost source file, write:
%
% input rcsscan;
% rcsscan ("$-Id$"); % But do NOT type the dash!
%
% (Without the shown dash, the Id-string would be interpreted
% by the RCS system already in this file.)

def rcsscan(text _rcsstring) =
  begingroup;

  save scanit;

  def scanit(text _istr)(text _sep)(text _ostr) =
    save _ostr; string _ostr[];
    save sepcount, seppos, i;
    save q; string q;
    seppos := 0;
    q := _istr & _sep;
    sepcount := 1;
    for i := 1 upto length q:
      if substring (i-1,i) of q = _sep:
        _ostr[sepcount] := substring(seppos,i-1) of q;
        seppos := i;
        sepcount := sepcount + 1;
      fi;
    endfor;
  enddef;

  save rcsleader, rcstrailer;

  forsuffixes i = rcsstring, rcsleader, rcsfilename, rcsrevnum,
    rcsdate, rcstime, rcsauthor, rcsstate, rcslocker, rcstrailer,
    rcsdate.de, rcsdate.iso, rcsmpfilename:
      string i; i = "";
  endfor;

  rcsstring := _rcsstring;

  scanit(rcsstring)(" ")(splitrcs);
  if unknown splitrcs[8]: else:
    rcsleader := splitrcs[1];
    rcsfilename := splitrcs[2];
    rcsrevnum := splitrcs[3];
    rcsdate := splitrcs[4];
    rcstime := splitrcs[5];
    rcsauthor := splitrcs[6];
    rcsstate := splitrcs[7];
    if unknown splitrcs[9]: 
      rcstrailer := splitrcs[8];
    else:
      rcslocker := splitrcs[8];
      rcstrailer := splitrcs[9];
    fi;

    scanit(rcsdate)("/")(splitdate);
    rcsdate.de := splitdate[3] & "." & splitdate[2] & "." & splitdate[1];
    rcsdate.iso := splitdate[1] & "-" & splitdate[2] & "-" & splitdate[3];

    scanit(rcsfilename)(",")(splitrcsfilename);
    rcsmpfilename := splitrcsfilename[1];
  fi;

  endgroup;
enddef;
% End of file rcsscan.mp


------------------------------------------------------------------------
Dr.-Ing. Hartmut Henkel
In den Auwiesen 6, D-68723 Oftersheim, Germany
E-Mail: hartmut_henkel@gmx.de
http://www.circuitwizard.de
------------------------------------------------------------------------


From - Sun Jul 29 16:54:21 2001
Return-Path: <ziari@math.sharif.ac.ir>
Received: from MATH.SHARIF.AC.IR (math.Sharif.AC.IR [194.225.40.125]) by
    nef.ens.fr (8.10.1/1.01.28121999) with SMTP id f6TEs7m33397 for
    <metafont@ens.fr>; Sun, 29 Jul 2001 16:54:08 +0200 (CEST)
Received: by math.sharif.ac.ir (MX V4.1 VAX) id 24; Sun, 29 Jul 2001
    19:23:37 +0330 (IST)
Date: Sun, 29 Jul 2001 19:23:37 +0330 (IST)
From: ziari@math.sharif.ac.ir
To: metafont@ens.fr
Message-Id: <009FFBEC.6DF4AEC0.24@math.sharif.ac.ir>
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 472
Precedence: list
Subject: [metafont] 3D figures

Dear friends,
Hi,

I want to draw 3d figures such az f(x,y)=(x^2y)/(x^2+y^2), etc.
(I am drawing general math's figures)
For this, I need many 3d  examples (figures) that draw by MetaPost.
If you have these .mp files, Please send for me with attachment.

Regards,
Jafar Ziari


From - Mon Jul 30 17:52:07 2001
Return-Path: <ktarik@Bilkent.EDU.TR>
Received: from firat.bcc.bilkent.edu.tr (firat.bcc.bilkent.edu.tr
    [139.179.10.13]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f6UFptm31463 for <metafont@ens.fr>; Mon, 30 Jul 2001 17:51:56 +0200 (CEST)
Received: from balikesir (ktarik@balikesir [139.179.10.1]) by
    firat.bcc.bilkent.edu.tr (8.11.4/8.11.4) with ESMTP id f6UFrmP13616;
    Mon, 30 Jul 2001 18:53:50 +0300 (EET DST)
Date: Mon, 30 Jul 2001 18:51:18 +0300 (EET DST)
From: Tarik Kara <ktarik@Bilkent.EDU.TR>
X-Sender: ktarik@balikesir
To: ziari@math.sharif.ac.ir
Cc: metafont@ens.fr
Subject: Re: [metafont] 3D figures
In-Reply-To: <009FFBEC.6DF4AEC0.24@math.sharif.ac.ir>
Message-Id: <Pine.GSO.4.05.10107301848390.3150-100000@balikesir>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 473
Precedence: list

Take a look at 

http://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html

it is a large file with many nice examples (some of them 3D graphs of
functions).

Have fun,

Tar{\i}k

On Sun, 29 Jul 2001 ziari@math.sharif.ac.ir wrote:

> Dear friends,
> Hi,
> 
> I want to draw 3d figures such az f(x,y)=(x^2y)/(x^2+y^2), etc.
> (I am drawing general math's figures)
> For this, I need many 3d  examples (figures) that draw by MetaPost.
> If you have these .mp files, Please send for me with attachment.
> 
> Regards,
> Jafar Ziari
> 
> 


