?? or.m
字號:
function U = or(v1,v2)% Union of two vertices objects %% Syntax:% "vtcs = or(v1,v2)"%% "vtcs = v1 | v2"%% Description:% "or(v1,v2)" returns a vertices object containing all unique points% from "v1" and "v2". %% Examples:% Given a vertices object, "v1" representing a square in the x3 = 0% plane with corners at (x1,x2) pairs (2,1), (2,3), (4,3), and (4,1), %%%% "v2 = ["%% "2 2 4 4"%% "1 3 3 1"%% "2 2 2 2];"%% "vtcs = v1 | v2"%%%% returns "vtcs" a vertices object representing a cube with corners at% (x1,x2,x3) triples (2,1,0), (2,3,0), (4,3,0), (4,1,0), (2,1,2),% (2,3,2), (4,3,2), and (4,1,2).%% See Also:% vertices,and U = vertices; %assumeif ~isa(v2,'vertices') v2 = vertices(v2);endif ~isempty(v1) && ~isempty(v2) && (dim(v1) ~= dim(v2)) disp('VERTICES/OR: different dimensions given') returnend % point_tol = parameters.poly_point_tol;global GLOBAL_APPROX_PARAMpoint_tol = GLOBAL_APPROX_PARAM.poly_point_tol;N1 = length(v1);N2 = length(v2);if (N1 == 0) U = v2; returnendif (N2 == 0) U = v1; returnendU = [v1 v2];noDuplicate = true(length(U),1);for k = 1:N2 found = false; v2k = v2.list(:,k); for l = 1:N1 v1l = v1.list(:,l); diff = (v1l-v2k); if (diff'*diff < point_tol) found = true; break; end end if found noDuplicate(N1+k) = false; endendU = vertices(U.list(:,noDuplicate));
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -