~ubuntu-branches/ubuntu/precise/octave-nurbs/precise

« back to all changes in this revision

Viewing changes to inst/nrbrect.m

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Weber
  • Date: 2011-04-20 21:53:46 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110420215346-mtrs63hlmsh5yuaz
Tags: 1.3.3-1
* New upstream release
* Bump standards version to 3.9.1, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
function curve = nrbrect(w,h)
2
2
3
 
% NRBRECT: Construct NURBS representation of a rectangle.
 
3
% NRBRECT: Construct NURBS representation of a rectangular curve.
4
4
5
5
% Calling Sequence:
6
6
8
8
%   crv = nrbrect(size)
9
9
%   crv = nrbrect(width, height)
10
10
11
 
% Parameters:
12
 
13
 
%   size                : Size of the square (width = height).
14
 
15
 
%   width               : Width of the rectangle (along x-axis).
 
11
% INPUT:
 
12
 
13
%   size        : Size of the square (width = height).
 
14
 
15
%   width       : Width of the rectangle (along x-axis).
16
16
17
17
%   height      : Height of the rectangle (along y-axis).
18
 
 
18
%
 
19
% OUTPUT:
 
20
%
19
21
%   crv         : NURBS curve, see nrbmak. 
20
22
%  
21
23
24
26
%   Construct a rectangle or square in the x-y plane with the bottom
25
27
%   lhs corner at (0,0,0). If no rhs arguments provided the function
26
28
%   constructs a unit square.
 
29
%
 
30
%    Copyright (C) 2000 Mark Spink
 
31
%
 
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.
27
36
 
28
 
%  D.M. Spink
29
 
%  Copyright (c) 2000.
 
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.
 
41
%
 
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/>.
30
44
 
31
45
if nargin < 1
32
46
   w = 1;
45
59
knots  = [0 0 0.25 0.25 0.5 0.5 0.75 0.75 1 1];
46
60
 
47
61
curve = nrbmak(coefs, knots);
 
62
 
 
63
end
 
64
 
 
65
%!demo
 
66
%! crv = nrbtform(nrbrect(2,1), vecrotz(deg2rad(35)));
 
67
%! nrbplot(crv,4);
 
68
%! axis equal
 
69
%! title('Construction and rotation of a rectangular curve.');
 
70
%! hold off
 
 
b'\\ No newline at end of file'