{"action":"created","comment":{"url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/comments/48264229","id":48264229,"diff_hunk":"@@ -0,0 +1,97 @@\n+#\n+# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari\n+# \n+# This file is part of Honeybee.\n+# \n+# Copyright (c) 2013-2015, Sarith Subramaniam <sarith@sarith.in> \n+# Honeybee is free software; you can redistribute it and/or modify \n+# it under the terms of the GNU General Public License as published \n+# by the Free Software Foundation; either version 3 of the License, \n+# or (at your option) any later version. \n+# \n+# Honeybee is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of \n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n+# GNU General Public License for more details.\n+# \n+# You should have received a copy of the GNU General Public License\n+# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.\n+# \n+# @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>\n+\n+\n+\n+\"\"\"\n+Extrude pseudo walls from window polygons. This component has only been tested with rectangular windows.\n+\n+-\n+Provided by Honeybee 0.0.58\n+    \n+\n+    Args:\n+        _glazings: Any number of glazing polygons.\n+        _thickness: Thickness of the window. Can be a single number or a list of numbers. If its a list then the list should be equal to the number of glazings. Default value is 1.0.\n+    Returns:\n+        GlazingWalls: Geometric representations of glazing walls.\n+\"\"\"\n+\n+\n+from __future__ import print_function\n+\n+ghenv.Component.Name = \"Honeybee_Extrude_Windows\"\n+ghenv.Component.NickName = 'ExtrudeWindows'\n+ghenv.Component.Message = 'VER 0.0.58\\nDec_20_2015'\n+ghenv.Component.Category = \"Honeybee\"\n+ghenv.Component.SubCategory = \"12 | WIP\"\n+#compatibleHBVersion = VER 0.0.56\\nFEB_01_2015\n+#compatibleLBVersion = VER 0.0.59\\nFEB_01_2015\n+try: ghenv.Component.AdditionalHelpFromDocStrings = \"1\"\n+except: pass\n+\n+\n+import Rhino as rc\n+import rhinoscriptsyntax as rs\n+import scriptcontext as sc\n+\n+if _thickness and _glazings is not None:\n+    \n+    \n+    #In case a single thickness value is specfied.\n+    try:\n+        if len(_thickness) ==1:\n+            _thickness = _thickness*len(_glazings)\n+    except TypeError:\n+        #In case the value is specified through a slider.\n+        _thickness = [_thickness]*len(_glazings)\n+        \n+    \n+    #Just to ensure that the thickness values are numbers.\n+    _thickness = map(float,_thickness)\n+    \n+    GlazingWalls =[]\n+    tol = sc.doc.ModelAbsoluteTolerance\n+    \n+    for glid,glazing in enumerate(_glazings):\n+        \n+        #Extract surface normal of the glazing, scale the surface normal to the size specified by the _thickness variable\n+        centroid,normal =  rs.SurfaceAreaCentroid(glazing)\n+        closestpoint = rs.SurfaceClosestPoint(glazing,centroid)\n+        surfnormal = rs.SurfaceNormal(glazing,closestpoint)\n+        surfnormalscaled = rs.VectorScale(surfnormal,_thickness[glid])\n+        \n+        #Use the scaled vector to loft to create individual glazing walls.\n+        edges = rs.DuplicateEdgeCurves(glazing)\n+        for segment in edges:\n+            segment = rs.coercecurve(segment)\n+            segmentCopy = segment.DuplicateCurve()\n+            segmentCopy.Translate(surfnormalscaled)\n+            srfs = rc.Geometry.Brep.CreateFromLoft([segment,segmentCopy],\n+            rc.Geometry.Point3d.Unset, rc.Geometry.Point3d.Unset, \\\n+            rc.Geometry.LoftType.Normal, False)\n+            GlazingWalls.extend(srfs)\n+    \n+    #combine everything together.\n+    WindowExtrusions = rc.Geometry.Brep.JoinBreps(GlazingWalls,tol)\n+\n+else:\n+    raise Exception(\"Both the inputs are required for this component to run\")","path":"src/Honeybee_ExtrudeWindows.py","position":97,"original_position":97,"commit_id":"573f81279cbb2fc779298e4a62d2258c62d88f3c","original_commit_id":"573f81279cbb2fc779298e4a62d2258c62d88f3c","user":{"login":"mostaphaRoudsari","id":2915573,"avatar_url":"https://avatars.githubusercontent.com/u/2915573?v=3","gravatar_id":"","url":"https://api.github.com/users/mostaphaRoudsari","html_url":"https://github.com/mostaphaRoudsari","followers_url":"https://api.github.com/users/mostaphaRoudsari/followers","following_url":"https://api.github.com/users/mostaphaRoudsari/following{/other_user}","gists_url":"https://api.github.com/users/mostaphaRoudsari/gists{/gist_id}","starred_url":"https://api.github.com/users/mostaphaRoudsari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mostaphaRoudsari/subscriptions","organizations_url":"https://api.github.com/users/mostaphaRoudsari/orgs","repos_url":"https://api.github.com/users/mostaphaRoudsari/repos","events_url":"https://api.github.com/users/mostaphaRoudsari/events{/privacy}","received_events_url":"https://api.github.com/users/mostaphaRoudsari/received_events","type":"User","site_admin":false},"body":"@sariths this doesn't follow the Ladybug/Grasshopper approach. If an input is missing the component should give a warning and not an error.","created_at":"2015-12-22T15:35:56Z","updated_at":"2015-12-22T15:35:56Z","html_url":"https://github.com/mostaphaRoudsari/Honeybee/pull/438#discussion_r48264229","pull_request_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/438","_links":{"self":{"href":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/comments/48264229"},"html":{"href":"https://github.com/mostaphaRoudsari/Honeybee/pull/438#discussion_r48264229"},"pull_request":{"href":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/438"}}},"pull_request":{"url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/438","id":54208299,"html_url":"https://github.com/mostaphaRoudsari/Honeybee/pull/438","diff_url":"https://github.com/mostaphaRoudsari/Honeybee/pull/438.diff","patch_url":"https://github.com/mostaphaRoudsari/Honeybee/pull/438.patch","issue_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/issues/438","number":438,"state":"open","locked":false,"title":"Component to extrude windows.","user":{"login":"sariths","id":10361848,"avatar_url":"https://avatars.githubusercontent.com/u/10361848?v=3","gravatar_id":"","url":"https://api.github.com/users/sariths","html_url":"https://github.com/sariths","followers_url":"https://api.github.com/users/sariths/followers","following_url":"https://api.github.com/users/sariths/following{/other_user}","gists_url":"https://api.github.com/users/sariths/gists{/gist_id}","starred_url":"https://api.github.com/users/sariths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sariths/subscriptions","organizations_url":"https://api.github.com/users/sariths/orgs","repos_url":"https://api.github.com/users/sariths/repos","events_url":"https://api.github.com/users/sariths/events{/privacy}","received_events_url":"https://api.github.com/users/sariths/received_events","type":"User","site_admin":false},"body":"Component to extrude windows","created_at":"2015-12-20T21:19:11Z","updated_at":"2015-12-22T15:35:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"172ad394ba997c2da1bf8e08b1d1d829344b7f6e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/438/commits","review_comments_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/438/comments","review_comment_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/issues/438/comments","statuses_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/statuses/573f81279cbb2fc779298e4a62d2258c62d88f3c","head":{"label":"sariths:master","ref":"master","sha":"573f81279cbb2fc779298e4a62d2258c62d88f3c","user":{"login":"sariths","id":10361848,"avatar_url":"https://avatars.githubusercontent.com/u/10361848?v=3","gravatar_id":"","url":"https://api.github.com/users/sariths","html_url":"https://github.com/sariths","followers_url":"https://api.github.com/users/sariths/followers","following_url":"https://api.github.com/users/sariths/following{/other_user}","gists_url":"https://api.github.com/users/sariths/gists{/gist_id}","starred_url":"https://api.github.com/users/sariths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sariths/subscriptions","organizations_url":"https://api.github.com/users/sariths/orgs","repos_url":"https://api.github.com/users/sariths/repos","events_url":"https://api.github.com/users/sariths/events{/privacy}","received_events_url":"https://api.github.com/users/sariths/received_events","type":"User","site_admin":false},"repo":{"id":48337185,"name":"Honeybee","full_name":"sariths/Honeybee","owner":{"login":"sariths","id":10361848,"avatar_url":"https://avatars.githubusercontent.com/u/10361848?v=3","gravatar_id":"","url":"https://api.github.com/users/sariths","html_url":"https://github.com/sariths","followers_url":"https://api.github.com/users/sariths/followers","following_url":"https://api.github.com/users/sariths/following{/other_user}","gists_url":"https://api.github.com/users/sariths/gists{/gist_id}","starred_url":"https://api.github.com/users/sariths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sariths/subscriptions","organizations_url":"https://api.github.com/users/sariths/orgs","repos_url":"https://api.github.com/users/sariths/repos","events_url":"https://api.github.com/users/sariths/events{/privacy}","received_events_url":"https://api.github.com/users/sariths/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sariths/Honeybee","description":":bee: Honeybee is a free and open source plugin to connect Grasshopper3D to EnergyPlus, Radiance, Daysim and OpenStudio for building energy and daylighting simulation","fork":true,"url":"https://api.github.com/repos/sariths/Honeybee","forks_url":"https://api.github.com/repos/sariths/Honeybee/forks","keys_url":"https://api.github.com/repos/sariths/Honeybee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sariths/Honeybee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sariths/Honeybee/teams","hooks_url":"https://api.github.com/repos/sariths/Honeybee/hooks","issue_events_url":"https://api.github.com/repos/sariths/Honeybee/issues/events{/number}","events_url":"https://api.github.com/repos/sariths/Honeybee/events","assignees_url":"https://api.github.com/repos/sariths/Honeybee/assignees{/user}","branches_url":"https://api.github.com/repos/sariths/Honeybee/branches{/branch}","tags_url":"https://api.github.com/repos/sariths/Honeybee/tags","blobs_url":"https://api.github.com/repos/sariths/Honeybee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sariths/Honeybee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sariths/Honeybee/git/refs{/sha}","trees_url":"https://api.github.com/repos/sariths/Honeybee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sariths/Honeybee/statuses/{sha}","languages_url":"https://api.github.com/repos/sariths/Honeybee/languages","stargazers_url":"https://api.github.com/repos/sariths/Honeybee/stargazers","contributors_url":"https://api.github.com/repos/sariths/Honeybee/contributors","subscribers_url":"https://api.github.com/repos/sariths/Honeybee/subscribers","subscription_url":"https://api.github.com/repos/sariths/Honeybee/subscription","commits_url":"https://api.github.com/repos/sariths/Honeybee/commits{/sha}","git_commits_url":"https://api.github.com/repos/sariths/Honeybee/git/commits{/sha}","comments_url":"https://api.github.com/repos/sariths/Honeybee/comments{/number}","issue_comment_url":"https://api.github.com/repos/sariths/Honeybee/issues/comments{/number}","contents_url":"https://api.github.com/repos/sariths/Honeybee/contents/{+path}","compare_url":"https://api.github.com/repos/sariths/Honeybee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sariths/Honeybee/merges","archive_url":"https://api.github.com/repos/sariths/Honeybee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sariths/Honeybee/downloads","issues_url":"https://api.github.com/repos/sariths/Honeybee/issues{/number}","pulls_url":"https://api.github.com/repos/sariths/Honeybee/pulls{/number}","milestones_url":"https://api.github.com/repos/sariths/Honeybee/milestones{/number}","notifications_url":"https://api.github.com/repos/sariths/Honeybee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sariths/Honeybee/labels{/name}","releases_url":"https://api.github.com/repos/sariths/Honeybee/releases{/id}","created_at":"2015-12-20T21:04:52Z","updated_at":"2015-12-20T21:04:55Z","pushed_at":"2015-12-20T21:19:11Z","git_url":"git://github.com/sariths/Honeybee.git","ssh_url":"git@github.com:sariths/Honeybee.git","clone_url":"https://github.com/sariths/Honeybee.git","svn_url":"https://github.com/sariths/Honeybee","homepage":"https://www.facebook.com/LadybugAnalysisTools/","size":106431,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mostaphaRoudsari:master","ref":"master","sha":"f272ebdc88313660ba2663c2dd51f553fa2acf48","user":{"login":"mostaphaRoudsari","id":2915573,"avatar_url":"https://avatars.githubusercontent.com/u/2915573?v=3","gravatar_id":"","url":"https://api.github.com/users/mostaphaRoudsari","html_url":"https://github.com/mostaphaRoudsari","followers_url":"https://api.github.com/users/mostaphaRoudsari/followers","following_url":"https://api.github.com/users/mostaphaRoudsari/following{/other_user}","gists_url":"https://api.github.com/users/mostaphaRoudsari/gists{/gist_id}","starred_url":"https://api.github.com/users/mostaphaRoudsari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mostaphaRoudsari/subscriptions","organizations_url":"https://api.github.com/users/mostaphaRoudsari/orgs","repos_url":"https://api.github.com/users/mostaphaRoudsari/repos","events_url":"https://api.github.com/users/mostaphaRoudsari/events{/privacy}","received_events_url":"https://api.github.com/users/mostaphaRoudsari/received_events","type":"User","site_admin":false},"repo":{"id":14415854,"name":"Honeybee","full_name":"mostaphaRoudsari/Honeybee","owner":{"login":"mostaphaRoudsari","id":2915573,"avatar_url":"https://avatars.githubusercontent.com/u/2915573?v=3","gravatar_id":"","url":"https://api.github.com/users/mostaphaRoudsari","html_url":"https://github.com/mostaphaRoudsari","followers_url":"https://api.github.com/users/mostaphaRoudsari/followers","following_url":"https://api.github.com/users/mostaphaRoudsari/following{/other_user}","gists_url":"https://api.github.com/users/mostaphaRoudsari/gists{/gist_id}","starred_url":"https://api.github.com/users/mostaphaRoudsari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mostaphaRoudsari/subscriptions","organizations_url":"https://api.github.com/users/mostaphaRoudsari/orgs","repos_url":"https://api.github.com/users/mostaphaRoudsari/repos","events_url":"https://api.github.com/users/mostaphaRoudsari/events{/privacy}","received_events_url":"https://api.github.com/users/mostaphaRoudsari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mostaphaRoudsari/Honeybee","description":":bee: Honeybee is a free and open source plugin to connect Grasshopper3D to EnergyPlus, Radiance, Daysim and OpenStudio for building energy and daylighting simulation","fork":false,"url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee","forks_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/forks","keys_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/teams","hooks_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/hooks","issue_events_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/issues/events{/number}","events_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/events","assignees_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/assignees{/user}","branches_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/branches{/branch}","tags_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/tags","blobs_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/git/refs{/sha}","trees_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/statuses/{sha}","languages_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/languages","stargazers_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/stargazers","contributors_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/contributors","subscribers_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/subscribers","subscription_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/subscription","commits_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/commits{/sha}","git_commits_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/git/commits{/sha}","comments_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/comments{/number}","issue_comment_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/issues/comments{/number}","contents_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/contents/{+path}","compare_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/merges","archive_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/downloads","issues_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/issues{/number}","pulls_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls{/number}","milestones_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/milestones{/number}","notifications_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/labels{/name}","releases_url":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/releases{/id}","created_at":"2013-11-15T05:20:53Z","updated_at":"2015-12-13T16:28:19Z","pushed_at":"2015-12-22T04:33:15Z","git_url":"git://github.com/mostaphaRoudsari/Honeybee.git","ssh_url":"git@github.com:mostaphaRoudsari/Honeybee.git","clone_url":"https://github.com/mostaphaRoudsari/Honeybee.git","svn_url":"https://github.com/mostaphaRoudsari/Honeybee","homepage":"https://www.facebook.com/LadybugAnalysisTools/","size":107151,"stargazers_count":44,"watchers_count":44,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":29,"mirror_url":null,"open_issues_count":103,"forks":29,"open_issues":103,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/438"},"html":{"href":"https://github.com/mostaphaRoudsari/Honeybee/pull/438"},"issue":{"href":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/issues/438"},"comments":{"href":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/issues/438/comments"},"review_comments":{"href":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/438/comments"},"review_comment":{"href":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/pulls/438/commits"},"statuses":{"href":"https://api.github.com/repos/mostaphaRoudsari/Honeybee/statuses/573f81279cbb2fc779298e4a62d2258c62d88f3c"}}}}