Fill an area defined by a subpath (Metafun)
![](https://secure.gravatar.com/avatar/d7c3317235884569312c31f786d43bbc.jpg?s=120&d=mm&r=g)
Hello, I have a little problem with coloring an area (path b). Thanks for your help. Fabrice \starttext \startMPcode path circle, p, q, b; circle = fullcircle xscaled 6cm yscaled 3.5cm; p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. point 6 of circle); q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle --cycle); b = (p -- subpath(2,6) of circle -- cycle); definecolor [ name = "mp:red", r = 1 ]; definecolor [ name = "mp:blue", r = 0.54, g = 0.17, b = 0.89 ]; fill q withcolor "mp:red" withtransparency(1,0.5) ; fill b withcolor "mp:blue" withtransparency(1,0.5) ; draw circle; draw p; label("$\overline{\text{A}}$",( 1.5cm,0)) withcolor "mp:red"; label("$\text{A}$",(-1.5cm,0)) withcolor "mp:blue"; label.top("E",(0,1.85cm)); \stopMPcode \stoptext
![](https://secure.gravatar.com/avatar/565476157eb3895a9c928ffce26d988d.jpg?s=120&d=mm&r=g)
On 23 Jul 2020, at 11:48, Fabrice Couvreur
wrote: Hello, I have a little problem with coloring an area (path b). Thanks for your help. Fabrice
\starttext \startMPcode
path circle, p, q, b;
circle = fullcircle xscaled 6cm yscaled 3.5cm; p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. point 6 of circle); q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle --cycle); b = (p -- subpath(2,6) of circle -- cycle);
That should be: b = (reverse p -- subpath(2,6) of circle -- cycle); Best wishes, Taco
![](https://secure.gravatar.com/avatar/d7c3317235884569312c31f786d43bbc.jpg?s=120&d=mm&r=g)
Hello Taco
Thank you so much ; I did not know the reverse operator.
Fabrice
Le jeu. 23 juil. 2020 à 11:56, Taco Hoekwater
On 23 Jul 2020, at 11:48, Fabrice Couvreur
wrote: Hello, I have a little problem with coloring an area (path b). Thanks for your help. Fabrice
\starttext \startMPcode
path circle, p, q, b;
circle = fullcircle xscaled 6cm yscaled 3.5cm; p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. point 6 of circle); q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle --cycle); b = (p -- subpath(2,6) of circle -- cycle);
That should be:
b = (reverse p -- subpath(2,6) of circle -- cycle);
Best wishes, Taco
___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
participants (2)
-
Fabrice Couvreur
-
Taco Hoekwater