Metapost - Boundary box

I want to make a series of images with Metapost and Context. I want the height and width of the images to be fixed ( like a frame ) and center the picture drawn with Metapost inside that frame. So, is there a way to make the boundary values fixed with Metapost??

-

You can at least use the bbox command on the metapost -side of things, short for bounding box:

\def\myBoundingBox#1{\scale[width=3cm,height=1cm]{\useMPgraphic{#1}}}

\startMPdefinitions
bboxmargin := 1cm; % note: the context-side scaling affects this, naturally
\stopMPdefinitions

\startuseMPgraphic{first}
z0 = (0.5cm,1.5cm) ; z1 = (2.5cm,2.5cm) ;
z2 = (6.5cm,0.5cm) ; z3 = (3.0cm,1.5cm) ;

pickup pencircle xscaled 2mm yscaled 4mm rotated 30 ;
draw z0..z1..z2..z3..z0..cycle withcolor lightgray ;

draw bbox currentpicture withpen pencircle scaled 1pt;
\stopuseMPgraphic

\starttext

Nothing is impossible, the word itself says “I’m possible”!

---~Audrey Hepburn
\myBoundingBox{first}

\stoptext


The line-widths will then differ depending on how much down-/up-scaling needed to be done for the graphic. It would therefore make more sense to do the framing in ConTeXt -side of things, so at least the frame line-width would stay the same (and frame padding).

-