当前位置:网站首页>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
边栏推荐
- catkin_ Make reports an error, transfers the location of the workspace, and uses other people's workspace files to cause compilation errors
- Voice codec based on machine learning Agora silver: support high quality voice interaction at ultra-low bit rate
- Is pioneer futures safe? What are the procedures for opening futures accounts? How to reduce the futures commission?
- 1136: password translation
- Steps for commissioning of vertical machining center
- How to program and process such parts?
- E - highways (minimum spanning tree)
- Repair of incorrect deletion of win10 boot entry
- August 24, 2021 deque queue and stack
- CCF access control system (Full Score code + problem solving idea) 201412-1
猜你喜欢

NPM install --global --save --save dev differences

CCF image rotation (Full Score code + problem solving idea) 201503-01

(Niuke) BFS

Four solutions to cross domain problems

Industry analysis | the future of real-time audio and video

CCF access control system (Full Score code + problem solving idea) 201412-1

Svn password forgetting solution

Developer practice - the future of Agora home AI audio and video

FoxPro and I

CCF call auction (full mark code + problem solving ideas + skill summary) 201412 - 3
随机推荐
Forward declaration of classes
Advanced functions of ES6 operation array map (), filter (), reduce()
Binary rotation array (1)
Matlab finds a prime number that is greater than a given integer and follows this integer
[extensive reading of papers] sentimental analysis of online reviews with a hierarchical attention network
Web technology sharing | whiteboard toolbar encapsulation of Web
C. Registration system(map)
Repair of incorrect deletion of win10 boot entry
浅析卧式加工中心上不规则台阶孔存在问题
M - smooth engineering continuation (minimum spanning tree)
C language \t usage
1015 reversible primes (20 points)
Bucket sorting (C language)
Maximum area of islands searched
Programming exercises: special numbers (problem solving ideas + code implementation)
CCF image rotation (Full Score code + problem solving idea) 201503-01
K - or unblocked project (minimum spanning tree)
Greedy two-dimensional array sorting
Searching for single element in dichotomy
Voice codec based on machine learning Agora silver: support high quality voice interaction at ultra-low bit rate