{"id":342961,"date":"2022-12-21T03:00:26","date_gmt":"2022-12-21T03:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=342961"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2022-12-21T03:00:26","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=342961","title":{"rendered":"<span>C++ \u0434\u043b\u044f Maya<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>                          \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430<\/h2>\n<p><strong>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0414\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u043c, \u0430 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043c\u043e\u0435\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438.<\/strong>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u043c \u043e\u043f\u044b\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u043b \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0430 C++ \u0434\u043b\u044f Maya.\u0417\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b(\u043c\u0430\u0440\u043a\u0435\u0440\u044b) \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d.\u0421\u043c\u044b\u0441\u043b \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439: \u0412\u044b\u0434\u0435\u043b\u044f\u044f \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430 \u044f \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043c\u0430\u0440\u043a\u0435\u0440\u044b. \u0414\u043b\u044f \u0440\u0443\u043a \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u0434\u043b\u044f \u043d\u043e\u0433 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0438 \u0442.\u0434. \u041f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u0430\u044f \u043e\u0441\u043d\u0430\u0441\u0442\u043a\u0430 .\u0425\u043e\u0442\u044c \u0442\u0435\u043c\u0430 \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00ab\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430\u00bb, \u043e \u0441\u0430\u043c\u043e\u043c \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u044f \u0431\u0440\u0430\u043b \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 .h \u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u0430 main.cpp \u044f \u0443\u043f\u0443\u0449\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0433\u0430\u044e \u0447\u0442\u043e \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0437\u043d\u0430\u043d\u0438\u0439 \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043d\u0430 \u0421++ \u0434\u043b\u044f Maya. \u0422\u0430\u043a \u0436\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b \u0432 \u043a\u043e\u0434\u0435. \u041e\u0431 \u044d\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 Autodesk.\u0421\u0430\u043c\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0440\u0430\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 Maya API \u0438 \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.  <\/p>\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435:<\/strong><\/p>\n<ol>\n<li>\n<p> \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u0432\u0441\u0435\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0437\u043b\u043e\u0432 transform \u0438 shape.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438\u043a\u043e\u043d\u043a\u0438 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0438\u043e\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u043d\u0430.  <\/p>\n<\/li>\n<\/ol>\n<h3>1. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430<\/h3>\n<p>\u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u0432\u043e\u0439 \u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0432\u0437\u044f\u0432 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u00a0<abbr class=\"habraabbr\" data-abbr=\"FootPrintNode\">FootPrintNode<\/abbr>\u00a0\u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043b\u044f\u00a0<abbr class=\"habraabbr\" data-abbr=\"Maya\">Maya<\/abbr>. \u041c\u043e\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b9f\/008\/fc8\/b9f008fc8a79a7c6788d5a6d0724e49a.png\" width=\"1179\" height=\"725\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b9f\/008\/fc8\/b9f008fc8a79a7c6788d5a6d0724e49a.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u00a0<abbr class=\"habraabbr\" data-abbr=\"FootPrintNode\">FootPrintNode<\/abbr>\u00a0\u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0438 \u043a\u0430\u0436\u0434\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u0441\u043f\u043b\u043e\u0448\u043d\u0443\u044e \u0437\u0430\u043b\u0438\u0432\u043a\u0443. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043e\u0434\u043d\u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u0438 \u0436\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438.\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u0441\u0442\u043e\u0442\u0435\u043b\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u044f \u043a\u0430\u0436\u0434\u0443\u044e \u043b\u0438\u043d\u0438\u044e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u043b \u043e\u0434\u043d\u0443 \u0438\u0437 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439. \u041a\u0430\u0436\u0434\u0430\u044f \u043b\u0438\u043d\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u0442\u0440\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0442\u0430\u043a \u0436\u0435 \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.  <\/p>\n<pre><code class=\"cpp\">static double fLocator_0[][3] = { { 0.000000f, 1.000000f, 0.000000f },                                    { 0.000000f, 0.866025f, 0.500000f },                                    { 0.000000f, 1.000000f, 0.000000f } };<\/code><\/pre>\n<p>\u0412 \u043c\u043e\u0435\u043c \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435 36 \u043b\u0438\u043d\u0438\u0439, \u043e\u0442 0 \u0434\u043e 35.  <\/p>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0432 \u043a\u043e\u0434\u0435 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0447\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b &#8212; \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0438\u043b \u043d\u0430 \u0442\u0440\u0438 \u0447\u0430\u0441\u0442\u0438: main.cpp \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u044c\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430,\u00a0<abbr class=\"habraabbr\" data-abbr=\".cpp\">.cpp<\/abbr>\u00a0\u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\".h\">.h<\/abbr>\u00a0\u0437\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u0438\u043b. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u043a\u043e\u0434(\u043b\u043e\u043a\u0430\u0442\u043e\u0440) \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435, \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043d\u0435 \u043e\u0434\u043d\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c, \u0430 \u0431\u044b\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430.  <\/p>\n<h3>2. \u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0442\u0435\u043a\u0441\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442<\/h3>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u0432\u0435\u0440\u0448\u0438\u043d \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u043d\u0430 \u044d\u0442\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445.  <\/p>\n<pre><code class=\"cpp\">int vertCount = 0, vertIndex = 0;<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u043a\u0430\u043a \u043e\u0441\u043d\u0430\u0432\u043d\u044b\u0435 \u0442\u0430\u043a \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.  <\/p>\n<pre><code class=\"cpp\">MDoubleArray allX; allX.clear(); MDoubleArray allY; allY.clear(); MDoubleArray allZ; allZ.clear();  MDoubleArray oneBuferX; oneBuferX.clear(); MDoubleArray twoBuferX; twoBuferX.clear(); MDoubleArray tempAllX; tempAllX.clear();  MDoubleArray oneBuferY; oneBuferY.clear(); MDoubleArray twoBuferY; twoBuferY.clear(); MDoubleArray tempAllY; tempAllY.clear();  MDoubleArray oneBuferZ; oneBuferZ.clear(); MDoubleArray twoBuferZ; twoBuferZ.clear(); MDoubleArray tempAllZ; tempAllZ.clear();  MString txt; MPoint pt; MPointArray posArray; posArray.clear();<\/code><\/pre>\n<blockquote>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0442\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432\u00a0MDoubleArray, \u0430 \u043d\u0435\u00a0double. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0438\u0436\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0447\u0435\u043c\u0443.<\/em>  <\/p>\n<\/blockquote>\n<p>\u0414\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0442\u0435\u043a\u0441\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"cpp\">MDagPath dagPath; MObject component;  MSelectionList selection; MGlobal::getActiveSelectionList(selection); MItSelectionList iter(selection, MFn::kMeshVertComponent);  iter.getDagPath(dagPath, component);  if (component.isNull()) { displayError(\"Nothing is selected or no vertex is selected\"); return MS::kFailure; }  for (; !iter.isDone(); iter.next()) { iter.getDagPath(dagPath, component); MItMeshVertex meshIter(dagPath, component, &amp;status);  if (status == MS::kSuccess) { vertCount += meshIter.count();                                for (; !meshIter.isDone(); meshIter.next()) { pt = meshIter.position(MSpace::kWorld); posArray.append(MPoint(pt.x, pt.y, pt.z));  } } }<\/code><\/pre>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u00a0<abbr class=\"habraabbr\" data-abbr=\"MDagPath\">MDagPath<\/abbr>,<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"MObject\">MObject<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"MSelectionList\">MSelectionList<\/abbr>. \u0418\u043c\u0435\u043d\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"dagPath\">dagPath<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"component\">component<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"selection\">selection<\/abbr>\u00a0\u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043b\u044e\u0431\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"cpp\">MDagPath dagPath; MObject component;  MSelectionList selection;<\/code><\/pre>\n<p><abbr class=\"habraabbr\" data-abbr=\"getActiveSelectionList\">getActiveSelectionList<\/abbr>\u00a0\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"selection\">selection<\/abbr>\u00a0\u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.  <\/p>\n<pre><code class=\"cpp\">    MGlobal::getActiveSelectionList(selection); <\/code><\/pre>\n<p><abbr class=\"habraabbr\" data-abbr=\"iter\">iter<\/abbr>\u00a0\u0438\u043c\u0435\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u043d \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u0435\u043d\u0442\u043e\u0432 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0445 \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"selection\">selection<\/abbr>.  <\/p>\n<pre><code class=\"cpp\">   MItSelectionList iter(selection, MFn::kMeshVertComponent); <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">   MItSelectionList iter(selection);  <\/code><\/pre>\n<p>\u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"selection\">selection<\/abbr>\u00a0\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u044c\u0441\u044c \u0431\u044b \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0431\u044b \u0443\u0436\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0446\u0438\u043a\u043b\u0435. \u041d\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f.<\/p>\n<p>\u0421\u0442\u0430\u0432\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u043d\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<pre><code class=\"cpp\">iter.getDagPath(dagPath, component);  if (component.isNull()) { displayError(\"Nothing is selected or no vertex is selected\"); return MS::kFailure; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u043d\u0430 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u0432\u0435\u0440\u0448\u0438\u043d\u044b. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0430\u043a \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0440\u0430\u043d\u043d\u0435, \u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MItMeshVertex\">MItMeshVertex<\/abbr>\u00a0\u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435. \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u0432 component \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b, \u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MItMeshVertex\u00a0meshIter(dagPath, component, &amp;status);\">MItMeshVertex\u00a0meshIter(dagPath, component, &amp;status);<\/abbr>\u00a0\u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 component \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"meshIter\">meshIter<\/abbr>\u00a0\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0448\u0438\u043d.<\/p>\n<pre><code class=\"cpp\">for (; !iter.isDone(); iter.next()) { iter.getDagPath(dagPath, component); MItMeshVertex meshIter(dagPath, component, &amp;status);  if (status == MS::kSuccess) {<\/code><\/pre>\n<blockquote>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430\u00a0+=\u00a0\u0432 \u0441\u0442\u0440\u043e\u043a\u0435\u00a0vertCount += meshIter.count();. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 \u0441\u0441\u0443\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c.<\/em><\/p>\n<\/blockquote>\n<pre><code class=\"cpp\">    vertCount += meshIter.count();<\/code><\/pre>\n<p>\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0446\u0438\u043a\u043b \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<abbr class=\"habraabbr\" data-abbr=\"MPoint pt\">MPoint pt<\/abbr>. \u0412<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"pt\">pt<\/abbr><strong>\u00a0<\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b\u00a0<abbr class=\"habraabbr\" data-abbr=\"X\">X<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"Y\">Y<\/abbr>\u00a0\u0438<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"Z\">Z<\/abbr>. \u0417\u0430\u0442\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0438\u043f\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MPointArray\">MPointArray<\/abbr>.<\/p>\n<pre><code class=\"cpp\">vertCount += meshIter.count();  for (; !meshIter.isDone(); meshIter.next()) { pt = meshIter.position(MSpace::kWorld); posArray.append(MPoint(pt.x, pt.y, pt.z));   } } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0434\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u043c\u0435\u043d\u0435\u0435 \u0434\u0432\u0443\u0445 \u0432\u0435\u0440\u0448\u0438\u043d. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u0434\u0432\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0433\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.  <\/p>\n<pre><code class=\"cpp\">if (vertCount &lt;= 1) {  MGlobal::displayWarning(MString(\": \") + \"Less than two vertices are selected!\");  return MS::kFailure; }<\/code><\/pre>\n<h3>3. \u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u0432\u0441\u0435\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u0441\u0430\u043c\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0435\u043a\u043e\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430 \u0432\u0441\u0435\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c \u0435\u0433\u043e. \u042d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0446\u0435\u043d\u0442\u0440\u0430 \u0432\u0435\u0440\u0448\u0438\u043d.<\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0434\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0446\u0435\u043d\u0442\u0440? \u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0441\u0442, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"Maya\">Maya<\/abbr>\u00a0\u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0448\u0438\u043d \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c\u00a0<abbr class=\"habraabbr\" data-abbr=\"cluster\">cluster<\/abbr>. \u041f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u043d\u0435\u043a\u0438\u0439 \u0440\u0430\u0441\u0447\u0435\u0442 \u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"cluster\">cluster<\/abbr>\u00a0\u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u043a\u0430\u043a \u0431\u044b \u0432 \u0446\u0435\u043d\u0442\u0440 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d. \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0443\u0431 \u0438 \u0440\u0430\u0441\u0442\u044f\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0442\u0430\u043a, \u0447\u0442\u043e \u0431\u044b \u043e\u043d \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u0441\u0432\u043e\u044e \u043f\u0435\u0440\u0432\u043e\u043d\u043e\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043a\u0443\u0431\u0430 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0443\u044e \u0440\u0430\u043c\u043a\u0443(<abbr class=\"habraabbr\" data-abbr=\"boundingBox\">boundingBox<\/abbr>). \u0422\u0430\u043a \u0436\u0435 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043a\u0443\u0431\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435\u00a0<abbr class=\"habraabbr\" data-abbr=\"cluster\">cluster<\/abbr>. \u0412\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0447\u0442\u043e \u0446\u0435\u043d\u0442\u0440 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u0439 \u0440\u0430\u043c\u043a\u0438 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b. \u042d\u0442\u0438 \u044d\u043a\u0441\u043f\u0438\u0440\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u044e\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u043e\u0447\u0435\u043c\u0443\u00a0<abbr class=\"habraabbr\" data-abbr=\"cluster\">cluster<\/abbr>\u00a0\u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u0443\u0434\u0430 \u043a\u0443\u0434\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0438 \u0447\u0442\u043e \u043d\u0430\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e \u0431\u044b \u043d\u0430\u0448 \u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u0432 \u044d\u0442\u0443 \u0436\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u044e.\u0422\u043e\u0435\u0441\u0442\u044c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u043e\u0441\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"X\">X<\/abbr>, \u043e\u0441\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"Y\">Y<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"Z\">Z<\/abbr>. \u041f\u043e\u0441\u043b\u0435, \u043d\u0430\u0439\u0442\u0438 \u0438\u0445 \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u0439 \u0440\u0430\u043c\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/56d\/5f7\/773\/56d5f7773df513190a80554aea092d59.png\" width=\"1065\" height=\"759\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/56d\/5f7\/773\/56d5f7773df513190a80554aea092d59.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"C++\">C++<\/abbr>\u00a0\u0434\u043b\u044f\u00a0<abbr class=\"habraabbr\" data-abbr=\"Maya\">Maya<\/abbr>. \u0417\u0434\u0435\u0441\u044c \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<p>\u0427\u0442\u043e \u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041d\u041e! \u0412\u0441\u0435 \u0442\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u0448\u0435\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 double, \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u043d \u044f\u0432\u043d\u043e. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0441, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0438\u043f\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MDoubleArray\">MDoubleArray<\/abbr>\u00a0\u0442\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u0432 \u043a\u0430\u043a\u043e\u043c \u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"C++\">C++<\/abbr>\u00a0\u0441 \u044d\u0442\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435? \u041c\u043e\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0437\u00a0<abbr class=\"habraabbr\" data-abbr=\"MPointArray posArray\">MPointArray posArray<\/abbr>\u00a0\u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b\u00a0<abbr class=\"habraabbr\" data-abbr=\"X\">X<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"Y\">Y<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"Z\">Z<\/abbr>\u00a0\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b\u00a0<abbr class=\"habraabbr\" data-abbr=\"allX\">allX<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"allY\">allY<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"allZ\">allZ<\/abbr>\u00a0\u0442\u0438\u043f\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MDoubleArray\">MDoubleArray<\/abbr>. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c.<\/p>\n<pre><code class=\"cpp\">for (int inArr = 0; inArr &lt; vertCount; inArr++) { allX.append(posArray[inArr].x); allY.append(posArray[inArr].y); allZ.append(posArray[inArr].z);  }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432.<\/p>\n<pre><code class=\"cpp\">    oneBuferX.copy(allX);<\/code><\/pre>\n<blockquote>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0447\u0442\u043e \u0438\u043c\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445, \u0438\u043c\u044f \u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043b\u0435\u0432\u0430.<\/em><\/p>\n<\/blockquote>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043b\u0441\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043e \u0447\u0438\u0441\u043b\u0430. \u0418 \u044d\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0443\u0442\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b. \u0412 \u043a\u043e\u0434\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043f\u0440\u0438\u0432\u0435\u043b \u043d\u0438\u0436\u0435, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435\u00a0<abbr class=\"habraabbr\" data-abbr=\"AllX\">AllX<\/abbr>.<\/p>\n<pre><code class=\"cpp\">int minus = 0;          for (int a = 0; a &lt; 1 + minus; a++) { int nm = oneBuferX.length();  if (nm != 1) { for (int i = 0; i &lt; (vertCount - 1) - minus; i++) { if (oneBuferX[i] &lt; oneBuferX[i + 1]) { twoBuferX.append(oneBuferX[i]); } if (oneBuferX[i] > oneBuferX[i + 1]) { twoBuferX.append(oneBuferX[i + 1]); } if (oneBuferX[i] == oneBuferX[i + 1]) { twoBuferX.append(oneBuferX[i + 1]); } } minus += 1; oneBuferX.clear(); oneBuferX.copy(twoBuferX); twoBuferX.clear(); } if (nm == 1) { break; } } minus = 0;  tempAllX.append(oneBuferX[0]);<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 : | -0.15 | 0.3 | 1.2 | -0.08 |. \u041f\u0435\u0440\u0432\u044b\u0439 \u0446\u0438\u043a\u043b\u00a0<abbr class=\"habraabbr\" data-abbr=\"for\">for<\/abbr>\u00a0\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a \u0447\u0442\u043e \u0431\u044b \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0440\u0430\u0437.<\/p>\n<pre><code class=\"cpp\">int minus = 0;  for (int a = 0; a &lt; 1 + minus; a++) {<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e nm \u0434\u043b\u0438\u043d\u043d\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<pre><code class=\"cpp\">int nm = oneBuferX.length();<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043b\u0438\u043d\u043d\u0430 \u043c\u0430\u0441\u0438\u0432\u0430 \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0435 \u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0446\u0438\u043a\u043b\u00a0<abbr class=\"habraabbr\" data-abbr=\"for\">for<\/abbr>\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u0430 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c | -0.15 \u0438 0.3 |(-0.15), | 0.3 \u0438 1.2 |(0.3), | 1.2 \u0438 -0.08 |(-0.08).<\/p>\n<pre><code class=\"cpp\">if (nm != 1) { for (int i = 0; i &lt; (vertCount - 1) - minus; i++) { if (oneBuferX[i] &lt; oneBuferX[i + 1]) { twoBuferX.append(oneBuferX[i]); } if (oneBuferX[i] > oneBuferX[i + 1]) { twoBuferX.append(oneBuferX[i + 1]); } if (oneBuferX[i] == oneBuferX[i + 1]) { twoBuferX.append(oneBuferX[i + 1]); } }<\/code><\/pre>\n<p>\u0426\u0438\u043a\u043b\u00a0<abbr class=\"habraabbr\" data-abbr=\"for\">for<\/abbr>\u00a0\u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0438 \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439\u00a0<abbr class=\"habraabbr\" data-abbr=\"minus\">minus<\/abbr>\u00a0\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u043f\u0435\u0440\u0432\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0435\u0449\u0435 \u0440\u0430\u0437. \u0418 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u043e\u043a\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u0435\u0434\u0438\u043d\u0438\u0446\u0435.<\/p>\n<pre><code class=\"cpp\">minus += 1;<\/code><\/pre>\n<p>\u0427\u0438\u0441\u0442\u0438\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"oneBuferX\">oneBuferX<\/abbr>, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"twoBuferX\">twoBuferX<\/abbr>\u00a0\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"oneBuferX\">oneBuferX<\/abbr>. \u0427\u0438\u0441\u0442\u0438\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"twoBuferX\">twoBuferX<\/abbr>.<\/p>\n<pre><code class=\"cpp\">oneBuferX.clear(); oneBuferX.copy(twoBuferX); twoBuferX.clear();<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u043d\u0430\u0448 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0435\u0442 \u0432\u0438\u0434 | -0.15 | 0.3 | -0.08 |. \u041f\u043e\u0441\u043b\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0430 | -0.15 | -0.08 |. \u041d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0441\u043b\u043e | -0.08 |. \u041d\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0446\u0438\u043a\u043b\u00a0<abbr class=\"habraabbr\" data-abbr=\"for\">for<\/abbr>\u00a0\u0435\u0449\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0442\u0430\u043a \u043a\u0430\u043a \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439\u00a0<abbr class=\"habraabbr\" data-abbr=\"minus\">minus<\/abbr>\u00a0\u0441\u043d\u043e\u0432\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u0430. \u0422\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0435<\/p>\n<pre><code class=\"cpp\">if (nm == 1) { break; }<\/code><\/pre>\n<p>\u0418 \u0446\u0438\u043a\u043b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u043e \u043e\u0441\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"X\">X<\/abbr>\u00a0| -0.15 |, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"tempAllX\">tempAllX<\/abbr>.<\/p>\n<pre><code class=\"cpp\">tempAllX.append(oneBuferX[0]);<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442. \u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0442\u0438\u043f\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MDoubleArray\">MDoubleArray<\/abbr>\u00a0\u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u0430 double.<\/p>\n<pre><code class=\"cpp\">double mxX = tempAllX[1]; double mnX = tempAllX[0];  double mxY = tempAllY[1]; double mnY = tempAllY[0];  double mxZ = tempAllZ[1]; double mnZ = tempAllZ[0];<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0441\u0435\u0439\u00a0<abbr class=\"habraabbr\" data-abbr=\"X\">X<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"Y\">Y<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"Z\">Z<\/abbr>.<\/p>\n<pre><code class=\"cpp\">double averageX = (mxX + mnX) \/ 2; double averageY = (mxY + mnY) \/ 2; double averageZ = (mxZ + mnZ) \/ 2;<\/code><\/pre>\n<h3>4. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0437\u043b\u0430 transform \u0438 Shape.<\/h3>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u0438\u043c\u044f. \u0421\u0430\u043c\u043e \u0438\u043c\u044f \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043c\u0435\u043d \u0434\u0438\u043e\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0441 \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u0441\u0446\u0435\u043d\u0435 \u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u043c\u0443 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0443 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440.<\/p>\n<p>\u041e\u043a\u043d\u043e \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0438\u043c\u0435\u043d:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/590\/85c\/4d0\/59085c4d096f5c574b89ed09ddebf46a.png\" width=\"348\" height=\"413\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/590\/85c\/4d0\/59085c4d096f5c574b89ed09ddebf46a.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0438\u043c\u044f \u0438\u0437 \u0434\u0438\u043e\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u043d\u0430.<\/p>\n<pre><code class=\"cpp\">MCommandResult result; MStringArray isString; MString melCommand = \"textScrollList - q - selectItem FUCMainTScrolList\"; MGlobal::executeCommand(melCommand, result, false, false); result.getResult(isString);<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0443\u0437\u043d\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0441\u0446\u0435\u043d\u0435.<\/p>\n<pre><code class=\"cpp\">MSelectionList allLocName; MGlobal::clearSelectionList(); MGlobal::selectByName(isString[0] + \"*\"); MGlobal::getActiveSelectionList(allLocName); MGlobal::clearSelectionList();  MDagPath dagSelLocPath; MFnTransform transform; MString checkName; MStringArray nameArr;  MItSelectionList iter(allLocName, MFn::kTransform);  for (; !iter.isDone(); iter.next()) { iter.getDagPath(dagSelLocPath); transform.setObject(dagSelLocPath); checkName = transform.name();  nameArr.append(checkName);  } if (nameArr.length() > 0) { count = nameArr.length() + 1; }<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u043f\u043e \u0441\u0443\u0442\u0438 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<abbr class=\"habraabbr\" data-abbr=\"clearSelectionList\">clearSelectionList<\/abbr>, \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c\u00a0<abbr class=\"habraabbr\" data-abbr=\"selectByName(isString[0] + &quot;*&quot;)\">selectByName(isString[0] + &#171;*&#187;)<\/abbr>, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"allLocName\">allLocName<\/abbr>\u00a0\u0438 \u043e\u043f\u044f\u0442\u044c \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041d\u043e \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043d\u044e\u0430\u043d\u0441. \u0412\u044b\u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043a\u0430\u043a\u00a0<abbr class=\"habraabbr\" data-abbr=\"transform\">transform<\/abbr>\u00a0\u0442\u0430\u043a \u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"Shape\">Shape<\/abbr>. \u0427\u0442\u043e \u0431\u044b \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c\u00a0<abbr class=\"habraabbr\" data-abbr=\"transform\">transform<\/abbr>\u00a0\u043e\u0442\u00a0<abbr class=\"habraabbr\" data-abbr=\"Shape\">Shape<\/abbr>\u00a0\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u00a0<abbr class=\"habraabbr\" data-abbr=\"MFn::kTransform\">MFn::kTransform<\/abbr><strong>.<\/strong>\u00a0\u0418 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"nameArr\">nameArr<\/abbr>\u00a0\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"for\">for<\/abbr>.<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0443 \u043d\u0430\u0441 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"nameArr\">nameArr<\/abbr>\u00a0\u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0443\u043b\u044f, \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"count\">count<\/abbr>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0432 \u0441\u0446\u0435\u043d\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b \u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0438 \u043d\u043e\u043c\u0435\u0440 \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0431\u043e\u043b\u044c\u0448\u0435. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u0438\u043c\u0435\u043d \u043d\u0435\u0442, \u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441 \u0442\u0435\u043c \u043d\u0430\u043c\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 count.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0438\u043c\u044f \u0432 \u043e\u0434\u043d\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430.<\/p>\n<pre><code class=\"cpp\">MString name = MString(isString[0]) + count;<\/code><\/pre>\n<blockquote>\n<p><em>\u0417\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:\u00a0<u>MString name = isString[0] + count<\/u>, \u0442\u043e \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u0438\u043f\u043b\u044e\u0441\u0443\u0435\u0442\u0441\u044f \u043a \u0441\u0442\u0440\u043e\u043a\u0435 \u0438 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0438\u043c\u044f \u0431\u0435\u0437 \u043d\u043e\u043c\u0435\u0440\u0430.<\/em><\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0432 \u0441\u0446\u0435\u043d\u0435.<\/p>\n<pre><code class=\"cpp\">MObject locatorObj = MObject::kNullObj;  locatorObj = dagMod.createNode(0x80007, MObject::kNullObj, &amp;status);  status = dagMod.doIt();<\/code><\/pre>\n<p>\u041d\u0430 \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435? \u041d\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MObject locatorObj\">MObject locatorObj<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"MDagModifier dagMod\">MDagModifier dagMod<\/abbr>.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u00a0<abbr class=\"habraabbr\" data-abbr=\"MObject\">MObject<\/abbr>\u00a0\u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"locatorObj\">locatorObj<\/abbr>\u00a0\u0431\u044b\u043b \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c. \u0410 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MDagModifier\">MDagModifier<\/abbr>\u00a0\u043c\u044b \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"dagMod\">dagMod<\/abbr>\u00a0\u0441\u0430\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430. \u042d\u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u043c\u0435\u043d\u044b \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0430(undoIt \u0438 redoIt). \u041f\u043e\u0441\u043b\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u00a0<abbr class=\"habraabbr\" data-abbr=\"status = dagMod.doIt()\">status = dagMod.doIt()<\/abbr>. \u0422\u0430\u043a \u0436\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0435\u0433\u043e <abbr class=\"habraabbr\" data-abbr=\"id(0x80007)\">id(0x80007)<\/abbr>, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u043d\u043e. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u043c\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0443\u0437\u0435\u043b<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"transform\">transform<\/abbr>\u00a0\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">    MFnDagNode fnLocator(locatorObj);         fnLocator.setName(name);<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0431\u044b \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c\u00a0Shape\u00a0\u0437\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">    MString fNodeName = \"fLocator1\";          MObject nodeShape = getObjFromName(fNodeName, status);      MFnDagNode fnShape(nodeShape);          fnShape.setName(MString(isString[0]) + \"Shape\" + count);<\/code><\/pre>\n<p><abbr class=\"habraabbr\" data-abbr=\"fLocator1\">fLocator1<\/abbr> \u044d\u0442\u043e \u0438\u043c\u044f \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043c\u044b \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <abbr class=\"habraabbr\" data-abbr=\"fNodeName\">fNodeName<\/abbr>.<\/p>\n<blockquote>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0443\u0437\u043b\u043e\u0432, \u0442\u043e \u0443\u0437\u0435\u043b\u00a0<u>transform<\/u>\u00a0\u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0438\u043c\u044f<\/em>\u00a0<em><u>transform1<\/u>, \u0430 \u0443\u00a0<\/em><u>Shape<\/u><em>\u00a0\u0438\u043c\u044f\u00a0<\/em><u>fLocator1<\/u><em>, \u0442\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0437\u0430\u0434\u0430\u043b\u0438 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u00a0<\/em><u>fLocator<\/u><em>\u00a0\u043f\u043b\u044e\u0441 \u0435\u0434\u0438\u043d\u0438\u0446\u0430.<\/em><\/p>\n<\/blockquote>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"getObjFromName\">getObjFromName<\/abbr>\u00a0\u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c &#8212;\u00a0<abbr class=\"habraabbr\" data-abbr=\"fLocator1\">fLocator1<\/abbr>. \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"nodeShape\">nodeShape<\/abbr>. \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c:\u00a0<abbr class=\"habraabbr\" data-abbr=\"fnShape.setName(MString(isString[0]) + &quot;Shape&quot; + count).\">fnShape.setName(MString(isString[0]) + &#171;Shape&#187; + count).<\/abbr><\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043d\u0438\u0436\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f58\/f9a\/25c\/f58f9a25c37e2c0a2b13436a984aed12.png\" width=\"623\" height=\"277\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f58\/f9a\/25c\/f58f9a25c37e2c0a2b13436a984aed12.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>5. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438\u043a\u043e\u043d\u043a\u0438 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u0441 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u043b\u043e\u043a\u0430\u0442\u043e\u0430, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0432\u0435\u0441\u0442\u0438 \u043a\u0440\u0430\u0441\u043e\u0442\u0443, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043a\u043e\u043d\u043a\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"Outliner\">Outliner<\/abbr>\u00a0\u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<pre><code class=\"cpp\"> fnShape.setIcon(\"C:\/path\/iconName.png\");<\/code><\/pre>\n<blockquote>\n<p><em>\u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0435\u043c \u0438\u043a\u043e\u043d\u043a\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0437\u043b\u0443\u00a0<u>Shape<\/u>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043a\u043e\u043d\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0430 \u043d\u0435\u00a0<u>transform<\/u>\u00a0\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432\u00a0<u>Outliner<\/u>.<\/em><\/p>\n<\/blockquote>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/2c3\/fdd\/a0b\/2c3fdda0b06d51d72d2b9e1e4f82a5e2.jpg\" width=\"282\" height=\"45\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2c3\/fdd\/a0b\/2c3fdda0b06d51d72d2b9e1e4f82a5e2.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<h3>6. \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e.<\/h3>\n<p>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043a\u043e\u043d\u043a\u0443 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0446\u0432\u0435\u0442 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u043d\u0443\u0436\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MPlug\">MPlug<\/abbr>.<\/p>\n<pre><code class=\"cpp\">    MPlug setAttrPlug;      setAttrPlug = fnLocator.findPlug(\"overrideEnabled\", true);          setAttrPlug.setBool(1);      setAttrPlug = fnLocator.findPlug(\"overrideRGBColors\", true);          setAttrPlug.setBool(1);      setAttrPlug = fnLocator.findPlug(\"overrideColorR\", true);          setAttrPlug.setDouble(1);      setAttrPlug = fnLocator.findPlug(\"overrideColorG\", true);           setAttrPlug.setDouble(1);      setAttrPlug = fnLocator.findPlug(\"overrideColorB\", true);          setAttrPlug.setDouble(0);<\/code><\/pre>\n<p>\u0421\u043c\u044b\u0441\u043b \u043a\u043e\u0434\u0430 \u0432\u044b\u0448\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b.<\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0430\u0442\u0440\u0435\u0431\u0443\u0442\u044b\u00a0<abbr class=\"habraabbr\" data-abbr=\"translateX\">translateX<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"translateY\">translateY<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"translateZ\">translateZ<\/abbr>, \u043a\u0430\u043a \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435, \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<abbr class=\"habraabbr\" data-abbr=\"MFnTransform\">MFnTransform<\/abbr>\u00a0\u043a\u0430\u043a \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c.<\/p>\n<p><em>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1<\/em>.<\/p>\n<pre><code class=\"cpp\">   setAttrPlug = fnLocator.findPlug(\"translateX\", true);        setAttrPlug.setDouble(averageX);     setAttrPlug = fnLocator.findPlug(\"translateY\", true);        setAttrPlug.setDouble(averageY);     setAttrPlug = fnLocator.findPlug(\"translateZ\", true);        setAttrPlug.setDouble(averageZ);<\/code><\/pre>\n<p><em>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2.<\/em><\/p>\n<pre><code class=\"cpp\">   MSelectionList selectionLoc;        selectionLoc.add(name);     MDagPath dagLocPath;        MFnTransform transformFn;        selectionLoc.getDagPath(0, dagLocPath);     transformFn.setObject(dagLocPath);        transformFn.setTranslation(MVector(averageX, averageY, averageZ), MSpace::kWorld);<\/code><\/pre>\n<h3>7. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u043d\u0430<\/h3>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u043a\u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u044a\u0435\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e\u00a0<abbr class=\"habraabbr\" data-abbr=\"MString.\">MString.<\/abbr><\/p>\n<pre><code class=\"cpp\">   MString cmd;<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439\u00a0<abbr class=\"habraabbr\" data-abbr=\"cmd\">cmd<\/abbr>\u00a0\u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043e\u043a\u043d\u043e. \u0417\u0430\u0442\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<abbr class=\"habraabbr\" data-abbr=\"MString\">MString<\/abbr>\u00a0\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u043a\u043e\u0432\u044b\u0447\u043a\u0438.<\/p>\n<pre><code class=\"cpp\">   MString Command = \"fnyCreateCmd\";         MString winName = \"FunnyMarkerCreate\";<\/code><\/pre>\n<p>\u0412\u00a0<abbr class=\"habraabbr\" data-abbr=\"MEL\">MEL<\/abbr>, \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u043a\u043e\u043d \u0438 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0442.\u043f. \u0432\u0441\u0435 \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0438\u0448\u0443\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0432\u044b\u0447\u043a\u0430\u0445. \u0412\u00a0<abbr class=\"habraabbr\" data-abbr=\"\u0421++\">\u0421++<\/abbr>\u00a0\u0432 \u043a\u043e\u0432\u044b\u0447\u043a\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0432\u0435\u0449\u0438 \u043d\u0435\u043e\u0431\u044a\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<pre><code class=\"cpp\">cmd += MString(\"$FUCWindow = `window -t \" + winName);  MString btLabel = \"Create_Marker\"; cmd += MString((\"string $FUCMainButton = `button -l \")                                        + btLabel + (\" - c\") + Command                                        + (\" - p $FUCMainColumnLay FUCMainButton`;\"));<\/code><\/pre>\n<p>\u0417\u043d\u0430\u043a\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"+=\">+=<\/abbr>\u00a0\u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0447\u0442\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b \u043d\u0435\u0431\u044b\u043b\u043e \u0441\u0442\u0440\u043e\u043a, \u0432\u0441\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u0441\u0443\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<blockquote>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u00a0<u>&#171;Create_Marker&#187;<\/u>\u00a0\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0441 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435\u043c. \u0415\u0441\u043b\u0438 \u0435\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u00a0<u>&#171;Create Marker&#187;<\/u>\u00a0\u0442\u043e\u00a0<u>Maya<\/u>\u00a0\u0431\u0443\u0434\u0435\u0442 \u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u0432\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0440\u0443\u043a \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u043d\u0435 \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435.<\/em><\/p>\n<\/blockquote>\n<p>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u00a0<abbr class=\"habraabbr\" data-abbr=\"executeCommand\">executeCommand<\/abbr>.<\/p>\n<pre><code class=\"cpp\"> MGlobal::executeCommand(cmd);<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043e\u043a\u043d\u0430, \u0442\u043e \u0438\u0445 \u043b\u0443\u0447\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"MEL\">MEL<\/abbr>\u00a0\u0438 \u043f\u043e\u0442\u043e\u043c \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043e\u043a\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0432<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"\u0421++\">\u0421++<\/abbr>.<\/p>\n<h2>                                         \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435\u00a0^^  <\/h2>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \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\/706740\/\"> https:\/\/habr.com\/ru\/post\/706740\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>                          \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430<\/h2>\n<p><strong>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0414\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u043c, \u0430 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043c\u043e\u0435\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438.<\/strong>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u043c \u043e\u043f\u044b\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u043b \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0430 C++ \u0434\u043b\u044f Maya.\u0417\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b(\u043c\u0430\u0440\u043a\u0435\u0440\u044b) \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d.\u0421\u043c\u044b\u0441\u043b \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439: \u0412\u044b\u0434\u0435\u043b\u044f\u044f \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430 \u044f \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043c\u0430\u0440\u043a\u0435\u0440\u044b. \u0414\u043b\u044f \u0440\u0443\u043a \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u0434\u043b\u044f \u043d\u043e\u0433 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0438 \u0442.\u0434. \u041f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u0430\u044f \u043e\u0441\u043d\u0430\u0441\u0442\u043a\u0430 .\u0425\u043e\u0442\u044c \u0442\u0435\u043c\u0430 \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00ab\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430\u00bb, \u043e \u0441\u0430\u043c\u043e\u043c \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u044f \u0431\u0440\u0430\u043b \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 .h \u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u0430 main.cpp \u044f \u0443\u043f\u0443\u0449\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0433\u0430\u044e \u0447\u0442\u043e \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0437\u043d\u0430\u043d\u0438\u0439 \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043d\u0430 \u0421++ \u0434\u043b\u044f Maya. \u0422\u0430\u043a \u0436\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b \u0432 \u043a\u043e\u0434\u0435. \u041e\u0431 \u044d\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 Autodesk.\u0421\u0430\u043c\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0432\u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0440\u0430\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 Maya API \u0438 \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.  <\/p>\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435:<\/strong><\/p>\n<ol>\n<li>\n<p> \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u0432\u0441\u0435\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0437\u043b\u043e\u0432 transform \u0438 shape.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438\u043a\u043e\u043d\u043a\u0438 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0438\u043e\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u043d\u0430.  <\/p>\n<\/li>\n<\/ol>\n<h3>1. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430<\/h3>\n<p>\u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u0432\u043e\u0439 \u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0432\u0437\u044f\u0432 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u00a0<abbr class=\"habraabbr\" data-abbr=\"FootPrintNode\">FootPrintNode<\/abbr>\u00a0\u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043b\u044f\u00a0<abbr class=\"habraabbr\" data-abbr=\"Maya\">Maya<\/abbr>. \u041c\u043e\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0435 \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u00a0<abbr class=\"habraabbr\" data-abbr=\"FootPrintNode\">FootPrintNode<\/abbr>\u00a0\u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0438 \u043a\u0430\u0436\u0434\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u0441\u043f\u043b\u043e\u0448\u043d\u0443\u044e \u0437\u0430\u043b\u0438\u0432\u043a\u0443. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043e\u0434\u043d\u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u0438 \u0436\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438.\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u0441\u0442\u043e\u0442\u0435\u043b\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u044f \u043a\u0430\u0436\u0434\u0443\u044e \u043b\u0438\u043d\u0438\u044e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u043b \u043e\u0434\u043d\u0443 \u0438\u0437 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439. \u041a\u0430\u0436\u0434\u0430\u044f \u043b\u0438\u043d\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u0442\u0440\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0442\u0430\u043a \u0436\u0435 \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.  <\/p>\n<pre><code class=\"cpp\">static double fLocator_0[][3] = { { 0.000000f, 1.000000f, 0.000000f },                                    { 0.000000f, 0.866025f, 0.500000f },                                    { 0.000000f, 1.000000f, 0.000000f } };<\/code><\/pre>\n<p>\u0412 \u043c\u043e\u0435\u043c \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435 36 \u043b\u0438\u043d\u0438\u0439, \u043e\u0442 0 \u0434\u043e 35.  <\/p>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0432 \u043a\u043e\u0434\u0435 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0447\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b &#8212; \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0438\u043b \u043d\u0430 \u0442\u0440\u0438 \u0447\u0430\u0441\u0442\u0438: main.cpp \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u044c\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430,\u00a0<abbr class=\"habraabbr\" data-abbr=\".cpp\">.cpp<\/abbr>\u00a0\u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\".h\">.h<\/abbr>\u00a0\u0437\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u0438\u043b. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u043a\u043e\u0434(\u043b\u043e\u043a\u0430\u0442\u043e\u0440) \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435, \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043d\u0435 \u043e\u0434\u043d\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c, \u0430 \u0431\u044b\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430.  <\/p>\n<h3>2. \u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0442\u0435\u043a\u0441\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442<\/h3>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u0432\u0435\u0440\u0448\u0438\u043d \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u043d\u0430 \u044d\u0442\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445.  <\/p>\n<pre><code class=\"cpp\">int vertCount = 0, vertIndex = 0;<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u043a\u0430\u043a \u043e\u0441\u043d\u0430\u0432\u043d\u044b\u0435 \u0442\u0430\u043a \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.  <\/p>\n<pre><code class=\"cpp\">MDoubleArray allX; allX.clear(); MDoubleArray allY; allY.clear(); MDoubleArray allZ; allZ.clear();  MDoubleArray oneBuferX; oneBuferX.clear(); MDoubleArray twoBuferX; twoBuferX.clear(); MDoubleArray tempAllX; tempAllX.clear();  MDoubleArray oneBuferY; oneBuferY.clear(); MDoubleArray twoBuferY; twoBuferY.clear(); MDoubleArray tempAllY; tempAllY.clear();  MDoubleArray oneBuferZ; oneBuferZ.clear(); MDoubleArray twoBuferZ; twoBuferZ.clear(); MDoubleArray tempAllZ; tempAllZ.clear();  MString txt; MPoint pt; MPointArray posArray; posArray.clear();<\/code><\/pre>\n<blockquote>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0442\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432\u00a0MDoubleArray, \u0430 \u043d\u0435\u00a0double. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0438\u0436\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0447\u0435\u043c\u0443.<\/em>  <\/p>\n<\/blockquote>\n<p>\u0414\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0442\u0435\u043a\u0441\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"cpp\">MDagPath dagPath; MObject component;  MSelectionList selection; MGlobal::getActiveSelectionList(selection); MItSelectionList iter(selection, MFn::kMeshVertComponent);  iter.getDagPath(dagPath, component);  if (component.isNull()) { displayError(\"Nothing is selected or no vertex is selected\"); return MS::kFailure; }  for (; !iter.isDone(); iter.next()) { iter.getDagPath(dagPath, component); MItMeshVertex meshIter(dagPath, component, &amp;status);  if (status == MS::kSuccess) { vertCount += meshIter.count();                                for (; !meshIter.isDone(); meshIter.next()) { pt = meshIter.position(MSpace::kWorld); posArray.append(MPoint(pt.x, pt.y, pt.z));  } } }<\/code><\/pre>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u00a0<abbr class=\"habraabbr\" data-abbr=\"MDagPath\">MDagPath<\/abbr>,<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"MObject\">MObject<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"MSelectionList\">MSelectionList<\/abbr>. \u0418\u043c\u0435\u043d\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"dagPath\">dagPath<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"component\">component<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"selection\">selection<\/abbr>\u00a0\u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043b\u044e\u0431\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"cpp\">MDagPath dagPath; MObject component;  MSelectionList selection;<\/code><\/pre>\n<p><abbr class=\"habraabbr\" data-abbr=\"getActiveSelectionList\">getActiveSelectionList<\/abbr>\u00a0\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"selection\">selection<\/abbr>\u00a0\u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.  <\/p>\n<pre><code class=\"cpp\">    MGlobal::getActiveSelectionList(selection); <\/code><\/pre>\n<p><abbr class=\"habraabbr\" data-abbr=\"iter\">iter<\/abbr>\u00a0\u0438\u043c\u0435\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u043d \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u0435\u043d\u0442\u043e\u0432 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0445 \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"selection\">selection<\/abbr>.  <\/p>\n<pre><code class=\"cpp\">   MItSelectionList iter(selection, MFn::kMeshVertComponent); <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">   MItSelectionList iter(selection);  <\/code><\/pre>\n<p>\u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"selection\">selection<\/abbr>\u00a0\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u044c\u0441\u044c \u0431\u044b \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0431\u044b \u0443\u0436\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0446\u0438\u043a\u043b\u0435. \u041d\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f.<\/p>\n<p>\u0421\u0442\u0430\u0432\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u043d\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<pre><code class=\"cpp\">iter.getDagPath(dagPath, component);  if (component.isNull()) { displayError(\"Nothing is selected or no vertex is selected\"); return MS::kFailure; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u043d\u0430 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u0432\u0435\u0440\u0448\u0438\u043d\u044b. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0430\u043a \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0440\u0430\u043d\u043d\u0435, \u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MItMeshVertex\">MItMeshVertex<\/abbr>\u00a0\u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435. \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u0432 component \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b, \u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MItMeshVertex\u00a0meshIter(dagPath, component, &amp;status);\">>MItMeshVertex\u00a0meshIter(dagPath, component, &amp;status);<\/abbr>\u00a0\u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 component \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"meshIter\">meshIter<\/abbr>\u00a0\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0448\u0438\u043d.<\/p>\n<pre><code class=\"cpp\">for (; !iter.isDone(); iter.next()) { iter.getDagPath(dagPath, component); MItMeshVertex meshIter(dagPath, component, &amp;status);  if (status == MS::kSuccess) {<\/code><\/pre>\n<blockquote>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430\u00a0+=\u00a0\u0432 \u0441\u0442\u0440\u043e\u043a\u0435\u00a0vertCount += meshIter.count();. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 \u0441\u0441\u0443\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c.<\/em><\/p>\n<\/blockquote>\n<pre><code class=\"cpp\">    vertCount += meshIter.count();<\/code><\/pre>\n<p>\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0446\u0438\u043a\u043b \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<abbr class=\"habraabbr\" data-abbr=\"MPoint pt\">MPoint pt<\/abbr>. \u0412<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"pt\">pt<\/abbr><strong>\u00a0<\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b\u00a0<abbr class=\"habraabbr\" data-abbr=\"X\">X<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"Y\">Y<\/abbr>\u00a0\u0438<strong>\u00a0<\/strong><abbr class=\"habraabbr\" data-abbr=\"Z\">Z<\/abbr>. \u0417\u0430\u0442\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0438\u043f\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MPointArray\">MPointArray<\/abbr>.<\/p>\n<pre><code class=\"cpp\">vertCount += meshIter.count();  for (; !meshIter.isDone(); meshIter.next()) { pt = meshIter.position(MSpace::kWorld); posArray.append(MPoint(pt.x, pt.y, pt.z));   } } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0434\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u043c\u0435\u043d\u0435\u0435 \u0434\u0432\u0443\u0445 \u0432\u0435\u0440\u0448\u0438\u043d. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u0434\u0432\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0433\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.  <\/p>\n<pre><code class=\"cpp\">if (vertCount &lt;= 1) {  MGlobal::displayWarning(MString(\": \") + \"Less than two vertices are selected!\");  return MS::kFailure; }<\/code><\/pre>\n<h3>3. \u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u0432\u0441\u0435\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u0441\u0430\u043c\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0435\u043a\u043e\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430 \u0432\u0441\u0435\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c \u0435\u0433\u043e. \u042d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0446\u0435\u043d\u0442\u0440\u0430 \u0432\u0435\u0440\u0448\u0438\u043d.<\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0434\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0446\u0435\u043d\u0442\u0440? \u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0441\u0442, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"Maya\">Maya<\/abbr>\u00a0\u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0448\u0438\u043d \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c\u00a0<abbr class=\"habraabbr\" data-abbr=\"cluster\">cluster<\/abbr>. \u041f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u043d\u0435\u043a\u0438\u0439 \u0440\u0430\u0441\u0447\u0435\u0442 \u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"cluster\">cluster<\/abbr>\u00a0\u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u043a\u0430\u043a \u0431\u044b \u0432 \u0446\u0435\u043d\u0442\u0440 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d. \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0443\u0431 \u0438 \u0440\u0430\u0441\u0442\u044f\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0442\u0430\u043a, \u0447\u0442\u043e \u0431\u044b \u043e\u043d \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u0441\u0432\u043e\u044e \u043f\u0435\u0440\u0432\u043e\u043d\u043e\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043a\u0443\u0431\u0430 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0443\u044e \u0440\u0430\u043c\u043a\u0443(<abbr class=\"habraabbr\" data-abbr=\"boundingBox\">boundingBox<\/abbr>). \u0422\u0430\u043a \u0436\u0435 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043a\u0443\u0431\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435\u00a0<abbr class=\"habraabbr\" data-abbr=\"cluster\">cluster<\/abbr>. \u0412\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0447\u0442\u043e \u0446\u0435\u043d\u0442\u0440 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u0439 \u0440\u0430\u043c\u043a\u0438 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b. \u042d\u0442\u0438 \u044d\u043a\u0441\u043f\u0438\u0440\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u044e\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u043e\u0447\u0435\u043c\u0443\u00a0<abbr class=\"habraabbr\" data-abbr=\"cluster\">cluster<\/abbr>\u00a0\u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u0443\u0434\u0430 \u043a\u0443\u0434\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0438 \u0447\u0442\u043e \u043d\u0430\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e \u0431\u044b \u043d\u0430\u0448 \u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u0432 \u044d\u0442\u0443 \u0436\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u044e.\u0422\u043e\u0435\u0441\u0442\u044c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u043e\u0441\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"X\">X<\/abbr>, \u043e\u0441\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"Y\">Y<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"Z\">Z<\/abbr>. \u041f\u043e\u0441\u043b\u0435, \u043d\u0430\u0439\u0442\u0438 \u0438\u0445 \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u0439 \u0440\u0430\u043c\u043a\u0438.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"C++\">C++<\/abbr>\u00a0\u0434\u043b\u044f\u00a0<abbr class=\"habraabbr\" data-abbr=\"Maya\">Maya<\/abbr>. \u0417\u0434\u0435\u0441\u044c \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<p>\u0427\u0442\u043e \u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041d\u041e! \u0412\u0441\u0435 \u0442\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u0448\u0435\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 double, \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u043d \u044f\u0432\u043d\u043e. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0441, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0438\u043f\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MDoubleArray\">MDoubleArray<\/abbr>\u00a0\u0442\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u0432 \u043a\u0430\u043a\u043e\u043c \u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u0432\u00a0<abbr class=\"habraabbr\" data-abbr=\"C++\">C++<\/abbr>\u00a0\u0441 \u044d\u0442\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435? \u041c\u043e\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0437\u00a0<abbr class=\"habraabbr\" data-abbr=\"MPointArray posArray\">MPointArray posArray<\/abbr>\u00a0\u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b\u00a0<abbr class=\"habraabbr\" data-abbr=\"X\">X<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"Y\">Y<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"Z\">Z<\/abbr>\u00a0\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b\u00a0<abbr class=\"habraabbr\" data-abbr=\"allX\">allX<\/abbr>,\u00a0<abbr class=\"habraabbr\" data-abbr=\"allY\">allY<\/abbr>\u00a0\u0438\u00a0<abbr class=\"habraabbr\" data-abbr=\"allZ\">allZ<\/abbr>\u00a0\u0442\u0438\u043f\u0430\u00a0<abbr class=\"habraabbr\" data-abbr=\"MDoubleArray\">MDoubleArray<\/abbr>. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c.<\/p>\n<pre><code class=\"cpp\">for (int inArr = 0; inArr &lt; vertCount; inArr++) { allX.append(posArray[inArr].x); allY.append(posArray[inArr].y); allZ.append(posArray[inArr].z);  }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432.<\/p>\n<pre><code class=\"cpp\">    oneBuferX.copy(allX);<\/code><\/pre>\n<blockquote>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0447\u0442\u043e \u0438\u043c\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445, \u0438\u043c\u044f \u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043b\u0435\u0432\u0430.<\/em><\/p>\n<\/blockquote>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043b\u0441\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043e \u0447\u0438\u0441\u043b\u0430. \u0418 \u044d\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0443\u0442\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b. \u0412 \u043a\u043e\u0434\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043f\u0440\u0438\u0432\u0435\u043b \u043d\u0438\u0436\u0435, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435\u00a0<abbr class=\"habraabbr\" data-abbr=\"AllX\">AllX<\/abbr>.<\/p>\n<pre><code class=\"cpp\">int minus = 0;          for (int a = 0; a &lt; 1 + minus; a++) { int nm = oneBuferX.length();  if (nm != 1) { for (int i = 0; i &lt; (vertCount - 1) - minus; i++) { if (oneBuferX[i] &lt; oneBuferX[i + 1]) { twoBuferX.append(oneBuferX[i]); } if (oneBuferX[i] > oneBuferX[i + 1]) { twoBuferX.append(oneBuferX[i + 1]); } if<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-342961","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342961","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=342961"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342961\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}