-
Notifications
You must be signed in to change notification settings - Fork 2
/
nrbcylind.m
52 lines (46 loc) · 1.05 KB
/
nrbcylind.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function surf = nrbcylind(height,radius,center,sang,eang)
%
% Function Name:
%
% nrbcylind - Construct a cylinder or cylindrical patch.
%
% Calling Sequence:
%
% srf = nrbcylind()
% srf = nrbcylind(height)
% srf = nrbcylind(height,radius)
% srf = nrbcylind(height,radius,center)
% srf = nrbcylind(height,radius,center,sang,eang)
%
% Parameters:
%
% height : Height of the cylinder along the axis, default 1.0
%
% radius : Radius of the cylinder, default 1.0
%
% center : Center of the cylinder, default (0,0,0)
%
% sang : Start angle relative to the origin, default 0.
%
% eang : End angle relative to the origin, default 2*pi.
%
%
% Description:
%
% Construct a cylinder or cylindrical patch by extruding a circular arc.
% D.M. Spink
% Copyright (c) 2000.
if nargin < 1
height = 1;
end
if nargin < 2
radius = 1;
end
if nargin < 3
center = [];
end
if nargin < 5
sang = 0;
eang = 2*pi;
end
surf = nrbextrude(nrbcirc(radius,center,sang,eang),[0.0 0.0 height]);