 # 套娃.zip

• 令今争渡
了解作者
• matlab
开发工具
• 79KB
文件大小
• zip
文件格式
• 0
收藏次数
• 10 积分
下载积分
• 0
下载次数
• 2021-02-01 20:58
上传日期 • multiLayer
• dat
• graph1.csv
41.7KB
• graph1.dat
28.8KB
• graph2.csv
58.6KB
• graph2.dat
40.4KB
• main.m
371B
• polymultilayer.m
1.1KB

function C = polymultilayer(x, y, d) % x, y = [mm] coordinates of the polygon's boundaries % d = [mm] boundary distance & hatch line spacing % C = [mm] length of hatching lines % %% 微信公众号：数学模型（MATHmodels） % 联系方式（微信号）KingOfModels figure('position',[50,50,400,600]) p0 = polyshape(x, y); % Create polyshape object plot(p0) % Plot polyshape box on; hold on; axis image; set(gca,'YDir','reverse') pj = p0; j = 1; C = 0; % Initialization length of hatching lines title(['length of hatching lines = ', num2str(C)]) while pj.NumRegions % expands the boundaries of a polyshape by a distance -d*j. When d is % negative, solid boundaries shrink and hole boundaries grow. pj = polybuffer(p0,-d*j); C = C + perimeter(pj); % Get the perimeter of expanded polyshape pj.plot() % Plot polyshape title(['length of hatching lines = ', num2str(C)]); j = j + 1; % add layer drawnow pause(0.5) end 相关推荐