diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-04-11 20:12:40 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-04-11 20:12:40 +0200 |
commit | 1e69816bbbeebedafd52684fc4182ce977d92a8a (patch) | |
tree | 06d7cfe0c8490e66eb8f6447bd6f9c50afb8d90e /metapost/context/base/mpxl/mp-tool.mpxl | |
parent | c1224cc330e695938cfcf944f8e9d0c14c15fa8c (diff) | |
download | context-1e69816bbbeebedafd52684fc4182ce977d92a8a.tar.gz |
2022-04-11 19:22:00
Diffstat (limited to 'metapost/context/base/mpxl/mp-tool.mpxl')
-rw-r--r-- | metapost/context/base/mpxl/mp-tool.mpxl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/metapost/context/base/mpxl/mp-tool.mpxl b/metapost/context/base/mpxl/mp-tool.mpxl index 28d1bbf3e..d99439c5b 100644 --- a/metapost/context/base/mpxl/mp-tool.mpxl +++ b/metapost/context/base/mpxl/mp-tool.mpxl @@ -3946,3 +3946,34 @@ primarydef p withdashes len = enddef ; permanent withdashes ; + +%D For Mikael: + +path mfun_b ; +pair mfun_k ; + +tertiarydef p intersectionpath q = + begingroup ; + save mfun_b ; path mfun_b ; mfun_b := sortedpath (p intersectiontimeslist q) ; + save mfun_k ; pair mfun_k ; mfun_k := point 0 of mfun_b; + .5[point xpart mfun_k of p, point ypart mfun_k of q] + for i = 1 upto length(mfun_b) : + hide(mfun_k := point i of mfun_b;) + -- .5[point xpart mfun_k of p, point ypart mfun_k of q] + endfor + endgroup +enddef ; + +tertiarydef p firstintersectionpath q = + begingroup ; + save mfun_b ; path mfun_b ; mfun_b := sortedpath (p intersectiontimeslist q) ; + point xpart (point 0 of mfun_b) of p + for i = 1 upto length(mfun_b) : + -- point xpart (point i of mfun_b) of p + endfor + endgroup +enddef ; + +tertiarydef p secondintersectionpath q = + q firstintersectionpath p +enddef; |