Sample points between two Bezier curves

168 Views Asked by At

I am looking for a way to randomly pick points between two Bezier curves (red and greenhttps://drive.google.com/file/d/1aRIOFf6-zzInadZg3yusyAroXGsAGz4P/view?usp=sharing). I also have a set of points on the two curves and I would like to have an equation that gives me a point between these two curves. Maybe something similar to selecting a random point between two given points.

I hope I was able to convey my point.

Thank you very much.

2

There are 2 best solutions below

0
On

Not an answer, but I need images to illustrate the point

The question is, at present, extremely ambiguous. For instance, for the two curves shown here, which of the dots in the figure are "between" the curves? enter image description here

1
On

This is not an answer as such, but I try doing this as John Hughes has done to help you to communicate with us what you really desire. You will see below two (cubic) Bezier curves (red and blue), and intermediate curves in between, based on a barycentric evolution. Are you interested by picking a point at random on one of these curves itself chosen at random ?

Matlab program (based on complex numbers representation) below.

enter image description here

   clear all;close all;hold on
   A1=1+4i;B1=2+2i;C1=3+2.5i;D1=2+0.5i;
   A2=A1+(1+i);B2=B1+(2+3i);C2=C1+(1+i);D2=D1+(1+i);
   t=0:0.01:1;s=1-t;
   for k=0:0.1:1
      A=(k*A1+(1-k)*A2);B=(k*B1+(1-k)*B2);
      C=(k*C1+(1-k)*C2);D=(k*D1+(1-k)*D2);
      plot(A*s.^3+3*B*s.^2.*t+3*C*s.*t.^2+D*t.^3,'color',[k,0,1-k])
   end;