Samuel Bronson | 22 Apr 01:38 2014
Picon

decimal: The impossible/a segfault happened

Package: texlive-metapost
Version: 2013.20140314-1
Severity: normal

Dear Implementors,

I've discovered a way to get either:
  1. a "! This can't happen (token)." error (MetaPost 1.803 from Debian)
or 
  2. a segfault (MetaPost ~1.999 from SVN r2007)

[Note: I've abused debian-bug.el to include some information on package
version numbers.]

Unfortunately, most of the stuff I tried trimming out of my input makes
both go away; the former disappears if I so much as use "tracingall".

Here's the input file:

Attachment (decimal-fail.mp): text/x-metapost, 2760 bytes

and here's what happens when I run it ...

... under MetaPost 1.803:

% mpost -numbersystem=decimal decimal-fail.mp
This is MetaPost, version 1.803 (kpathsea version 6.1.1)
(mfplain.mp
(Continue reading)

- | 4 Apr 11:23 2014
Picon

I cannot use metapost (mpost)

 I am trying to compose a lecture, by means of metapost figures. I use a linux computer with UBUNTU, and composed a file example.mp as is described in a paper of Andr'e Heck on "Learning Metapost by doing" , NTG vol.32,2005. When as prescribed, I typed 'mpost example' I got the message: sudo apt-get install texlive - binaries. After some time Texlive was loaded and again I typed 'mpost example'. Now I got the message: Sorry, I can't find the 'mpost' preload file, will try 'plain'. And then: I can't find the 'plain' preload file!

How should I proceed to use metapost? Thanks, when you can help me.

Wim Maaskant

--
http://tug.org/metapost/
Hartmut Henkel | 2 Apr 21:10 2014
Picon
Picon

arclength() tolerances

Hi,

in metapost there seem to be absolute tolerance values for iterative
algorithms like arclength() even in the double numbersystem:

path p;
p:=fullcircle scaled 0.01;
message(decimal(arclength(p)));
p:=fullcircle scaled 10000;
message(decimal(arclength(p)));

This is MetaPost, version 1.803 (kpathsea version 6.1.1)
(mpost.mp (/usr/local/texlive/2013/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005) ) (./xx.mp
0.03147739887362138
31415.99535777498)

Regards, Hartmut

--
http://tug.org/metapost/

Franck Pastor | 1 Apr 10:18 2014
Picon

Units unaccuracy with numbersystem set to double

Hello,

Since floating points numerics are available in MetaPost when setting the numbersystem variable to
"double", I've used them regularly. Only recently I noticed something wrong with it: the MetaPost unit
values are unchanged whether "numbersystem" is set to "double" or "scaled". 

Here is a sample, for the centimeter (cm), millimeter(mm) and point (pt) units:

iMacIntel20-4:~ fp$ mpost -numbersystem=double
This is MetaPost, version 1.803 (kpathsea version 6.1.1)
**null
(mpost.mp (/usr/local/texlive/2013/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005) )
(/usr/local/texlive/2013/texmf-dist/metapost/misc/null.mp)
*show cm;
>> 28.34645
*show mm;
>> 2.83464
*show pt;
>> 0.99626
*
Thus we've got exactly the same accuracy as with the scaled number system, whereas I had expected much more
decimals. As an example, Asymptote, which uses floating-point arithmetics by default, returns this
definition of the centimeter unit:

Welcome to Asymptote version 2.23 (to view the manual, type help)
> cm
28.3464566929134
> 

Is MetaPost not supposed to have the same kind of accuracy when numbersystem is set to "double"?

NB: I'm still using the MetaPost version (1.803) that comes with TeX Live, not being able to install
MetaPost 1.9 on my own. Maybe this problem has been solved in this last version.

Thanks for having read this!

Franck Pastor

--
http://tug.org/metapost/

Daniel H. Luecking | 17 Mar 14:30 2014
Picon

Re: quick question

[Copying the list]

The problem is that the EPS which metapost produces by
default is not self-contained. The fonts are not
embedded. TeX-relatex software like dvips, dvipdfmx
and pdflatex know how to handle that, but programs
like ghostscript need the fonts either in the EPS
file or in the system.

If you include the line

    prologues := 3;

in your .mp file before any figures, MP will embed all
the fonts you use (provided it can find them, but that
includes all fonts installed in the TeX system).

See sections 3 and 8.1 of mpman.pdf (pages 5 and 24
in my version).

Dan

Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
Fayetteville, Arkansas
From: burkhard <at> eng.ucsd.edu [burkhard <at> eng.ucsd.edu] on behalf of Walt Burkhard [burkhard <at> cs.ucsd.edu]
Sent: Sunday, March 16, 2014 7:09 PM
To: Daniel H. Luecking
Subject: quick question

Hello Dan,

I just tried eps2eps  on a metapost created file that contains  measurements
expressed in the font cmss10.   Howver, I get an error message

Error: /undefined in cmss10

What fonts might I use in metapost that won't throw eps2eps off?

Many thanks in advance,

Walt


--
http://tug.org/metapost/
Walt Burkhard | 14 Mar 17:29 2014

quick question

Hello all,

I  have just learned of eps2eps!  So I tried it on one of
my metapost created files and to my surprise the eps file created
contained only one quarter of the original image.    The original
image symmetric about both the x and y axes.   

I have attached the original metapost created file here.   wheel.1

Many thanks in advance for any insights.

Walt
Attachment (wheel.1): application/octet-stream, 34 KiB
--
http://tug.org/metapost/
Dirk Laurie | 14 Mar 15:30 2014
Picon

[SOLVED] Getting SVG and EPS output from Metapost

2014-03-14 15:35 GMT+02:00 Daniel H. Luecking <luecking <at> uark.edu>:

> The manpage should at least say that you can get a list of options using.
>     mpost --help
> Maybe the full list is not there because of the rapid changes lately.
>
> Unix people would mostly think of --help on their own.

Well, I thought of -h, and it gave me a list of options that start
with -h. 26 of those, and all is revealed? Not quite: if the option
is unique and requires no additional field, it just accepts the
one-letter abbreviation and goes on running mpost.

No SVG or EPS info, though.

But mpman.pdf does give the required information.
Well, most of it.

For SVG output:

$ mpost -s 'outputformat="svg"' code.mp

Then rename `code.1` etc to have extension .svg.

For EPS output:

$ mpost  code.mp

Then feed `code.1` etc to eps2eps, saving the output to
files with extension .eps.

Note: you can't just rename `code.1` to `code.eps`. The drawings
are not properly encapsulated. Good enough for the graphicx
package, yes, but not for export to foreign programs that read EPS.

Dirk

--
http://tug.org/metapost/

Dirk Laurie | 14 Mar 10:42 2014
Picon

Can't the manpage be more helpful?

The full manpage of `mpost` in the TeXLive distribution starts off thus:

SYNOPSIS
       mpost [options] [commands]

       mpost --dvitomp dvifile[.dvi] [mpxfile[.mpx]]

DESCRIPTION
       MetaPost interprets the MetaPost language and produces PostScript (EPS)
       or Scalable Vector Graphics (SVG) pictures.

However, it gives no information whatsoever on "options". Experimentally
one finds that if you just give it "mpost code.mp" it produces files called
"code.1" etc that are in ordinary Postscript (not EPS).

I know it says later on "This manual page is not meant to be exhaustive."
And then directs you to the documentation directory without mentioning
the name or subdirectory of the file you should be reading first.

Surely the manpage, which currently is just over 100 lines long, could:

1. Tell you what to do in order to get EPS or SVG as advertised.
2. Say which file is the starting point when reading the documentation.

without becoming overly bloated?

--
http://tug.org/metapost/

Christophe Poulain | 8 Mar 08:04 2014
Picon

problem with negative's angle ?

Hi,
I'm a french user of Metapost and i've discovered this problem.

%>------------------------
prologues:=2;

beginfig(1);
  path cc;
  cc=fullcircle scaled 3cm;
  draw cc;
  for i=0 upto 11:
    label(decimal(i),point(arctime(((90-i*30)/360)*arclength cc) of cc) of cc);
    endfor;
endfig;

end
%>--------------------------

There isn't number if "the angle" is negative.

However, if I compile the code below, there is no problem.

%>----------------------
prologues:=2;

beginfig(1);
  path cc;
  cc=fullcircle scaled 3cm;
  draw cc;
  for i=0 upto 11:
    label(decimal(12-i),point(arctime(((90+i*30)/360)*arclength cc) of cc) of cc);
    endfor;
endfig;

end
%>-----------------------

I don't understand my mistake...

Christophe
--
http://tug.org/metapost/
José Carlos Santos | 24 Feb 13:31 2014
Picon

Several intersection points

Hi all,

Today I tried for the first time to obtain in MetaPost all intersection 
points of two lines. And I failed. :-( Here is the code:

----------------------- test.mp -----------------------

prologues := 3;
filenametemplate "%j.mps";
beginfig(1)
   numeric a,cc,cl,t[];
   pair p[],q[];
   path h[];
   a := 5mm;
   cc := 11a;
   cl := 10a;
   ct := 9.5a;
   p1 := (0,0);
   p2 := (cc,0);
   p3 := (cc,cl);
   p4 := (0,cl);
   h1 := (ct,0){up}
   for i=22.5 step 22.5 until 67.5:
     ..ct*(cosd(i),sind(i))-p1
   endfor
   ..(0,ct){left};
   h2 := (0,0)
   for i=1/16 step 1/16 until 1:
     ..(cc/2-a*sqrt((i*(cl/a)-(cl/a)/2)**2+((cc/a)**2-(cl/a)**2)/4),i*cl)
   endfor;
   h3 := h2 reflectedabout ((p1+p2)/2,(p3+p4)/2);
   p5 := h1 intersectionpoint h2;
   for i=1 upto 2:
     (t[i],whatever) = h1 intersectiontimes h3;
     q[i] := point t[i] of h1;
   endfor
   pickup pencircle scaled .8pt;
   for i=1 upto 3:
     draw h[i];
   endfor
   pickup pencircle scaled 4pt;
   drawdot(q2);
endfig;
end

-------------------------------------------------------

The path h1 is a quarter of a circle and the path h3 is part of a 
hyperbola. As you can see, they intersect twice. I tried to define q1 
and q2 as these intersection points, but to MetaPost q1 = q2. That is, 
if I compile the file above, the line "drawdot(q2)" draws one of the 
intersection points, but if I replace it with "drawdot(q1)", then I get 
the _same_ point. What am I doing wrong?

Best regards,

Jose Carlos Santos

--
http://tug.org/metapost/

Dave Crossland | 20 Feb 00:00 2014

Running mpost as a unix daemon?

Hi!

https://github.com/metapolator/metapolator/ is a font family editor
application, which calls mpost

This means the application is slow, because in
https://github.com/metapolator/metapolator/blob/master/metapolator/views.py#L876
we use the Python standard library's subprocess.Popen and incur a long
startup time each time it is run.

Non-Solution: Jonathan Fine's
https://bitbucket.org/jfine/tex-daemon/src/default/texd/py/metapost/metapostdp.py
looked like it might speed things up, but it seems it won't because it
isn't really a metapostd, but a wrapper that makes metapost appear
like a daemon, but still starts up metapost each time with
subprocess.Popen on
https://bitbucket.org/jfine/tex-daemon/src/default/texd/py/tex/util.py#83

I see 3 options for making this work as a daemon:

Option: Write a new C/C++ unix daemon 'metapostd' in C, to run MPLib
as so there is no start up time

Option: Write a python binding for MPLib, to access metapost
calculations directly from Python

Option: Write a nodejs binding for MPLib, to access metapost
calculations directly from node

I wonder what the metapost community thinks about these options -
which would be most widely useful?

I'd love it if we could make a metapostd in python, but not sure its possible.

--

-- 
Cheers
Dave

--
http://tug.org/metapost/


Gmane