nrbextrude.m

来自「强大的nurbs的工具箱 nurbs曲线」· M 代码 · 共 50 行

M
50
字号
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]});

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?