[metapost] Designing Brahmi DDHA

Shriramana Sharma samjnaa at gmail.com
Tue Jul 31 12:56:50 CEST 2012


On Tue, Jul 31, 2012 at 3:20 PM, Hans Hagen <pragma at wxs.nl> wrote:
> just flip the whole result:
>
> currentpicture := currentpicture reflectedabout (llcorner
> currentpicture,lrcorner currentpicture) ;

Hi thanks for your reply. However I think your solution would cause an
overall y-coordinate shift of the picture because you are reflecting
it about its lower bounding line. Further, it does not apply to a
single path. I was very well able to achieve my desired effect of
in-place flipping (a la GUI vector editors) by adding the following
lines after the initial computation of pcompliant:

numeric pleft, pright, phalfheight ;
phalfheight = ( ypart llcorner p + ypart urcorner p ) / 2 ;
pleft = xpart llcorner p ;
pright = xpart urcorner p ;
pcompliant := pcompliant reflectedabout ( ( pleft, phalfheight ), (
pright, phalfheight ) ) ;

Therefore my desire was to know how to make this a macro (or a
vardef), so I can re-use this procedure per path (like I can do in my
vector editing program). Preferably it would not modify its input path
but create a new temporary path and return it so that I can do
something like "path b ; b = flipvertical p ;" or say "draw
flipvertical p" or such.

 Can you please guide me with that? Thanks.

-- 
Shriramana Sharma


More information about the metapost mailing list