-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnrbextrude.m
48 lines (43 loc) · 1.08 KB
/
nrbextrude.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
function srf = nrbextrude(curve,vector)
%
% Function Name:
%
% nrbextrude - Construct a NURBS surface by extruding a NURBS curve.
%
% Calling Sequence:
%
% srf = nrbextrude(crv,vec);
%
% Parameters:
%
% crv : NURBS curve to extrude, see nrbmak.
%
% vec : Vector along which the curve is extruded.
%
% srf : NURBS surface constructed.
%
% Description:
%
% Constructs a NURBS surface by extruding a NURBS curve along a defined
% vector. The NURBS curve forms the U direction of the surface edge, and
% extruded along the vector in the V direction. Note NURBS surfaces cannot
% be extruded.
%
% Examples:
%
% Form a hollow cylinder by extruding a circle along the z-axis.
%
% srf = nrbextrude(nrbcirc, [0,0,1]);
% D.M. Spink
% Copyright (c) 2000.
if iscell(curve.knots)
error('Nurb surfaces cannot be extruded!');
end
if nargin < 2
error('Error too few input arguments!');
end
if nargin == 3
dz = 0.0;
end
coefs = cat(3,curve.coefs,vectrans(vector)*curve.coefs);
srf = nrbmak(coefs,{curve.knots [0 0 1 1]});