1 function curve = nrbrect(w,h)
3 % NRBRECT: Construct NURBS representation of a rectangular curve.
9 % crv = nrbrect(width, height)
13 % size : Size of the square (width = height).
15 % width : Width of the rectangle (along x-axis).
17 % height : Height of the rectangle (along y-axis).
21 % crv : NURBS curve, see nrbmak.
26 % Construct a rectangle or square in the x-y plane with the bottom
27 % lhs corner at (0,0,0). If no rhs arguments provided the function
28 % constructs a unit square.
30 % Copyright (C) 2000 Mark Spink
32 % This program is free software: you can redistribute it and/or modify
33 % it under the terms of the GNU General Public License as published by
34 % the Free Software Foundation, either version 2 of the License, or
35 % (at your option) any later version.
37 % This program is distributed in the hope that it will be useful,
38 % but WITHOUT ANY WARRANTY; without even the implied warranty of
39 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 % GNU General Public License for more details.
42 % You should have received a copy of the GNU General Public License
43 % along with this program. If not, see <http://www.gnu.org/licenses/>.
54 coefs = [0 w w w w 0 0 0;
59 knots = [0 0 0.25 0.25 0.5 0.5 0.75 0.75 1 1];
61 curve = nrbmak(coefs, knots);
66 %! crv = nrbtform(nrbrect(2,1), vecrotz(deg2rad(35)));
69 %! title('Construction and rotation of a rectangular curve.');