{"id":299574,"date":"2020-03-03T03:00:10","date_gmt":"2020-03-03T03:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=299574"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-03-03T03:00:10","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=299574","title":{"rendered":"Ray Casting Visual Search (RCVS). \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0445\u043e\u0436\u0438\u0445 \u043f\u043e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 3D \u043c\u043e\u0434\u0435\u043b\u0435\u0439"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/490760\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/u2\/8i\/fw\/u28ifwuqbqnlhhiwwldggmtayp4.png\"><\/p>\n<p>  \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u0438 \u0434\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0443 \u043d\u0438\u0445 \u043d\u0435\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u0438\u0445 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e. \u0423 \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0440\u0448\u0438\u043d, \u0440\u0451\u0431\u0435\u0440 \u0438 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u043e\u0432, \u043e\u043d\u0438 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0451\u0440\u043d\u0443\u0442\u044b \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0438 \u0443 \u043e\u0431\u0435\u0438\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 = [0,0,0], \u0412\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445 = [0,0,0], \u041c\u0430\u0441\u0448\u0442\u0430\u0431 = [1,1,1]). \u041a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u0438\u0435?<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0415\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u044b\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0443 Bounding Box, \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432 \u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440, \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0432\u043e\u043a\u0441\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438 \u0432\u043e\u043a\u0441\u0435\u043b\u0435\u0439.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hx\/hk\/m7\/hxhkm7cupsn8fts2jgjmpmqmg3o.png\"><br \/>  <i>\u041e\u0431\u0435\u0437\u044c\u044f\u043d\u043a\u0438 \u0438 \u0438\u0445 \u0432\u043e\u043a\u0441\u0435\u043b\u0438.<\/i><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432\u0434\u043e\u043b\u044c \u043e\u0441\u0435\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0443 Bounding Box, \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432 \u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440, \u043f\u043e\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c \u0438\u0445 \u0441 \u0448\u0435\u0441\u0442\u0438 \u0441\u0442\u043e\u0440\u043e\u043d \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1o\/t1\/g0\/1ot1g00gyan9sroahuclx20bbo0.png\"><br \/>  <i>\u0420\u0435\u043d\u0434\u0435\u0440\u044b \u043a\u0440\u0438\u0432\u0438\u0437\u043d\u044b \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438.<\/i><\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0444\u0435\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442.<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/620\/162\/10d\/62016210d9bf284b2ab12d236e07ddc1.svg\" alt=\"$r = \\sqrt{x^2+y^2+z^2}$\" data-tex=\"display\"><\/math><\/p>\n<p> \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0441\u0447\u0438\u0442\u0430\u043b \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u043e \u0432\u043e\u043a\u0441\u0435\u043b\u0435\u0439 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0441\u043e\u0431\u0438\u0440\u0430\u043b \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b \u044d\u0442\u0438 \u0441\u043f\u0438\u0441\u043a\u0438. \u042d\u0442\u043e \u0434\u0430\u043b\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043d\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043a \u0432\u043e\u043a\u0441\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432. <\/p>\n<h3>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 RCVS<\/h3>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e \u0432\u043e\u043a\u0441\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u043e\u0432, \u043c\u0435\u0442\u043e\u0434 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0431\u0440\u043e\u0441\u0430\u043d\u0438\u0438 \u043b\u0443\u0447\u0435\u0439 (Ray Casting). \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u044c \u0438\u043a\u043e\u0441\u0430\u044d\u0434\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0444\u0435\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u043d\u043e\u0433\u043e\u0433\u0440\u0430\u043d\u043d\u0438\u043a\u0430, \u0438\u0437 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0440\u043e\u0441\u0430\u044e\u0442\u0441\u044f \u043b\u0443\u0447\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0445 \u0434\u043b\u0438\u043d\u0430 (\u0434\u0430\u043b\u0435\u0435 \u043f\u0443\u0442\u044c) \u0434\u043e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u0421\u043f\u0438\u0441\u043a\u0438 \u044d\u0442\u0438\u0445 \u043f\u0443\u0442\u0435\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0438\u043b\u0438 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u043f\u043e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0443\u0442\u0438 \u043b\u0443\u0447\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2e\/in\/it\/2einitowujo6sygimeu5qcsh6ss.gif\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p3\/nn\/gs\/p3nngs1qtrc92rch2wbfylqgkeu.gif\"><br \/>  <i>80 \u0438 1280 \u043b\u0443\u0447\u0435\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/i><\/p>\n<p>  <b>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043e\u0431\u0435\u0437\u044c\u044f\u043d\u043a\u0438 \u0421\u044e\u0437\u0430\u043d\u043d\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445.<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bd\/2x\/0m\/bd2x0mkajcvvj3qlzjeexr1xu6e.png\"><\/p>\n<pre><code class=\"python\">Suzanne_lo                           Suzanne_lo | 1                               Suzanne_lo_rot_rand | 0.9878376875939173                    Suzanne_lo_rot_90 | 0.9800766750109137                  Suzanne_hi_rot_rand | 0.9761078629585936                           Suzanne_hi | 0.9730722945028376                    Suzanne_hi_rot_90 | 0.9680325422930756                                Skull | 0.7697333228143514              Ceramic_Teapot_rot_rand | 0.6634783235048608                       Ceramic_Teapot | 0.6496529954470333                          Grenade_MK2 | 0.5275616759076022 <\/code><\/pre>\n<p>  <\/p>\n<h3>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 RCVS<\/h3>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0448\u0430\u0433\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/o2\/tj\/3o\/o2tj3owsz0_jne4p0nbecptu8zs.png\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p9\/lj\/ty\/p9ljty3f0fmfempfowlegvkiari.png\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wf\/mi\/ws\/wfmiwskrxwqgc4vtuakleiqztg8.png\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yt\/5j\/a8\/yt5ja8yymaxp_1imonuuewwac7u.png\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/b8\/yf\/af\/b8yfafbvbo9xtqldngm-b_rgisg.png\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hq\/z9\/te\/hqz9tekclzhlx6xo2_8fneklf-o.png\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wl\/em\/_8\/wlem_8ibovdfz3pxcydkl_jyrbk.png\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yc\/yp\/im\/ycypimotysn1k1lb5ocqn4zs9mu.png\">  <\/div>\n<\/div>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c 3D \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (\u0434\u0430\u043b\u0435\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432), \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u0430\u043f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 (\u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043d\u0430 Python \u0432 Blender):<\/p>\n<ol>\n<li>\u041d\u0430\u0447\u0430\u043b\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0446\u0435\u043d\u0442\u0440 \u043c\u0430\u0441\u0441\u044b \u043e\u0431\u044a\u0451\u043c\u0430.<\/li>\n<li>\u041e\u0431\u044a\u0435\u043a\u0442 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0444\u0435\u0440\u0443 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u0441 \u0446\u0435\u043d\u0442\u0440\u043e\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/li>\n<li>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/li>\n<li>\u0412\u043e\u043a\u0440\u0443\u0433 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0438\u043a\u043e\u0441\u0430\u044d\u0434\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0444\u0435\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u043d\u043e\u0433\u043e\u0433\u0440\u0430\u043d\u043d\u0438\u043a (\u0434\u0430\u043b\u0435\u0435 \u0438\u043a\u043e\u0441\u0444\u0435\u0440\u0430) \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u044f\u043c\u0438, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u044c. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u043e\u0432 \u0438\u043a\u043e\u0441\u0444\u0435\u0440\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0442\u0435\u0441\u0442\u044b: 80, 320, 1280, 5120, 22480. \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u043e\u0432 \u0438\u043a\u043e\u0441\u0444\u0435\u0440\u044b \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e 1280.<\/li>\n<li>\u0418\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430 \u0438\u043a\u043e\u0441\u0444\u0435\u0440\u044b \u043f\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0443\u0447 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u043f\u0443\u0442\u044c \u0434\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u043e\u0440\u043c\u0430\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043b\u0443\u0447\u0430.<\/li>\n<li>\u041d\u043e\u0440\u043c\u0430\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438.<\/li>\n<li>\u0418\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430 \u0438\u043a\u043e\u0441\u0444\u0435\u0440\u044b \u0435\u0449\u0451 \u0440\u0430\u0437 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0443\u0447\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u0445 \u043f\u0443\u0442\u044c \u0434\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0438 \u0441 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u043e\u0440\u043c\u0430\u043b\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430. (\u042d\u0442\u043e \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044e \u0438\/\u0438\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043b\u0435\u043f\u044b\u0435 \u0437\u043e\u043d\u044b \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043b\u0443\u0447\u0435\u0439)<\/li>\n<li>\u041f\u0443\u0442\u0438 \u043b\u0443\u0447\u0435\u0439, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0443\u044e\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0438, \u0433\u0434\u0435 \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u043f\u0443\u0442\u0438 \u0438\u0437 \u043f\u0443\u043d\u043a\u0442\u0430 5 \u0438 \u0432\u0442\u043e\u0440\u044b\u0435 \u0434\u0432\u0430 \u0438\u0437 \u043f\u0443\u043d\u043a\u0442\u0430 7. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u0443\u0442\u0438 \u0438\u0437 \u043f\u0443\u043d\u043a\u0442\u0430 5 \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0443\u0442\u0438 \u0438\u0437 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 5 \u0438 7 \u043f\u043e\u043f\u0430\u0440\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443.<\/li>\n<li>\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0432\u0441\u0435\u0445 \u043f\u0443\u0442\u0435\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e. \u042d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u0435\u0442 4 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a, \u0440\u0430\u0432\u043d\u043e\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u043e\u0432 \u0438\u043a\u043e\u0441\u0444\u0435\u0440\u044b.<\/li>\n<li>\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043b\u0443\u0447\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b.<\/li>\n<\/ol>\n<p>  <i>\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043b\u0443\u0447\u0435\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/i><\/p>\n<pre><code class=\"python\">0.00271218840585662  0.2112752957162676 0.00271218840585662  0.2112752957162676 0.004740002405006037 0.210980921765861  0.004740002405006037 0.2109809188911709 0.00660892842734402  0.2066613370130234 0.00660892842734402  0.2066613370130234 \u2026 0.2692299271137439   0.2725085782639611 0.2692299271137439   0.2725085782639611 0.2705489991382905   0.2707842753523402 0.270548999138295    0.2707843056356914 0.2709498404192674   0.271036677664217  0.2709498404192674   0.271036642944409<\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u043f\u0443\u0442\u0435\u0439 \u043b\u0443\u0447\u0435\u0439 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c (\u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0430 Rust):<\/p>\n<ol>\n<li>\u0417\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438. \u0412 \u0442\u0435\u0441\u0442\u0430\u0445 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u043c \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0.01, \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 1%.<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f.<\/li>\n<li>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u0438\u0449\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u0437 \u0432\u0442\u043e\u0440\u043e\u0433\u043e, \u043a\u0430\u0436\u0434\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f, \u043e\u043d\u0430 \u043d\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0435. \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0430\u0440\u043d\u0430\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0435\u0434\u0438\u043d\u0438\u0446\u044b, \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u044d\u0442\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0443.<\/li>\n<li>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b \u043f\u043e \u0444\u043e\u0440\u043c\u0435 (\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430) \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u043b\u0438\u0437\u043e\u043a \u043a \u0435\u0434\u0438\u043d\u0438\u0446\u0435.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>\u0411\u0430\u043d\u0430\u043d\u044b, \u0412\u0438\u0442\u0440\u0443\u0432\u0438\u0430\u043d\u0441\u043a\u0438\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f RCVS<\/h3>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u043f\u043e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0441\u043e\u043a\u043e- \u0438 \u043d\u0438\u0437\u043a\u043e-\u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u0418 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0447\u0430\u0439\u043d\u0438\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u0433\u0438\u0442\u0430\u0440\u0430\u043c\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043b\u0443\u0447\u0435\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0432 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/311\/859\/239\/3118592390e0f9aab9dccc8df9420f35.svg\" alt=\"$\\frac{n!}{\\left(\\frac{n}{2}\\right)!}$\" data-tex=\"inline\"><\/math>, \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043f\u043e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u0447\u0451\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 (0.5 \u2014 0.9). \u0412 \u0445\u043e\u0434\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0442\u0430\u043a \u0432\u044b\u0448\u043b\u043e \u0441 \u0431\u0430\u043d\u0430\u043d\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 0.7 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441 \u0441\u0430\u043c\u043e\u043b\u0451\u0442\u0430\u043c\u0438 \u0438 \u043b\u044e\u0434\u044c\u043c\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0437\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 \u201c\u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435\u201d 0.85 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441 \u0442\u0438\u0433\u0440\u0430\u043c\u0438 \u0438 \u0441\u043e\u0431\u0430\u043a\u0430\u043c\u0438. <\/p>\n<p>  \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0442\u043e\u0438\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\/\u0438\u043b\u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438.<\/h3>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u043d\u0430 Python \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u043e\u0432 \u0438\u043a\u043e\u0441\u0444\u0435\u0440\u044b \u0432 Blender<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import bpy import os  name = bpy.context.active_object.data.name  polys = bpy.data.meshes[name].polygons print(&quot;-----&quot;) length = len(polys)  x = 0 p = 0 dict = [] for i in range(0, length):     print(i, &quot;\/&quot;, length)     for l in range(i, length):         norm1 = polys[i].normal         norm2 = polys[l].normal         if norm1 == -norm2:             dict.append(str(i)+&quot;, &quot;+str(l))              p += 1     print(&quot;Polys&quot;, p) basedir = os.path.dirname(bpy.data.filepath) + &quot;\/ico_dicts\/&quot;   if not os.path.exists(basedir):     os.makedirs(basedir) file = open(basedir + &quot;\/&quot; + str(length) + &quot;.csv&quot;,&quot;w&quot;) for poly in dict:           file.write(poly + &quot;\\n&quot;) file.close() print(&quot;----ok----&quot;) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u043d\u0430 Python \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0443\u0442\u0435\u0439 \u043b\u0443\u0447\u0435\u0439 \u0432 Blender.<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import bpy import os from math import sqrt import csv   #Icosphere properties #icosubd: #5 -&gt; 5120 X 2 rays #4 -&gt; 1280 X 2 rays #3 -&gt;  320 X 2 rays #2 -&gt;   80 X 2 rays icosubd = 4 size = 1280 #name of directory radius = 1     def icoRC(icosubd, rad, raydist, normals, target):     icorad = rad     bpy.ops.mesh.primitive_ico_sphere_add(radius=icorad, subdivisions=icosubd, enter_editmode=True, location=(0, 0, 0))     bpy.ops.mesh.normals_make_consistent(inside=normals)     bpy.ops.object.editmode_toggle()           ico = bpy.context.active_object     mesh = bpy.data.meshes[ico.data.name]     rays = []     size = len(mesh.polygons)     for poly in mesh.polygons:         normal = poly.normal         start = poly.center                  ray = target.ray_cast(start, normal, distance=raydist)                if ray[0] == True:             length = sqrt((start[0]-ray[1][0]) ** 2 + (start[1]-ray[1][1]) ** 2 + (start[2]-ray[1][2]) ** 2)             rays.append(length \/ (radius *2))         else:             rays.append(-1)                           result = []     #Combine opposite rays using CSV dicts     dictdir = os.path.dirname(bpy.data.filepath) + &quot;\/ico_dicts\/&quot;     with open(dictdir+str(size)+'.csv', newline='') as csvfile:         ico_dict_file = csv.reader(csvfile, delimiter=',')         for row in ico_dict_file:             result.append([rays[int(row[0])], rays[int(row[1])]])                               bpy.ops.object.select_all(action='DESELECT')     bpy.data.objects[ico.name].select_set(True)      bpy.ops.object.delete()           return result                   #Batch preparation of objects by scale and origin  def batch_prepare():        for obj in bpy.context.selected_objects:         bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_VOLUME', center='MEDIAN')         max_dist = 0         bb = bpy.data.objects[obj.name].bound_box                  for vert in obj.data.vertices:             dist = vert.co[0]**2 + vert.co[1]**2 + vert.co[2]**2             if dist &gt; max_dist:                 max_dist = dist                  obj.scale *= (1 \/ sqrt(max_dist))    def write_rays(dir):       for obj in bpy.context.selected_objects:         bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)                  #Cast rays on object with normals turned inside            bpy.context.view_layer.objects.active  = obj         bpy.ops.object.editmode_toggle()         bpy.ops.mesh.normals_make_consistent(inside=True)         bpy.ops.object.editmode_toggle()         result1 = icoRC(icosubd, radius, radius*2, True, obj)                  #Cast rays on object with normals turned outside          bpy.context.view_layer.objects.active  = obj         bpy.ops.object.editmode_toggle()         bpy.ops.mesh.normals_make_consistent(inside=False)         bpy.ops.object.editmode_toggle()         result2 = icoRC(icosubd, radius, radius*2, True, obj)                  final = []         #Sort sub-lists and append them to main list         for i in range(0, len(result1)):             if result2[i][0] &lt; result2[i][1]:                 final.append([result2[i][0], result2[i][1], result1[i][0], result1[i][1]])             else:                 final.append([result2[i][1], result2[i][0], result1[i][1], result1[i][0]])                                          basedir = os.path.dirname(bpy.data.filepath) + &quot;\/rays\/&quot; + str(size) + &quot;\/&quot;          if not os.path.exists(basedir):             os.makedirs(basedir)         file = open(basedir + &quot;\/&quot; + obj.name,&quot;w&quot;)                  final.sort(key=lambda x: x[0]) #Sort list by first values in sub-lists               #Writing to file            for ray in final:             ray_str = &quot;&quot;             for dist in ray:                    ray_str += str(dist) + &quot; &quot;             file.write(ray_str + &quot;\\n&quot;)          file.close()                    batch_prepare() write_rays(size) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u043d\u0430 Rust \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432.<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"rust\">use rayon; use std::collections::HashSet; use std::fs; use std::io::{BufRead, BufReader, Error, Read};  \/\/Creates Vector from file fn read&lt;R: Read&gt;(io: R) -&gt; Result&lt;Vec&lt;Vec&lt;f64&gt;&gt;, Error&gt; {     let br = BufReader::new(io);     br.lines()         .map(|line| {             line.and_then(|v| {                 Ok(v.split_whitespace()                     .map(|x| match x.trim().parse::&lt;f64&gt;() {                         Ok(value) =&gt; value,                         Err(_) =&gt; -1.0,                     })                     .collect::&lt;Vec&lt;f64&gt;&gt;())             })         })         .collect() }  \/\/Compares two objects fn compare(one: &amp;Vec&lt;Vec&lt;f64&gt;&gt;, two: &amp;Vec&lt;Vec&lt;f64&gt;&gt;, error: f64) -&gt; f64 {     let length = one.len();     let mut count: f64 = 0.0;     let mut seen: HashSet&lt;usize&gt; = HashSet::new();      for orig in one {         let size = orig.len();          for i in 0..length {             if seen.contains(&amp;i) {                 continue;             } else {                 let targ = &amp;two[i];                  if (0..size).map(|x| (orig[x] - targ[x]).abs()).sum::&lt;f64&gt;() &gt; error * size as f64 {                     continue;                 }                  let err_sum = (0..size)                     .map(|x| 1.0 - (orig[x] - targ[x]).abs())                     .sum::&lt;f64&gt;();                  count += err_sum \/ size as f64;                 seen.insert(i);                 break;             }         }     }     count \/ length as f64 }  \/\/Compares one object with others on different threads fn one_with_others(obj: &amp;(String, Vec&lt;Vec&lt;f64&gt;&gt;), dict: &amp;Vec&lt;(String, Vec&lt;Vec&lt;f64&gt;&gt;)&gt;) {     println!(&quot;\\n{:}\\n&quot;, obj.0);     rayon::scope(|s| {         for obj2 in dict {             let obj = obj.clone();             s.spawn(move |_| {                 let result = compare(&amp;obj.1, &amp;obj2.1, 0.01);                 println!(                     &quot;{:&gt;36} |{:&lt;100}| {:&lt;14}&quot;,                     obj2.0,                     &quot;\u25ae&quot;.repeat((result * 100.0) as usize),                     result,                 )             });         }     }); }  fn main() {     let ray = 1280; \/\/name of directory     let obj_cur = &quot;Suzanne_lo&quot;; \/\/name of object      let mut objects = Vec::&lt;(String, Vec&lt;Vec&lt;f64&gt;&gt;)&gt;::new();     let path_rays = format!(&quot;.\/rays\/{:}\/&quot;, ray);     let paths = fs::read_dir(path_rays).unwrap();      let obj_path = format!(&quot;.\/rays\/{:}\/{:}&quot;, ray, obj_cur);     let _obj = (         obj_cur.to_string(),         read(fs::File::open(obj_path).unwrap()).unwrap(),     );      for path in paths {         let dir = &amp;path.unwrap().path();         let name = dir.to_str().unwrap().split(&quot;\/&quot;).last().unwrap();          objects.push((             name.to_string(),             read(fs::File::open(dir).unwrap()).unwrap(),         ));     }      one_with_others(&amp;_obj, &amp;objects); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a href=\"https:\/\/drive.google.com\/file\/d\/1XJ2U-A-QBTwpBp9xvA6aHQP6MX3BUwF6\/view?usp=sharing\" rel=\"nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0438 \u043f\u0440\u043e\u0435\u043a\u0442 Blender \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0446\u0435\u043d\u043e\u0439.<\/a><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oh\/4p\/7s\/oh4p7sqgz6j9ti6xi8pjmg73li4.png\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/490760\/\"> https:\/\/habr.com\/ru\/post\/490760\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/490760\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/u2\/8i\/fw\/u28ifwuqbqnlhhiwwldggmtayp4.png\"><\/p>\n<p>  \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u0438 \u0434\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0443 \u043d\u0438\u0445 \u043d\u0435\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u0438\u0445 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e. \u0423 \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0440\u0448\u0438\u043d, \u0440\u0451\u0431\u0435\u0440 \u0438 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u043e\u0432, \u043e\u043d\u0438 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0451\u0440\u043d\u0443\u0442\u044b \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0438 \u0443 \u043e\u0431\u0435\u0438\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 = [0,0,0], \u0412\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445 = [0,0,0], \u041c\u0430\u0441\u0448\u0442\u0430\u0431 = [1,1,1]). \u041a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u0438\u0435?  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-299574","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299574"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299574\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}