Hello,
A similar question has been asked on the mailing list and I think it may be easier to answer here: how do you fill a region of the plane defined by the intersection of several curves, given the coordinates of the intersection points ?
If you need the method to be general enough, you have to rely on the actual data of the Polyline. In the below example the points A,B,C are already known and we determine the limits of indices in each Polyline data by finding the closest data point (using the 1-norm):
function k = kinter(h,P)
n = size(h.data,1);
[_,k] = min(sum(abs(h.data-P(ones(n,1),:)),2));
endfunction
t=linspace(0,2*%pi,1024);
clf
c=2*cos(t);
s=2*sin(t);
h=plot(1+c,s,-0.5+c,sqrt(3)/2+s,-0.5+c,-sqrt(3)/2+s)
isoview on
A=(-1+sqrt(13))/2*[1 0];
B=(-1+sqrt(13))/2*[-0.5 sqrt(3)/2];
C=(-1+sqrt(13))/2*[-0.5 -sqrt(3)/2];
k1A = kinter(h(1),A);
k1B = kinter(h(1),B);
k3B = kinter(h(3),B);
k3C = kinter(h(3),C);
k2C = kinter(h(2),C);
k2A = kinter(h(2),A);
data = [
h(1).data(k1A:k1B-1,:)
h(3).data(k3B:k3C-1,:)
h(2).data(k2C:k2A,:)
]
xfpoly(data(:,1),data(:,2),addcolor([1 1 0]))
xstring(A(1),A(2),"A")
xstring(B(1),B(2),"B")
xstring(C(1),C(2),"C")