{"id":1470,"date":"2021-01-10T22:57:46","date_gmt":"2021-01-10T22:57:46","guid":{"rendered":"http:\/\/www.pycheung.com\/weblog\/?p=1470"},"modified":"2021-01-10T22:58:15","modified_gmt":"2021-01-10T22:58:15","slug":"attraction-de-traction-between-types-circle-objects-2","status":"publish","type":"post","link":"https:\/\/www.pycheung.com\/weblog\/post\/1470","title":{"rendered":"Attraction + De-traction between types (circle objects) 2"},"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_collide.gif\" alt=\"\" class=\"wp-image-1471\"\/><\/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 while avoiding overlaps (simple collision detection between circles)<\/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)-&gt; 2<br>2 -(attracts)-&gt; 3<br><br>repell rules:<br>1 -(repells)-&gt; 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\/1470\" class=\"royalwp-readmore\">Explore more <i class=\"far fa-hand-point-right\"><\/i><\/a><\/div>\n","protected":false},"author":2,"featured_media":1471,"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\/1470"}],"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=1470"}],"version-history":[{"count":1,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/1470\/revisions"}],"predecessor-version":[{"id":1472,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/1470\/revisions\/1472"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/media\/1471"}],"wp:attachment":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/media?parent=1470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/categories?post=1470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/tags?post=1470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}