couple of metafun questions
Hi all, I'm experimenting with some metafun code and positional graphics to produce a nice illustration for an article. There's some basic questions I haven't been able to solve (and I remember that I couldn't solve them before but found workarounds, but this time it looks like I'm stuck): 1. Is it possible to have a MPpositiongraphics anchored to more than two positions? Like draw position1 -- position2 .. position3 ? 2. Related to 1.: Is it right that you can't anchor more than 1 MPpositiongraphic to one anchor? If I have: drawsomething position1 -- position2 I can't then say drawsomething position1 .. position3 but must work around by reversing drawsomething position3 .. position1 3. Is it possible to get a line/arrow dashed in two different colors, like red and blue? Sorry if these are silly questions, but I just dabble into metafun! Thanks, and best Thomas
On 8/2/06, Thomas A. Schmitz wrote:
3. Is it possible to get a line/arrow dashed in two different colors, like red and blue?
Just out of curiosity I tried the following: picture dp; draw dashpattern(on 2 off 6) scaled 5pt withcolor blue; draw dashpattern(off 4 on 2 off 2) scaled 5pt withcolor red; dp := currentpicture; draw origin--(5cm,0) dashed dp; But of course "! Picture is too complicated to use as a dash pattern." So you have to draw the path twice with different color and pattern (you can write a macro for it of course if you need it often). beginfig(1); pickup pencircle scaled 2pt; picture dp[]; dp[1] := dashpattern(on 2 off 6) scaled 3pt; dp[2] := dashpattern(off 4 on 2 off 2) scaled 3pt; path p; p := (origin .. (2,1) .. (3,-1) .. (5,0)) scaled 3cm; draw p dashed dp[1] withcolor blue; draw p dashed dp[2] withcolor red; endfig; end. Mojca
On Aug 2, 2006, at 11:56 PM, Mojca Miklavec wrote:
So you have to draw the path twice with different color and pattern (you can write a macro for it of course if you need it often).
beginfig(1); pickup pencircle scaled 2pt; picture dp[]; dp[1] := dashpattern(on 2 off 6) scaled 3pt; dp[2] := dashpattern(off 4 on 2 off 2) scaled 3pt;
path p; p := (origin .. (2,1) .. (3,-1) .. (5,0)) scaled 3cm;
draw p dashed dp[1] withcolor blue; draw p dashed dp[2] withcolor red; endfig; end.
Mojca
Mojca, thanks so much, this works and does exactly what I want! For the rest of my questions: I've decided to go for an embedded staticMPfigure instead of MPpositiongraphic, so I can manage. But I'd still be curious if these things are possible or not. Anyways, thanks a lot! Thomas
participants (2)
-
Mojca Miklavec
-
Thomas A. Schmitz