{"id":1462,"date":"2021-01-10T22:48:46","date_gmt":"2021-01-10T22:48:46","guid":{"rendered":"http:\/\/www.pycheung.com\/weblog\/?p=1462"},"modified":"2021-01-10T22:56:07","modified_gmt":"2021-01-10T22:56:07","slug":"attraction-de-traction-between-types-circle-objects","status":"publish","type":"post","link":"https:\/\/www.pycheung.com\/weblog\/post\/1462","title":{"rendered":"Attraction + De-traction between types (circle objects) 1"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"960\" height=\"540\" src=\"http:\/\/www.pycheung.com\/weblog\/wp-content\/uploads\/2021\/01\/circle_attract_repell_ruleset_resized.gif\" alt=\"\" class=\"wp-image-1466\"\/><\/figure>\n\n\n\n<p><a href=\"http:\/\/www.pycheung.com\/weblog\/?p=422\">Attract repell of abstract circle objects by types<\/a> revisted in ghpython <\/p>\n\n\n\n<p>Each circle has a sphere of influence (soi) 30units which is used to locate the other circles within (a bit of a speed up using RTree from gh)<\/p>\n\n\n\n<p>Image shows attract and repell behaviour only (without avoiding overlaps)<\/p>\n\n\n\n<p>3 types of circles with attract rules and repell rules between types<\/p>\n\n\n\n<p>attract rules:<br>1 -(attracts)-> 2<br>2 -(attracts)-> 3<br><br>repell rules:<br>1 -(repells)-> 3<\/p>\n\n\n\n<p>Starting condition: 20 of each type instantiated at random points (for testing only) within the polygon (black line)<\/p>\n\n\n\n<p><strong>Key to image<\/strong><br>Type 1: Orange circle<br>Type 2: Blue circle<br>Type 3: Green circle<br>Sphere of influence: Grey circle<br>Attract between circles: Dotted line<br>Repell between circles: Red line<br>Direction of movement from last frame: Red Arrow<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Attract repell of abstract circle objects by types revisted in ghpython Each circle has a sphere of influence (soi) 30units which is used to locate the other circles within (a&#8230;<\/p>\n<div class=\"royalwp-readmore-wrap\"><a href=\"https:\/\/www.pycheung.com\/weblog\/post\/1462\" class=\"royalwp-readmore\">Explore more <i class=\"far fa-hand-point-right\"><\/i><\/a><\/div>\n","protected":false},"author":2,"featured_media":1466,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[155],"tags":[],"_links":{"self":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/1462"}],"collection":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/comments?post=1462"}],"version-history":[{"count":4,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/1462\/revisions"}],"predecessor-version":[{"id":1469,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/1462\/revisions\/1469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/media\/1466"}],"wp:attachment":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/media?parent=1462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/categories?post=1462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/tags?post=1462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}