[NTG-context] [***SPAM***] Scaling large (annotated) MetaFun drawing

2013-06-18 Thread Pavneet Arora
[Sorry about the previous null message.]

Background:

Typically I use MetaPost to create small figures, which I then can scale
as needed in larger documents.  These figures contain no text so I can
simply use the .eps output of mpost as an inclusion.

Recently, I have embarked on a large illustration replete with lots of
text labels.  It is a distilled architectural drawing intended for
diagnostic and maintenance purposes.  In it plumbing details are
overlaid over a layout.  For simplicity, I standardized on unit size of
1cm so that co-ordinates can easily map from physical dimensions with
the unusual hybrid scale of 1cm=1ft ;)..

Status:

With this set unit size, my drawing has grown very large.  My intent is
to get it printed on one of the (U.S.) based architectural paper sizes,
or if it can be made legible on U.S. Tabloid size paper (17 x 11)..
My first successful approach (and where I stand right now) is to simply
use \startMPpage and \stopMPpage to scale to the page.

Thera are a couple of issues, though, with this approach.  First, I want
to add additional information to the page, other than what would be
handled by MetaPost, e.g., some tables, etc.  Even without this
additional information, having the drawing scale to page size does not
give adequate margin buffering and if there are some labels right at the
edge, I have seen some clipping of the text.

Objective:

I would like to create a scalable drawing with all of its text
labels so that I can scale appropriately to different page sizes, and
also incorporate the illustration with other document elements.

From what I have read at:

http://wiki.contextgarden.net/MetaPost_in_ConTeXt

I think what I need is something akin to \startuseMPgraphic with a
scaling option if I want to include the code inline.  Otherwise, the
drawing is clipped on the page.

Or perhaps I simply try to convert the existing PDF output to PS, and
then include it?

What I am hoping is to get a best practises workflow from the list so
that I can simply adopt it.

advTHANKSance.

Sample:

A MWE is found below:

\setuppapersize[tabloid,landscape][tabloid,landscape]
\starttext

\setupMPinstance
[metafun]
[extensions=yes,
initializations=yes,
textstyle=bold]

\startMPpage
u:=1cm;

pickup pencircle scaled 1pt;

draw (5u,0u) {dir 90}..(0u,5u) {dir 180};
draw (0u,5u) .. (-1.5u,10.5u) {dir 90} .. (0u,16u);
draw (0u,16u) {dir 0} .. (5u,21u) {dir 90};
draw (5u,21u) -- (39u,21u);
draw (39u,21u) {dir 270} .. (42u,18u) {dir 0};
draw (42u,18u) .. (43.5u,10.5u) {dir 270} .. (42u,3u);
draw (42u,3u) {dir 180} .. (39u,0u) {dir 270};
draw (39u,0u) -- (35u,0u);
draw (35u,0u) .. (22u,3u) {dir 180} .. (9u,0u);
draw (9u,0u) -- (5u,0u);
label(btex AN ARCHITECTURAL ELEMENT etex, (22u,10.5u));

\stopMPpage
\stoptext


-- 

Pavneet Arora   m: 647.406.6843
Waroc Informatikt: 416.937.9276
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] [***SPAM***] Scaling large (annotated) MetaFun drawing

2013-06-18 Thread Hans Hagen

On 6/18/2013 3:13 PM, Pavneet Arora wrote:

[Sorry about the previous null message.]

Background:

Typically I use MetaPost to create small figures, which I then can scale
as needed in larger documents.  These figures contain no text so I can
simply use the .eps output of mpost as an inclusion.

Recently, I have embarked on a large illustration replete with lots of
text labels.  It is a distilled architectural drawing intended for
diagnostic and maintenance purposes.  In it plumbing details are
overlaid over a layout.  For simplicity, I standardized on unit size of
1cm so that co-ordinates can easily map from physical dimensions with
the unusual hybrid scale of 1cm=1ft ;)..

Status:

With this set unit size, my drawing has grown very large.  My intent is
to get it printed on one of the (U.S.) based architectural paper sizes,
or if it can be made legible on U.S. Tabloid size paper (17 x 11)..
My first successful approach (and where I stand right now) is to simply
use \startMPpage and \stopMPpage to scale to the page.

Thera are a couple of issues, though, with this approach.  First, I want
to add additional information to the page, other than what would be
handled by MetaPost, e.g., some tables, etc.  Even without this
additional information, having the drawing scale to page size does not
give adequate margin buffering and if there are some labels right at the
edge, I have seen some clipping of the text.

Objective:

I would like to create a scalable drawing with all of its text
labels so that I can scale appropriately to different page sizes, and
also incorporate the illustration with other document elements.

 From what I have read at:

http://wiki.contextgarden.net/MetaPost_in_ConTeXt

I think what I need is something akin to \startuseMPgraphic with a
scaling option if I want to include the code inline.  Otherwise, the
drawing is clipped on the page.


you can use the \scale command

\scale[width=1cm]{\useMPgraphic{somename}}

it takes the same options as externalfigure


Or perhaps I simply try to convert the existing PDF output to PS, and
then include it?

What I am hoping is to get a best practises workflow from the list so
that I can simply adopt it.

advTHANKSance.

Sample:

A MWE is found below:

\setuppapersize[tabloid,landscape][tabloid,landscape]
\starttext

\setupMPinstance
[metafun]
[extensions=yes,
initializations=yes,
textstyle=bold]

\startMPpage
u:=1cm;

pickup pencircle scaled 1pt;

draw (5u,0u) {dir 90}..(0u,5u) {dir 180};
draw (0u,5u) .. (-1.5u,10.5u) {dir 90} .. (0u,16u);
draw (0u,16u) {dir 0} .. (5u,21u) {dir 90};
draw (5u,21u) -- (39u,21u);
draw (39u,21u) {dir 270} .. (42u,18u) {dir 0};
draw (42u,18u) .. (43.5u,10.5u) {dir 270} .. (42u,3u);
draw (42u,3u) {dir 180} .. (39u,0u) {dir 270};
draw (39u,0u) -- (35u,0u);
draw (35u,0u) .. (22u,3u) {dir 180} .. (9u,0u);
draw (9u,0u) -- (5u,0u);
label(btex AN ARCHITECTURAL ELEMENT etex, (22u,10.5u));

\stopMPpage
\stoptext





--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___