* passvariable(); path problem @ 2013-10-04 12:52 Peter Rolf 2013-10-04 14:15 ` Hans Hagen 0 siblings, 1 reply; 12+ messages in thread From: Peter Rolf @ 2013-10-04 12:52 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1: Type: text/plain, Size: 165 bytes --] Hi, I played around with the new passvariable() option and ran into errors when passing a path. Used the latest beta (01.10.2013). Can someone confirm this? Peter [-- Attachment #2: minimal.mkiv --] [-- Type: text/plain, Size: 101 bytes --] \starttext \startMPcode passvariable("path",fullcircle scaled 1cm) ; \stopMPcode \stoptext [-- Attachment #3: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-04 12:52 passvariable(); path problem Peter Rolf @ 2013-10-04 14:15 ` Hans Hagen 2013-10-04 14:47 ` Peter Rolf 2013-10-05 15:52 ` Peter Rolf 0 siblings, 2 replies; 12+ messages in thread From: Hans Hagen @ 2013-10-04 14:15 UTC (permalink / raw) To: ntg-context On 10/4/2013 2:52 PM, Peter Rolf wrote: > Hi, > > I played around with the new passvariable() option and ran into errors > when passing a path. Used the latest beta (01.10.2013). Can someone > confirm this? in mp-mlib.mpiv: vardef mfun_path_to_string(expr p) = mfun_point_to_string(p,1) for i=2 upto length(p) : & " " & mfun_point_to_string(p,i) endfor enddef ; vardef mfun_boolean_to_string(expr b) = if b : "true" else : "false" fi enddef ; (i forgot to rename the argument when outlining the code) fwiw: in your case you still get an (empty) graphic, use \startMPcalculation ... when you don't want that Hans ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-04 14:15 ` Hans Hagen @ 2013-10-04 14:47 ` Peter Rolf 2013-10-04 14:59 ` Peter Rolf 2013-10-05 15:52 ` Peter Rolf 1 sibling, 1 reply; 12+ messages in thread From: Peter Rolf @ 2013-10-04 14:47 UTC (permalink / raw) To: mailing list for ConTeXt users Am 04.10.2013 16:15, schrieb Hans Hagen: > On 10/4/2013 2:52 PM, Peter Rolf wrote: >> Hi, >> >> I played around with the new passvariable() option and ran into errors >> when passing a path. Used the latest beta (01.10.2013). Can someone >> confirm this? > > in mp-mlib.mpiv: > > vardef mfun_path_to_string(expr p) = > mfun_point_to_string(p,1) for i=2 upto length(p) : & " " & > mfun_point_to_string(p,i) endfor > enddef ; > > vardef mfun_boolean_to_string(expr b) = > if b : "true" else : "false" fi > enddef ; > > (i forgot to rename the argument when outlining the code) > > fwiw: in your case you still get an (empty) graphic, use > \startMPcalculation ... when you don't want that > Many thanks! Good to know, but in this case I just need the path. > Hans > > ----------------------------------------------------------------- > 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 > ___________________________________________________________________________________ > > ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-04 14:47 ` Peter Rolf @ 2013-10-04 14:59 ` Peter Rolf 0 siblings, 0 replies; 12+ messages in thread From: Peter Rolf @ 2013-10-04 14:59 UTC (permalink / raw) To: mailing list for ConTeXt users Am 04.10.2013 16:47, schrieb Peter Rolf: > Am 04.10.2013 16:15, schrieb Hans Hagen: >> On 10/4/2013 2:52 PM, Peter Rolf wrote: >>> Hi, >>> >>> I played around with the new passvariable() option and ran into errors >>> when passing a path. Used the latest beta (01.10.2013). Can someone >>> confirm this? >> >> in mp-mlib.mpiv: >> >> vardef mfun_path_to_string(expr p) = >> mfun_point_to_string(p,1) for i=2 upto length(p) : & " " & >> mfun_point_to_string(p,i) endfor >> enddef ; >> >> vardef mfun_boolean_to_string(expr b) = >> if b : "true" else : "false" fi >> enddef ; >> >> (i forgot to rename the argument when outlining the code) >> >> fwiw: in your case you still get an (empty) graphic, use >> \startMPcalculation ... when you don't want that >> > > Many thanks! Good to know, but in this case I just need the path. :-D now I know what you mean... > > >> Hans >> >> ----------------------------------------------------------------- >> 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 >> ___________________________________________________________________________________ >> >> > > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ > ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-04 14:15 ` Hans Hagen 2013-10-04 14:47 ` Peter Rolf @ 2013-10-05 15:52 ` Peter Rolf 2013-10-05 22:37 ` Hans Hagen 1 sibling, 1 reply; 12+ messages in thread From: Peter Rolf @ 2013-10-05 15:52 UTC (permalink / raw) To: mailing list for ConTeXt users I played around with it, but I have problems to understand the format of the returned path. Example: % -------- \setuppagenumber[state=stop] \starttext \nopdfcompression \startMPpage path p; p:= (20,20){up} .. {down}(200,100); passvariable("path",p); draw p ; \stopMPpage \ctxlua{inspect{metapost.variables["path"]}} \stoptext % ------- The PDF code of the path is (mainly) 20.000000 20.000000 m 20.000000 190.342880 200.000000 184.016693 200.000000 100.000000 c "path" contains table={ { { 200, 100, 200, 184.0167, 200, 100 }, }, } The end point and the second control point are the same, as in the PDF code. But how do I calculate the starting point and the first control point from the returned values? And is the type of operation (line, curve,..) given by the number of values? Peter Am 04.10.2013 16:15, schrieb Hans Hagen: > On 10/4/2013 2:52 PM, Peter Rolf wrote: >> Hi, >> >> I played around with the new passvariable() option and ran into errors >> when passing a path. Used the latest beta (01.10.2013). Can someone >> confirm this? > > in mp-mlib.mpiv: > > vardef mfun_path_to_string(expr p) = > mfun_point_to_string(p,1) for i=2 upto length(p) : & " " & > mfun_point_to_string(p,i) endfor > enddef ; > > vardef mfun_boolean_to_string(expr b) = > if b : "true" else : "false" fi > enddef ; > > (i forgot to rename the argument when outlining the code) > > fwiw: in your case you still get an (empty) graphic, use > \startMPcalculation ... when you don't want that > > Hans > > ----------------------------------------------------------------- > 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 > ___________________________________________________________________________________ > > ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-05 15:52 ` Peter Rolf @ 2013-10-05 22:37 ` Hans Hagen 2013-10-06 13:05 ` Peter Rolf 0 siblings, 1 reply; 12+ messages in thread From: Hans Hagen @ 2013-10-05 22:37 UTC (permalink / raw) To: ntg-context On 10/5/2013 5:52 PM, Peter Rolf wrote: > I played around with it, but I have problems to understand the format of > the returned path. > > Example: > % -------- > \setuppagenumber[state=stop] > > \starttext > \nopdfcompression > > \startMPpage > path p; > p:= (20,20){up} .. {down}(200,100); > passvariable("path",p); > draw p ; > \stopMPpage > > \ctxlua{inspect{metapost.variables["path"]}} > \stoptext > % ------- > > The PDF code of the path is (mainly) > > 20.000000 20.000000 m > 20.000000 190.342880 200.000000 184.016693 200.000000 100.000000 c > > "path" contains > > table={ > { > { 200, 100, 200, 184.0167, 200, 100 }, > }, > } > > The end point and the second control point are the same, as in the PDF > code. But how do I calculate the starting point and the first control > point from the returned values? something local prev = nil for i=1,#path do local current = path[i] if not prev then print(current[1],current[2],"m") else print(prev[5],prev[6],prev[3],prev[4],current[1],current[2],"c") end prev = current end -- close last to first if needed > And is the type of operation (line, curve,..) given by the number of values? by analyzing using thresholds (one can just use "c" always, as "l" is an optimization) Hans ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-05 22:37 ` Hans Hagen @ 2013-10-06 13:05 ` Peter Rolf 2013-10-06 15:06 ` Hans Hagen 0 siblings, 1 reply; 12+ messages in thread From: Peter Rolf @ 2013-10-06 13:05 UTC (permalink / raw) To: mailing list for ConTeXt users Am 06.10.2013 00:37, schrieb Hans Hagen: > On 10/5/2013 5:52 PM, Peter Rolf wrote: >> I played around with it, but I have problems to understand the format of >> the returned path. >> >> Example: >> % -------- >> \setuppagenumber[state=stop] >> >> \starttext >> \nopdfcompression >> >> \startMPpage >> path p; >> p:= (20,20){up} .. {down}(200,100); >> passvariable("path",p); >> draw p ; >> \stopMPpage >> >> \ctxlua{inspect{metapost.variables["path"]}} >> \stoptext >> % ------- >> >> The PDF code of the path is (mainly) >> >> 20.000000 20.000000 m >> 20.000000 190.342880 200.000000 184.016693 200.000000 100.000000 c >> >> "path" contains >> >> table={ >> { >> { 200, 100, 200, 184.0167, 200, 100 }, >> }, >> } >> >> The end point and the second control point are the same, as in the PDF >> code. But how do I calculate the starting point and the first control >> point from the returned values? > > something > > local prev = nil > for i=1,#path do > local current = path[i] > if not prev then > print(current[1],current[2],"m") > else > print(prev[5],prev[6],prev[3],prev[4],current[1],current[2],"c") > end > prev = current > end > -- close last to first if needed > >> And is the type of operation (line, curve,..) given by the number of > values? > > by analyzing using thresholds (one can just use "c" always, as "l" is an > optimization) > > Hans > Thanks for the explanation. I think I have understood the scheme (but I might be wrong, because this doesn't help me with my example). Where is the starting point['20 20'] in the returned example path? Same is true for the first control point ['20 190.34']. Either I'm missing something, or the returned path data is incomplete. Peter ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-06 13:05 ` Peter Rolf @ 2013-10-06 15:06 ` Hans Hagen 2013-10-07 8:48 ` Peter Rolf 0 siblings, 1 reply; 12+ messages in thread From: Hans Hagen @ 2013-10-06 15:06 UTC (permalink / raw) To: mailing list for ConTeXt users On 10/6/2013 3:05 PM, Peter Rolf wrote: > Thanks for the explanation. I think I have understood the scheme (but I > might be wrong, because this doesn't help me with my example). > > Where is the starting point['20 20'] in the returned example path? Same > is true for the first control point ['20 190.34']. Either I'm missing > something, or the returned path data is incomplete. you get just the value of the path variable in your mp code, not a ps or whatever representation and in mp a path has just points so the starting point is the x y of the first point ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-06 15:06 ` Hans Hagen @ 2013-10-07 8:48 ` Peter Rolf 2013-10-07 9:47 ` luigi scarso 0 siblings, 1 reply; 12+ messages in thread From: Peter Rolf @ 2013-10-07 8:48 UTC (permalink / raw) To: mailing list for ConTeXt users Am 06.10.2013 17:06, schrieb Hans Hagen: > On 10/6/2013 3:05 PM, Peter Rolf wrote: > >> Thanks for the explanation. I think I have understood the scheme (but I >> might be wrong, because this doesn't help me with my example). >> >> Where is the starting point['20 20'] in the returned example path? Same >> is true for the first control point ['20 190.34']. Either I'm missing >> something, or the returned path data is incomplete. > > you get just the value of the path variable in your mp code, not a ps or > whatever representation and in mp a path has just points so the starting > point is the x y of the first point > I tested several examples and the only time that the starting point was part of the returned path was, when the path only consists of one point. In all other cases it was missing. This is a bit contrary to my definition of a (complete) path. Anyhow, thanks for the pointer :-) Peter > ----------------------------------------------------------------- > 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 > ___________________________________________________________________________________ > > ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-07 8:48 ` Peter Rolf @ 2013-10-07 9:47 ` luigi scarso 2013-10-07 10:03 ` Hans Hagen 2013-10-07 11:02 ` Peter Rolf 0 siblings, 2 replies; 12+ messages in thread From: luigi scarso @ 2013-10-07 9:47 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1642 bytes --] On Mon, Oct 7, 2013 at 10:48 AM, Peter Rolf <indiego@gmx.net> wrote: > Am 06.10.2013 17:06, schrieb Hans Hagen: > > On 10/6/2013 3:05 PM, Peter Rolf wrote: > > > >> Thanks for the explanation. I think I have understood the scheme (but I > >> might be wrong, because this doesn't help me with my example). > >> > >> Where is the starting point['20 20'] in the returned example path? Same > >> is true for the first control point ['20 190.34']. Either I'm missing > >> something, or the returned path data is incomplete. > > > > you get just the value of the path variable in your mp code, not a ps or > > whatever representation and in mp a path has just points so the starting > > point is the x y of the first point > > > > I tested several examples and the only time that the starting point was > part of the returned path was, when the path only consists of one point. > In all other cases it was missing. > > This is a bit contrary to my definition of a (complete) path. Anyhow, > thanks for the pointer :-) > > in mp-mlib.mpiv should be : vardef mfun_path_to_string(expr p) = mfun_point_to_string(p,0) for i=1 upto length(p) : & " " & mfun_point_to_string(p,i) endfor enddef ; (You can fix it and rebuild the format. To understand the output, is better to know that mfun_point_to_string is vardef mfun_point_to_string(expr p,i) = decimal xpart (point i of p) & " " & decimal ypart (point i of p) & " " & decimal xpart (precontrol i of p) & " " & decimal ypart (precontrol i of p) & " " & decimal xpart (postcontrol i of p) & " " & decimal ypart (postcontrol i of p) enddef ; ) -- luigi [-- Attachment #1.2: Type: text/html, Size: 2468 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-07 9:47 ` luigi scarso @ 2013-10-07 10:03 ` Hans Hagen 2013-10-07 11:02 ` Peter Rolf 1 sibling, 0 replies; 12+ messages in thread From: Hans Hagen @ 2013-10-07 10:03 UTC (permalink / raw) To: ntg-context On 10/7/2013 11:47 AM, luigi scarso wrote: > (You can fix it and rebuild the format. To understand the output, is > better to know that mfun_point_to_string is no need to rebuild the format (at least not currently) as mp loads runtime the next beta will have (the somewhat useless) helper: \starttext \startluacode local result = metapost.quickanddirty("metafun",[[ draw fullcircle scaled 1cm ;]]) context("% t",result.bbox) context.par() context("% t",result.code) context.par() \stopluacode \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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: passvariable(); path problem 2013-10-07 9:47 ` luigi scarso 2013-10-07 10:03 ` Hans Hagen @ 2013-10-07 11:02 ` Peter Rolf 1 sibling, 0 replies; 12+ messages in thread From: Peter Rolf @ 2013-10-07 11:02 UTC (permalink / raw) To: mailing list for ConTeXt users Am 07.10.2013 11:47, schrieb luigi scarso: > > > > On Mon, Oct 7, 2013 at 10:48 AM, Peter Rolf <indiego@gmx.net > <mailto:indiego@gmx.net>> wrote: > > Am 06.10.2013 17:06, schrieb Hans Hagen: > > On 10/6/2013 3:05 PM, Peter Rolf wrote: > > > >> Thanks for the explanation. I think I have understood the scheme > (but I > >> might be wrong, because this doesn't help me with my example). > >> > >> Where is the starting point['20 20'] in the returned example > path? Same > >> is true for the first control point ['20 190.34']. Either I'm missing > >> something, or the returned path data is incomplete. > > > > you get just the value of the path variable in your mp code, not a > ps or > > whatever representation and in mp a path has just points so the > starting > > point is the x y of the first point > > > > I tested several examples and the only time that the starting point was > part of the returned path was, when the path only consists of one point. > In all other cases it was missing. > > This is a bit contrary to my definition of a (complete) path. Anyhow, > thanks for the pointer :-) > > > in mp-mlib.mpiv should be : > vardef mfun_path_to_string(expr p) = > mfun_point_to_string(p,0) for i=1 upto length(p) : & " " & > mfun_point_to_string(p,i) endfor > enddef ; > > > (You can fix it and rebuild the format. To understand the output, is > better to know that mfun_point_to_string is > > vardef mfun_point_to_string(expr p,i) = > decimal xpart (point i of p) & " " & > decimal ypart (point i of p) & " " & > decimal xpart (precontrol i of p) & " " & > decimal ypart (precontrol i of p) & " " & > decimal xpart (postcontrol i of p) & " " & > decimal ypart (postcontrol i of p) > enddef ; > > ) > > > -- > luigi @Luigi: thanks for the fix! @Hans: quickanddirty sounds promising (bbox is needed anyway) :-D ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2013-10-07 11:02 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-10-04 12:52 passvariable(); path problem Peter Rolf 2013-10-04 14:15 ` Hans Hagen 2013-10-04 14:47 ` Peter Rolf 2013-10-04 14:59 ` Peter Rolf 2013-10-05 15:52 ` Peter Rolf 2013-10-05 22:37 ` Hans Hagen 2013-10-06 13:05 ` Peter Rolf 2013-10-06 15:06 ` Hans Hagen 2013-10-07 8:48 ` Peter Rolf 2013-10-07 9:47 ` luigi scarso 2013-10-07 10:03 ` Hans Hagen 2013-10-07 11:02 ` Peter Rolf
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).