Taco Hoekwater | 1 Apr 2010 11:34
Gravatar

MetaPost 1.211 announcement


The MetaPost team is happy to announce a new release of MetaPost:

----------------------------------------------------------------------
MetaPost 1.211
----------------------------------------------------------------------

The standalone distribution package and a win32 binary can be downloaded
immediately from

   http://foundry.supelec.fr/gf/project/metapost/

This release will also be available from CTAN soon, and it will be
included in the next TeXLive. The source package should compile normally
on all systems that are capable of compiling a modern web2c-based TeX
distribution.

The win32 binary is intended for texlive or a similar web2c-based
installation, this executable will *not* work for miktex.

Of course, we welcome any comments (either good or bad) that you may
have. Simply replying to this message is fine, but see the bottom of
the message for a more formal way to report bugs and feature requests.

----------------------------------------------------------------------
What is new in MetaPost version 1.211
----------------------------------------------------------------------

* In previous 1.20X versions, the 'glyph infont' operator did not handle
   fonts with seac (old-style composite characters) properly.
(Continue reading)

Dmitry Solomennikov | 1 Apr 2010 14:17
Picon

Compile metapost

Hello,

I have an idea to incorporate MP's scanner and math engine into CAD-like project. I will produce output by
myself. I need calculations only: path intersections, equation solvation, calculations etc. And I need
results of a calculations, that is point coords and path information.
There are two questions.
1) How to build MP as *.dll (win) or *.so (linux)? 
2) I don't need an TeX-ability with MP (no texts at all). How to build MP without TeX connection (kpathsea and others)?

Thank you.

Sincerely, Dmitry.
dmitrys99 <at> mail.ru
--
http://tug.org/metapost/

Taco Hoekwater | 1 Apr 2010 16:34
Gravatar

Re: Compile metapost

Dmitry Solomennikov wrote:
> Hello,
> 
> I have an idea to incorporate MP's scanner and math engine into
> CAD-like project. I will produce output by myself. I need
> calculations only: path intersections, equation solvation,
> calculations etc. And I need results of a calculations, that is point
> coords and path information. There are two questions.

> 1) How to build MP as *.dll (win) or *.so (linux)?

Metapost consists of two components: a library and an executable driver.

The library is built from am/libmplib.am, the executable from
am/mplib.am.

The library consists of avl.c, memio.w, mp.w, psout.w, and svgout.w,
   this does all the real work except the TeX connection and file
   searching.
The binary has mpxout.w and mpost.w, and connects the library to
   kpathsea.

There is also lmplib.c. This file creates bindings to the library
component from lua, and could be used as an example. If this is
too obscure for you, see manual/mplibapi.tex for the official
documentation.

The current build system does not support creating a dynamic library
(because it is derived from the TeXLive build system which does not
need that) but the general approach is fairly straightforward:
(Continue reading)

js stock | 18 Apr 2010 16:39
Picon

buildcycle

Dear MetaPost users,


  I'm having troubles with the buildcycle macro. I tried to look around, but found nothing helpful. It's just a simple source where I'd like the intersection of the two cycles to be filled. It seems nothing is filled, but actually (you can see it if you comment the "draw p; draw q;" line), a very tiny portion of the figure seems to be returned by "buildcycle".
Any help would be much appreciated!

GalTrack

##
beginfig(8);
numeric a,b,c,d;
a=.5in; b=.7in; c=.3in; d=.5in;
z1=-z3=(a,0); z2=-z4=(0,b);
path p,q;
p=z1..z2..z3..z4..cycle;
q=p shifted (-1cm,0);
draw p;
draw q;
fill buildcycle(p,q) withcolor black;
endfig;
end
--
http://tug.org/metapost/
Karel | 19 Apr 2010 03:24
Picon

Re: buildcycle

js stock napsal(a):
> Dear MetaPost users,
> 
>   I'm having troubles with the buildcycle macro. I tried to look around, 
> but found nothing helpful. It's just a simple source where I'd like the 
> intersection of the two cycles to be filled. It seems nothing is filled, 
> but actually (you can see it if you comment the "draw p; draw q;" line), 
> a very tiny portion of the figure seems to be returned by "buildcycle".
> Any help would be much appreciated!
> 
If you look into mpman.pdf you will find that it 
is not the easy case having two intersection 
points with "bad order". Moving the time of your 
paths will make it better:

fill buildcycle(subpath(2,6) of p,q) withcolor red;
fill buildcycle(p,subpath(2,6) of q) withcolor green;

Karel Horak

> GalTrack
> 
> ##
> beginfig(8);
> numeric a,b,c,d;
> a=.5in; b=.7in; c=.3in; d=.5in;
> z1=-z3=(a,0); z2=-z4=(0,b);
> path p,q;
> p=z1..z2..z3..z4..cycle;
> q=p shifted (-1cm,0);
> draw p;
> draw q;
> fill buildcycle(p,q) withcolor black;
> endfig;
> end
> 
> 
> ------------------------------------------------------------------------
> 
> --
> http://tug.org/metapost/

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

Pétiard François | 19 Apr 2010 07:11
Picon
Favicon

Re: buildcycle

Le 18/04/2010 16:39, js stock a écrit :

> beginfig(8);
> numeric a,b,c,d;
> a=.5in; b=.7in; c=.3in; d=.5in;
> z1=-z3=(a,0); z2=-z4=(0,b);
> path p,q;
> p=z1..z2..z3..z4..cycle;
> q=p shifted (-1cm,0);
> draw p;
> draw q;
> fill buildcycle(p,q) withcolor black;
> endfig;
> end
>

Try:

fill buildcycle(reverse(p),q) withcolor black;

François

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

js stock | 19 Apr 2010 11:57
Picon

Re: buildcycle

Thank you both for your help; I understand better what happens now.
To be complete, let's state the outcomes of the solutions proposed:

fill buildcycle(subpath(2,6) of p,q) withcolor red;
  This fills the union of the two ellipsis.

fill buildcycle(p,subpath(2,6) of q) withcolor green;
  This fills the intersection of the two ellipsis.

fill buildcycle(reverse(p),q) withcolor black;
  This fills p \ q.

Galtrack

2010/4/19 Pétiard François <petiard.francois <at> free.fr>
Le 18/04/2010 16:39, js stock a écrit :


beginfig(8);
numeric a,b,c,d;
a=.5in; b=.7in; c=.3in; d=.5in;
z1=-z3=(a,0); z2=-z4=(0,b);
path p,q;
p=z1..z2..z3..z4..cycle;
q=p shifted (-1cm,0);
draw p;
draw q;
fill buildcycle(p,q) withcolor black;
endfig;
end


Try:

fill buildcycle(reverse(p),q) withcolor black;

François

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

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

Gmane