cvdlab/plasm.js — pull request #25 by vittorioc (2012-06-05 22:59:07+00:00)
Title: Added COONS_PATCH

Example:

var dom1D = INTERVALS(1)(32);
var dom2D = PROD1x1([INTERVALS(1)(16),INTERVALS(1)(16)]);

var Su0 = BEZIER(S0)([[0,0,0],[10,0,0]]);
var curve0 = MAP(Su0)(dom1D);
DRAW(curve0);

var Su1 = BEZIER(S0)([[0,10,0],[2.5,10,3],[5,10,-3],[7.5,10,3],[10,10,0]]);
var curve1 = MAP(Su1)(dom1D);
DRAW(curve1);

var control2 = [[0,0,0],[0,0,3],[0,10,3],[0,10,0]];
var Sv0 = BEZIER(S1)(control2);
var curve2 = MAP(BEZIER(S0)(control2))(dom1D);
DRAW(curve2);

var control3 = [[10,0,0],[10,5,3],[10,10,0]];
var Sv1 = BEZIER(S1)(control3);
var curve3 = MAP( BEZIER(S0)(control3))(dom1D);
DRAW(curve3);

var out = MAP(COONS_PATCH([Su0,Su1,Sv0,Sv1]))(dom2D);
DRAW(out);