[metapost] problem with macro parameters

Stephan Hennig mailing_list at arcor.de
Sat Aug 20 19:22:50 CEST 2005


Stephan Hennig schrieb:

> However, ra and rb (entering and leaving angles at nodes a and b)
> evaluate to zero when called inside my macro.

Sorry, it's as simple as that: you have to provide ra and rb as strings.

Regards
Stephan Hennig


input metaobj
prologues := 1;

def curve(suffix a,b)(expr ra,rb) =
  nccurve(a)(b)
    "angleA(" & decimal ra & ")",
    "angleB(" & decimal rb & ")";
enddef;

beginfig(1);
  newCircle.source("S");
  newCircle.sink("T");
  source.c = (0bp, 0bp);
  sink.c = (100bp, 0bp);
  drawObj(source, sink);
  angA = 45;
  curve(source,sink, angA,-20);
endfig;
end



More information about the metapost mailing list