{"id":1738,"date":"2014-03-23T14:21:18","date_gmt":"2014-03-23T13:21:18","guid":{"rendered":"http:\/\/blog.modelical.com\/?p=521"},"modified":"2022-03-21T12:42:42","modified_gmt":"2022-03-21T11:42:42","slug":"grasshopper-scripting-106","status":"publish","type":"post","link":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/","title":{"rendered":"Grasshopper Scripting 106"},"content":{"rendered":"<h2>Loops (II)<\/h2>\n<p>In the previous lesson we introduced some loops. Working with basic variables is interesting but I wanted to introduce a new variable type that will give more meaning to all this scripting effort. Point3d is a Rhino specific variable type. As a part of the RhinoCommon library, Point3d will allow us to create and represent points and use them as the base for much more interesting geometry.<\/p>\n<p>Download\u00a0<a title=\"Loops 2\" href=\"https:\/\/www.modelical.com\/wp-content\/uploads\/2014\/03\/B10_GHS_106_Loops_Points.zip\">here the GH file (0.9.014) containing the examples.<\/a><\/p>\n<h3>The Point3d Class<\/h3>\n<p>Point3d is part of the RhinoCommon library. Being a Reference-Type class, we should declare it as we did with lists.<\/p>\n<pre class=\"lang:c# decode:true\">Point3d myPoint = new Point3d();<\/pre>\n<p>Let&#8217;s create a point from scratch with components:<\/p>\n<pre class=\"lang:c# decode:true\">private void RunScript(ref object A)\r\n  {\r\n    Point3d myPoint = new Point3d();\r\n    myPoint.X = 1.0; \/\/set the X property\r\n    myPoint.Y = 3.0; \/\/set the Y property\r\n    myPoint.Z = 4.0; \/\/set the Z property\r\n    A = myPoint;\r\n  }<\/pre>\n<p>We can do the whole thing if we pass the coordinates to the constructing sentence:<\/p>\n<pre class=\"lang:c# decode:true\"> private void RunScript(ref object A)\r\n  {\r\n    Point3d myPoint = new Point3d(1.0, 3.0, 4.0);\r\n\r\n    A = myPoint;\r\n  }<\/pre>\n<p><strong>\u00a0A Spiral<\/strong><\/p>\n<p>Mixing point lists and loops we can start building familiar curves.<\/p>\n<pre class=\"lang:c# decode:true\">private void RunScript(ref object A)\r\n  {\r\n    \/\/declare a point list\r\n    List&lt;Point3d&gt; myPtList = new List&lt;Point3d&gt;();\r\n    \/\/declare variables for each coordiate\r\n    double Xcoord, Ycoord, Zcoord;\r\n    \/\/set the radius, this could be an input variable\r\n    double radius = 10.0;\r\n    \/\/build a buffer point\r\n    Point3d myPt;\r\n    \/\/start the loop, the number of points could also be an input variable\r\n    for (int i = 0; i &lt; 100; i++){\r\n      \/\/calculate each coordinate\r\n      Xcoord = radius * Math.Cos(Math.PI * 2 * i \/ 100);\r\n      Ycoord = radius * Math.Sin(Math.PI * 2 * i \/ 100);\r\n      Zcoord = i;\r\n      \/\/build a point with the coordinates\r\n      myPt = new Point3d(Xcoord, Ycoord, Zcoord);\r\n      \/\/add the point to the list\r\n      myPtList.Add(myPt);\r\n    }\r\n    \/\/output the list\r\n    A = myPtList;\r\n  }<\/pre>\n<p><strong style=\"line-height: 1.5em;\">Distance Meter<\/strong><\/p>\n<p>The following code takes a point cloud and returns the distance between each of them and a sample point together with the furthest and closest one<\/p>\n<pre class=\"lang:c# decode:true\">  private void RunScript(List&lt;Point3d&gt; x, Point3d y, ref object A, ref object B, ref object C)\r\n  {\r\n    List&lt;double&gt; distList = new List&lt;double&gt;(); \/\/declare the list for holding distances\r\n\r\n    double dist = 0.0; \/\/declare a distance buffer\r\n    double minDist = y.DistanceTo(x[0]); \/\/declare a variable for holding the minimum distance, initialize it with a posssible value\r\n    double maxDist = 0.0; \/\/declare a variable for holding the maximum distance, initialize it at 0.0\r\n\r\n    B = x[0]; \/\/set the B output to something\r\n    C = x[0]; \/\/set the C output to something\r\n\r\n    foreach (Point3d samplePt in x){ \/\/start the loop\r\n\r\n      dist = y.DistanceTo(samplePt); \/\/calculate the distance between y and the sample point\r\n      distList.Add(dist); \/\/add the distance to the list\r\n\r\n      if (dist &lt; minDist){ \/\/if the distance is smaller than the current minimum, we have a new minimum\r\n\r\n        B = samplePt; \/\/output the corresponding point\r\n        minDist = dist; \/\/set the distance as the new minimum\r\n\r\n      }\r\n\r\n      if (dist &gt; maxDist){ \/\/if the distance is larger than the current maximun, we have a new maximum\r\n\r\n        C = samplePt; \/\/output the corresponing point\r\n        maxDist = dist; \/\/set the distance as the new maximum\r\n\r\n      }\r\n    }\r\n\r\n    A = distList; \/\/finally, output the list of distances\r\n  }<\/pre>\n<p>A key aspect here is to initialize the minDist and maxDist variables with the right values. If you pick 0.0 as the initial value for minDist there is no lower value possible, and if you pick a random number, you might be assuming there will be a distance smaller than that number. That is why we pick a real value as the first state.<\/p>\n<h3>Nested Loops<\/h3>\n<p>\nNested loops are loops happening inside other loops. This gives access to complex operations where we need to cross-evaluate certain variables or work with multiple dimensions. It is also worth nothing that nested loops are dangerous if used without care, a loop within a loop within a loop, each one having 100 steps will result in a million calls being processed by the computer, and depending on the case, this could hang your computer without mercy.\n<\/p>\n<p>Let&#8217;s see an example of nested loops to create a grid of points. Keep in mind that each loop needs its iterator.<\/p>\n<pre class=\"lang:c# decode:true\"> private void RunScript(int x, int y, double s, ref object A)\r\n  {\r\n    List&lt;Point3d&gt; ptGrid = new List&lt;Point3d&gt;(); \/\/create a list for the points\r\n    Point3d samplePt; \/\/create a placeholder point\r\n\r\n    for (int i = 0; i &lt; x; i++){ \/\/start outer loop for first coordinate\r\n      for(int j = 0; j &lt; y; j++){ \/\/start inner loop for second coordinate\r\n\r\n        samplePt = new Point3d(i * s, j * s, 0); \/\/create samplePt with x and y coordinates\r\n        ptGrid.Add(samplePt); \/\/add the point to the list\r\n\r\n      }\r\n    }\r\n\r\n    A = ptGrid; \/\/output the list\r\n  }<\/pre>\n<h3>Challenge<\/h3>\n<p>1. Write a component that creates points arranged in the shape of a sphere with Radius R and centered at the origin.<\/p>\n<p>2. Write a component that creates points arranged in the shape of a thorus with radius R1 and R2 and centered at the origin.<\/p>\n<p><strong>[EDIT] Challenge Solutions:<\/strong><\/p>\n<p><strong>Challenge 1. Points Sphere:<\/strong><\/p>\n<pre class=\"lang:c# decode:true\">  private void RunScript(double R, int u, int v, ref object A)\r\n  {\r\n\r\n    List&lt;Point3d&gt; ptList = new List&lt;Point3d&gt;(); \/\/declare a list to hold the points\r\n\r\n    for (int i = 0; i &lt; u; i++){ \/\/outer loop for u subdivisions of the alfa angle, between 0 and 2*PI\r\n      double alfa = Math.PI * 2 * i \/ u;  \/\/calculate alfa as a fraction of 2*PI\r\n\r\n      for (int j = 0; j &lt;= v; j++){ \/\/inner loop for v subdivisions of the beta angle (0 to PI)\r\n\r\n        double beta = Math.PI * j \/ v; \/\/calculate beta as a fraction of PI\r\n\r\n        double ptX = R * Math.Cos(alfa) * Math.Sin(beta); \/\/parametric equation of the sphere\r\n        double ptY = R * Math.Sin(alfa) * Math.Sin(beta);\r\n        double ptZ = R * Math.Cos(beta);\r\n\r\n        Point3d pt = new Point3d(ptX, ptY, ptZ); \/\/create the point\r\n        ptList.Add(pt); \/\/add it to the list\r\n      }\r\n    }\r\n\r\n    A = ptList; \/\/output the list of points\r\n  }<\/pre>\n<p><strong>Challenge 2. Points Torus:<\/strong><\/p>\n<pre class=\"lang:c# decode:true\">  private void RunScript(double R, double r, int u, int v, ref object A)\r\n  {\r\n\r\n    List&lt;Point3d&gt; ptList = new List&lt;Point3d&gt;(); \/\/create a list to hold the points\r\n    for (int i = 0; i &lt; u; i++){ \/\/outer loop\r\n      double alpha = Math.PI * 2 * i \/ u; \/\/calculate alpha as a fraction of 2*PI\r\n\r\n      for (int j = 0; j &lt; v; j++){ \/\/inner loop\r\n\r\n        double beta = Math.PI * 2 * j \/ v; \/\/calculate beta as a fraction of PI\r\n\r\n        double ptX = (R + r * Math.Cos(beta)) * Math.Cos(alpha); \/\/torus equation\r\n        double ptY = (R + r * Math.Cos(beta)) * Math.Sin(alpha);\r\n        double ptZ = r * Math.Sin(beta);\r\n\r\n        Point3d pt = new Point3d(ptX, ptY, ptZ); \/\/create the point\r\n        ptList.Add(pt); \/\/add it to the list\r\n      }\r\n    }\r\n\r\n    A = ptList; \/\/output the list\r\n  }<\/pre>\n<p><strong>\u00a0A little note:<\/strong><\/p>\n<p>Please note that in this two examples, the inner and outer loops can be swapped together and that script would &#8220;build&#8221; the points then following Parallels &gt; Meridians. See the example with the sphere:<\/p>\n<pre class=\"lang:c# decode:true\">private void RunScript(double R, int u, int v, ref object A)\r\n  {\r\n\r\n    List&lt;Point3d&gt; ptList = new List&lt;Point3d&gt;(); \/\/declare a list to hold the points\r\n\r\n    for (int i = 0; i &lt;= u; i++){ \/\/outer loop for u subdivisions of the alfa angle, between 0 and PI\r\n      double alpha = Math.PI * i \/ u;  \/\/calculate alpha as a fraction of PI\r\n\r\n      for (int j = 0; j &lt; v; j++){ \/\/inner loop for v subdivisions of the beta angle (0 to 2*PI)\r\n\r\n        double beta = Math.PI * 2 * j \/ v; \/\/calculate beta as a fraction of 2*PI\r\n\r\n        double ptX = R * Math.Cos(beta) * Math.Sin(alpha); \/\/parametric equation of the sphere\r\n        double ptY = R * Math.Sin(beta) * Math.Sin(alpha);\r\n        double ptZ = R * Math.Cos(alpha);\r\n\r\n        Point3d pt = new Point3d(ptX, ptY, ptZ); \/\/create the point\r\n        ptList.Add(pt); \/\/add it to the list\r\n      }\r\n    }\r\n\r\n    A = ptList; \/\/output the list of points\r\n  }<\/pre>\n<p>Download <a title=\"B10 GHS  Nested Loops Solutions\" href=\"https:\/\/www.modelical.com\/wp-content\/uploads\/2014\/03\/B10_GHS_NestedLoopsChallenges.zip\">the solutions here (GH 0.9.0014)<\/a><\/p>\n<h3>Final Challenge<\/h3>\n<p>Write a component that calculates the first n prime numbers, with n being a reasonable number, not too big.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Loops (II) In the previous lesson we introduced some loops. Working with basic variables is interesting but I wanted to introduce a new variable type that will give more meaning to all this scripting effort. Point3d is a Rhino specific variable type. As a part of the RhinoCommon library, Point3d will allow us to create [&hellip;]<\/p>\n","protected":false},"author":64,"featured_media":27118,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[423,418],"class_list":["post-1738","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guidelines","tag-technology-c","tag-technology-grasshopper"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Grasshopper Scripting 106 - Modelical<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Grasshopper Scripting 106 - Modelical\" \/>\n<meta property=\"og:description\" content=\"Loops (II) In the previous lesson we introduced some loops. Working with basic variables is interesting but I wanted to introduce a new variable type that will give more meaning to all this scripting effort. Point3d is a Rhino specific variable type. As a part of the RhinoCommon library, Point3d will allow us to create [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/\" \/>\n<meta property=\"og:site_name\" content=\"Modelical\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Modelical\/\" \/>\n<meta property=\"article:published_time\" content=\"2014-03-23T13:21:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-21T11:42:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.modelical.com\/wp-content\/uploads\/31_GH.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"375\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Roberto Molinos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@modelical\" \/>\n<meta name=\"twitter:site\" content=\"@modelical\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Roberto Molinos\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/\"},\"author\":{\"name\":\"Roberto Molinos\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#\\\/schema\\\/person\\\/3ad52fd99e6b5b98a59ef24c76a7c2d5\"},\"headline\":\"Grasshopper Scripting 106\",\"datePublished\":\"2014-03-23T13:21:18+00:00\",\"dateModified\":\"2022-03-21T11:42:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/\"},\"wordCount\":451,\"image\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.modelical.com\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/Posts_31_GH_1-400x250-1.jpg\",\"keywords\":[\"Tec C#\",\"Tec Grasshopper\"],\"articleSection\":[\"Guidelines\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/\",\"url\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/\",\"name\":\"Grasshopper Scripting 106 - Modelical\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.modelical.com\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/Posts_31_GH_1-400x250-1.jpg\",\"datePublished\":\"2014-03-23T13:21:18+00:00\",\"dateModified\":\"2022-03-21T11:42:42+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#\\\/schema\\\/person\\\/3ad52fd99e6b5b98a59ef24c76a7c2d5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.modelical.com\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/Posts_31_GH_1-400x250-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.modelical.com\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/Posts_31_GH_1-400x250-1.jpg\",\"width\":400,\"height\":250},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-106\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Grasshopper Scripting 101\",\"item\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/grasshopper-scripting-101\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Grasshopper Scripting 106\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/\",\"name\":\"Modelical\",\"description\":\"We build information\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#\\\/schema\\\/person\\\/3ad52fd99e6b5b98a59ef24c76a7c2d5\",\"name\":\"Roberto Molinos\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9346c12c96cb942be9bb8b2454e296662a1baa0b4cd461ab315ae9a5185b0db6?s=96&d=initials&r=g&initials=ro\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9346c12c96cb942be9bb8b2454e296662a1baa0b4cd461ab315ae9a5185b0db6?s=96&d=initials&r=g&initials=ro\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9346c12c96cb942be9bb8b2454e296662a1baa0b4cd461ab315ae9a5185b0db6?s=96&d=initials&r=g&initials=ro\",\"caption\":\"Roberto Molinos\"},\"sameAs\":[\"https:\\\/\\\/www.modelical.com\"],\"url\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/author\\\/roberto\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Grasshopper Scripting 106 - Modelical","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/","og_locale":"en_US","og_type":"article","og_title":"Grasshopper Scripting 106 - Modelical","og_description":"Loops (II) In the previous lesson we introduced some loops. Working with basic variables is interesting but I wanted to introduce a new variable type that will give more meaning to all this scripting effort. Point3d is a Rhino specific variable type. As a part of the RhinoCommon library, Point3d will allow us to create [&hellip;]","og_url":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/","og_site_name":"Modelical","article_publisher":"https:\/\/www.facebook.com\/Modelical\/","article_published_time":"2014-03-23T13:21:18+00:00","article_modified_time":"2022-03-21T11:42:42+00:00","og_image":[{"width":500,"height":375,"url":"https:\/\/www.modelical.com\/wp-content\/uploads\/31_GH.jpg","type":"image\/jpeg"}],"author":"Roberto Molinos","twitter_card":"summary_large_image","twitter_creator":"@modelical","twitter_site":"@modelical","twitter_misc":{"Written by":"Roberto Molinos","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/#article","isPartOf":{"@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/"},"author":{"name":"Roberto Molinos","@id":"https:\/\/www.modelical.com\/en\/#\/schema\/person\/3ad52fd99e6b5b98a59ef24c76a7c2d5"},"headline":"Grasshopper Scripting 106","datePublished":"2014-03-23T13:21:18+00:00","dateModified":"2022-03-21T11:42:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/"},"wordCount":451,"image":{"@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/#primaryimage"},"thumbnailUrl":"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/04\/Posts_31_GH_1-400x250-1.jpg","keywords":["Tec C#","Tec Grasshopper"],"articleSection":["Guidelines"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/","url":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/","name":"Grasshopper Scripting 106 - Modelical","isPartOf":{"@id":"https:\/\/www.modelical.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/#primaryimage"},"image":{"@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/#primaryimage"},"thumbnailUrl":"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/04\/Posts_31_GH_1-400x250-1.jpg","datePublished":"2014-03-23T13:21:18+00:00","dateModified":"2022-03-21T11:42:42+00:00","author":{"@id":"https:\/\/www.modelical.com\/en\/#\/schema\/person\/3ad52fd99e6b5b98a59ef24c76a7c2d5"},"breadcrumb":{"@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/#primaryimage","url":"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/04\/Posts_31_GH_1-400x250-1.jpg","contentUrl":"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/04\/Posts_31_GH_1-400x250-1.jpg","width":400,"height":250},{"@type":"BreadcrumbList","@id":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-106\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Grasshopper Scripting 101","item":"https:\/\/www.modelical.com\/en\/grasshopper-scripting-101\/"},{"@type":"ListItem","position":2,"name":"Grasshopper Scripting 106"}]},{"@type":"WebSite","@id":"https:\/\/www.modelical.com\/en\/#website","url":"https:\/\/www.modelical.com\/en\/","name":"Modelical","description":"We build information","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.modelical.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.modelical.com\/en\/#\/schema\/person\/3ad52fd99e6b5b98a59ef24c76a7c2d5","name":"Roberto Molinos","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9346c12c96cb942be9bb8b2454e296662a1baa0b4cd461ab315ae9a5185b0db6?s=96&d=initials&r=g&initials=ro","url":"https:\/\/secure.gravatar.com\/avatar\/9346c12c96cb942be9bb8b2454e296662a1baa0b4cd461ab315ae9a5185b0db6?s=96&d=initials&r=g&initials=ro","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9346c12c96cb942be9bb8b2454e296662a1baa0b4cd461ab315ae9a5185b0db6?s=96&d=initials&r=g&initials=ro","caption":"Roberto Molinos"},"sameAs":["https:\/\/www.modelical.com"],"url":"https:\/\/www.modelical.com\/en\/author\/roberto\/"}]}},"_links":{"self":[{"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/posts\/1738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/users\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/comments?post=1738"}],"version-history":[{"count":0,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/posts\/1738\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/media\/27118"}],"wp:attachment":[{"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/media?parent=1738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/categories?post=1738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/tags?post=1738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}