当前位置:网站首页>Npumcm selection question 3 and acmc2020a
Npumcm selection question 3 and acmc2020a
2022-06-30 15:08:00 【A programmer who likes noodles】
One person skipped class for two days and finished it
I did some homework in the middle
Then finish the thesis and optimization at the weekend ...
To put it bluntly, it means filling ...
It seems that the main difficulty lies in programming calculation
Make the most of it matlab Of polyshape
Loop fill
The main use of polybuffer function , The principle of this function is to find the union , And then calculate it layer by layer
But the operation speed is relatively slow
Core code
while ~isempty(polyout.Vertices)% Null intersection terminates the loop
polyout=polybuffer(polyshape(polyout.Vertices(1:end,1:2)),-m);
out(i+1).num=polyout.Vertices;
i=i+1;
end
Judge whether to terminate the loop when the generated point set is empty 
Parallel line fill
This one is filled with a ring , Get new polyshape Object and parallel lines with equal spacing from top to bottom bool Operation function
Core code
for i=1:round((1/m)*round(abs(low(1,2))+upper(1,2)))
line(i).num=[low(1,1),low(1,2)+m*(i-1);upper(1,1),low(1,2)+m*(i-1)];
[inLine(i).num,outLine(i).num] = intersect(polyshape(area),line(i).num);
% plot(inLine1_2(i).num(:,1),inLine1_2(i).num(:,2),'b')% It's strange to paint blue ..
% plot(inLine1_2(i).num(:,1),inLine1_2(i).num(:,2),[mod(i,1),mod(i,2),mod(i,3)])
end
Then we will make two groups , Because all the data obtained are endpoint data xy coordinate , In the middle of the NaN It means to disconnect
Finally, calculate the connection length of each group
How to connect different groups , I don't know much about this , If there is a meeting, please give me some advice 
Generally speaking, not too many algorithms are involved , But the speed of calculation is so slow , My level is limited qwq, To review for the exam + Learning new things
Just thought of how to connect , It can be connected in sections, left and right , Because the order is fixed
边栏推荐
- 高精度CNC加工中心为什么会出现误差?这4个原因你要注意!
- 1076 forwards on Weibo (30 points)
- Determine the number of digits of an integer in MATLAB (one line of code)
- Solve the problem that codeblocks20.03 on win11 cannot run for the first time
- Complement (Niuke)
- Web technology sharing | whiteboard toolbar encapsulation of Web
- Soap comparison result file description
- [untitled]
- Matlab calculates the factorial sum of the first n numbers (easy to understand)
- 这种零件该怎么编程加工?
猜你喜欢

Voice codec based on machine learning Agora silver: support high quality voice interaction at ultra-low bit rate

Tetris source code (color version)

Svn password forgetting solution

Bye civil engineering, hello CS, can you change the certificate to the Blue Bridge Cup

How to get palindrome number in MATLAB (using fliplr function)

Four solutions to cross domain problems

Technology sharing | how to quickly realize audio and video online calls

Repair of incorrect deletion of win10 boot entry

day02

Shangpinhui knowledge points of large e-commerce projects
随机推荐
Matlab draws the image of the larger function value of the two functions (super simple)
001 basic knowledge (unfinished)
Sum of squares of two pointers
立式加工中心调试的步骤
CCF string matching (Full Score code + problem solving ideas + skill summary) March 3, 2014
1105 spiral matrix (25 points)
CCF command line options (Full Score code + problem solving ideas + skill summary) March 3, 2014
Basic requirements for tool use in NC machining of vertical machining center
1148 werewolf - Simple Version (20 points)
立式加工中心的数控加工对刀具使用基本要求
Matlab calculates the factorial sum of the first n numbers (easy to understand)
[matlab] 2D drawing summary
I - constructing roads
CCF Z-scan (full mark code + problem solving ideas) 201412-2
E - highways (minimum spanning tree)
Non decreasing column
How many questions can you answer for the interview of Mechanical Engineer?
Text matching - [naacl 2021] augsbert
2021-08-07 native and package types
Developer practice - the future of Agora home AI audio and video