📄 draw_geom.m
字号:
function out = draw_geom(G, varargin)
% out = DRAW_GEOM(oGd, ...)
% Draws the geometry described by oGd. Scales the axes to show the whole
% geometry. Relables x and y axes.
% DRAW_GEOM(oGd, 'noaxischange') does not scale the axes.
% DRAW_GEOM(oGd, 'nolabel') does not relabel the axes.
% DRAW_GEOM(oGd, 'nothing') does neither.
global FontSize
fs = FontSize;
bAxesCh = 1;
bLabel = 1;
if nargin == 2
if strcmp(varargin{1}, 'nolabel')
bLabel = 0;
end
if strcmp(varargin{1}, 'noaxischange')
bAxesCh = 0;
end
if strcmp(varargin{1}, 'nothing')
bAxesCh = 0;
bLabel = 0;
end
end
nCurves = G.nSd-1;
fs = 15;
n = 100;
if bAxesCh
hold off
else
hold on
end
for iCurve = 1:nCurves
curve = G.curveArray(iCurve);
cs = curve.cs;
s = linspace(cs.breaks(1), cs.breaks(end) ,n);
mF = ppval(cs, s);
vSx = mF(1,:);
vSy = mF(2,:);
vSx = vSx+curve.xc;
vSy = vSy+curve.yc;
plot(vSx, vSy,'b', 'linewidth', 1)
hold on
% if bLabel
% fixfonts(text(curve.xc, curve.yc, '\epsilon_{r2}'), fs/1.2);
% end
end
fixfonts(gca, fs)
xlabel('x[m]')
ylabel('y[m]')
set(gca, 'ydir', 'normal')
if bAxesCh
axis equal
ax = axis;
axis(expand_axis(ax,1.2));
end
hold off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -