{"action":"created","comment":{"url":"https://api.github.com/repos/c42f/displaz/pulls/comments/108890614","pull_request_review_id":29945673,"id":108890614,"diff_hunk":"@@ -0,0 +1,88 @@\n+#!/usr/bin/env python2\n+import subprocess \n+import numpy\n+import sys\n+\n+# Edit this as required (windows, mac).  Be able to write this.\n+PLY_FILE=\"/tmp/displaz_bbox.ply\"\n+\n+# write .ply file representing a box with specfied center and transform to f\n+def MakeBBox(v_center, transform, f):\n+  f.write(\"ply\\n\")\n+  f.write(\"format ascii 1.0\\n\")\n+  f.write(\"comment simple rectangular prism\\n\")\n+  f.write(\"element vertex 8\\n\")\n+  f.write(\"property float x\\n\")\n+  f.write(\"property float y\\n\")\n+  f.write(\"property float z\\n\")\n+  f.write(\"element face 2\\n\")\n+  f.write(\"property list uint int vertex_index\\n\")\n+  f.write(\"end_header\\n\")\n+\n+  # apply transform to unit vectors and then add result to center\n+  unit_vectors = [ \n+    [0, 1, -1, 0], [1, 0, -1, 0], [0, -1, -1, 0], [-1, 0, -1, 0], \n+    [0, 1, 1, 0], [1, 0, 1, 0], [0, -1, 1, 0], [-1, 0, 1, 0]\n+  ] \n+  xfm_unit_vectors = [transform.dot(unit) for unit in unit_vectors]\n+  vertices = [numpy.add(v_center, xuv) for xuv in xfm_unit_vectors]\n+\n+  # write out resulting vertices\n+  map(lambda v: f.write(\"%s\\n\" % \" \".join(str(elem) for elem in v)), vertices)\n+  f.write(\"4 0 1 2 3\\n\")\n+  f.write(\"4 4 5 6 7\\n\")\n+\n+# write out the .ply file and have Displaz render it\n+def UpdateDisplaz(v, T):\n+    t = open(PLY_FILE, 'w')\n+    t.truncate()\n+    MakeBBox(v, T, t)\n+    t.close()\n+    p = subprocess.Popen([\"displaz -script -rmtemp \" + PLY_FILE], stdout=subprocess.PIPE, shell=True, bufsize=1)","path":"test/DrawBBox.py","position":41,"original_position":41,"commit_id":"0303d52b63e464ab1f5a8062818ec9dfb181dccb","original_commit_id":"0303d52b63e464ab1f5a8062818ec9dfb181dccb","user":{"login":"c42f","id":601473,"avatar_url":"https://avatars2.githubusercontent.com/u/601473?v=3","gravatar_id":"","url":"https://api.github.com/users/c42f","html_url":"https://github.com/c42f","followers_url":"https://api.github.com/users/c42f/followers","following_url":"https://api.github.com/users/c42f/following{/other_user}","gists_url":"https://api.github.com/users/c42f/gists{/gist_id}","starred_url":"https://api.github.com/users/c42f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c42f/subscriptions","organizations_url":"https://api.github.com/users/c42f/orgs","repos_url":"https://api.github.com/users/c42f/repos","events_url":"https://api.github.com/users/c42f/events{/privacy}","received_events_url":"https://api.github.com/users/c42f/received_events","type":"User","site_admin":false},"body":"Also, how about labelling your dataset?  If you use the `-label Box` option, it will show up in the dataset view with a more readable name, rather than the temporary file name.","created_at":"2017-03-30T10:22:11Z","updated_at":"2017-03-30T10:44:27Z","html_url":"https://github.com/c42f/displaz/pull/165#discussion_r108890614","pull_request_url":"https://api.github.com/repos/c42f/displaz/pulls/165","_links":{"self":{"href":"https://api.github.com/repos/c42f/displaz/pulls/comments/108890614"},"html":{"href":"https://github.com/c42f/displaz/pull/165#discussion_r108890614"},"pull_request":{"href":"https://api.github.com/repos/c42f/displaz/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/c42f/displaz/pulls/165","id":113291688,"html_url":"https://github.com/c42f/displaz/pull/165","diff_url":"https://github.com/c42f/displaz/pull/165.diff","patch_url":"https://github.com/c42f/displaz/pull/165.patch","issue_url":"https://api.github.com/repos/c42f/displaz/issues/165","number":165,"state":"open","locked":false,"title":"DrawBBox for displaz","user":{"login":"mrosen","id":742450,"avatar_url":"https://avatars0.githubusercontent.com/u/742450?v=3","gravatar_id":"","url":"https://api.github.com/users/mrosen","html_url":"https://github.com/mrosen","followers_url":"https://api.github.com/users/mrosen/followers","following_url":"https://api.github.com/users/mrosen/following{/other_user}","gists_url":"https://api.github.com/users/mrosen/gists{/gist_id}","starred_url":"https://api.github.com/users/mrosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrosen/subscriptions","organizations_url":"https://api.github.com/users/mrosen/orgs","repos_url":"https://api.github.com/users/mrosen/repos","events_url":"https://api.github.com/users/mrosen/events{/privacy}","received_events_url":"https://api.github.com/users/mrosen/received_events","type":"User","site_admin":false},"body":"Here's a start at an application that allow a displaz user to interactively define a bounding box.  You can set the center point and grow the box by 50% in x, y and z directions by pressing the corresponding keys.  Others may find it useful as a starting point.","created_at":"2017-03-29T20:50:26Z","updated_at":"2017-03-30T10:44:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7851700d759090aa14e7aad99f516dac3c328ed9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/c42f/displaz/pulls/165/commits","review_comments_url":"https://api.github.com/repos/c42f/displaz/pulls/165/comments","review_comment_url":"https://api.github.com/repos/c42f/displaz/pulls/comments{/number}","comments_url":"https://api.github.com/repos/c42f/displaz/issues/165/comments","statuses_url":"https://api.github.com/repos/c42f/displaz/statuses/0303d52b63e464ab1f5a8062818ec9dfb181dccb","head":{"label":"mrosen:master","ref":"master","sha":"0303d52b63e464ab1f5a8062818ec9dfb181dccb","user":{"login":"mrosen","id":742450,"avatar_url":"https://avatars0.githubusercontent.com/u/742450?v=3","gravatar_id":"","url":"https://api.github.com/users/mrosen","html_url":"https://github.com/mrosen","followers_url":"https://api.github.com/users/mrosen/followers","following_url":"https://api.github.com/users/mrosen/following{/other_user}","gists_url":"https://api.github.com/users/mrosen/gists{/gist_id}","starred_url":"https://api.github.com/users/mrosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrosen/subscriptions","organizations_url":"https://api.github.com/users/mrosen/orgs","repos_url":"https://api.github.com/users/mrosen/repos","events_url":"https://api.github.com/users/mrosen/events{/privacy}","received_events_url":"https://api.github.com/users/mrosen/received_events","type":"User","site_admin":false},"repo":{"id":86626927,"name":"displaz","full_name":"mrosen/displaz","owner":{"login":"mrosen","id":742450,"avatar_url":"https://avatars0.githubusercontent.com/u/742450?v=3","gravatar_id":"","url":"https://api.github.com/users/mrosen","html_url":"https://github.com/mrosen","followers_url":"https://api.github.com/users/mrosen/followers","following_url":"https://api.github.com/users/mrosen/following{/other_user}","gists_url":"https://api.github.com/users/mrosen/gists{/gist_id}","starred_url":"https://api.github.com/users/mrosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrosen/subscriptions","organizations_url":"https://api.github.com/users/mrosen/orgs","repos_url":"https://api.github.com/users/mrosen/repos","events_url":"https://api.github.com/users/mrosen/events{/privacy}","received_events_url":"https://api.github.com/users/mrosen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrosen/displaz","description":"A hackable lidar viewer","fork":true,"url":"https://api.github.com/repos/mrosen/displaz","forks_url":"https://api.github.com/repos/mrosen/displaz/forks","keys_url":"https://api.github.com/repos/mrosen/displaz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrosen/displaz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrosen/displaz/teams","hooks_url":"https://api.github.com/repos/mrosen/displaz/hooks","issue_events_url":"https://api.github.com/repos/mrosen/displaz/issues/events{/number}","events_url":"https://api.github.com/repos/mrosen/displaz/events","assignees_url":"https://api.github.com/repos/mrosen/displaz/assignees{/user}","branches_url":"https://api.github.com/repos/mrosen/displaz/branches{/branch}","tags_url":"https://api.github.com/repos/mrosen/displaz/tags","blobs_url":"https://api.github.com/repos/mrosen/displaz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrosen/displaz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrosen/displaz/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrosen/displaz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrosen/displaz/statuses/{sha}","languages_url":"https://api.github.com/repos/mrosen/displaz/languages","stargazers_url":"https://api.github.com/repos/mrosen/displaz/stargazers","contributors_url":"https://api.github.com/repos/mrosen/displaz/contributors","subscribers_url":"https://api.github.com/repos/mrosen/displaz/subscribers","subscription_url":"https://api.github.com/repos/mrosen/displaz/subscription","commits_url":"https://api.github.com/repos/mrosen/displaz/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrosen/displaz/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrosen/displaz/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrosen/displaz/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrosen/displaz/contents/{+path}","compare_url":"https://api.github.com/repos/mrosen/displaz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrosen/displaz/merges","archive_url":"https://api.github.com/repos/mrosen/displaz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrosen/displaz/downloads","issues_url":"https://api.github.com/repos/mrosen/displaz/issues{/number}","pulls_url":"https://api.github.com/repos/mrosen/displaz/pulls{/number}","milestones_url":"https://api.github.com/repos/mrosen/displaz/milestones{/number}","notifications_url":"https://api.github.com/repos/mrosen/displaz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrosen/displaz/labels{/name}","releases_url":"https://api.github.com/repos/mrosen/displaz/releases{/id}","deployments_url":"https://api.github.com/repos/mrosen/displaz/deployments","created_at":"2017-03-29T20:34:31Z","updated_at":"2017-03-29T20:34:33Z","pushed_at":"2017-03-29T20:43:35Z","git_url":"git://github.com/mrosen/displaz.git","ssh_url":"git@github.com:mrosen/displaz.git","clone_url":"https://github.com/mrosen/displaz.git","svn_url":"https://github.com/mrosen/displaz","homepage":"http://c42f.github.io/displaz","size":2771,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"c42f:master","ref":"master","sha":"ed2d14789f09c7b74029447ef506149f3d1206fa","user":{"login":"c42f","id":601473,"avatar_url":"https://avatars2.githubusercontent.com/u/601473?v=3","gravatar_id":"","url":"https://api.github.com/users/c42f","html_url":"https://github.com/c42f","followers_url":"https://api.github.com/users/c42f/followers","following_url":"https://api.github.com/users/c42f/following{/other_user}","gists_url":"https://api.github.com/users/c42f/gists{/gist_id}","starred_url":"https://api.github.com/users/c42f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c42f/subscriptions","organizations_url":"https://api.github.com/users/c42f/orgs","repos_url":"https://api.github.com/users/c42f/repos","events_url":"https://api.github.com/users/c42f/events{/privacy}","received_events_url":"https://api.github.com/users/c42f/received_events","type":"User","site_admin":false},"repo":{"id":6596947,"name":"displaz","full_name":"c42f/displaz","owner":{"login":"c42f","id":601473,"avatar_url":"https://avatars2.githubusercontent.com/u/601473?v=3","gravatar_id":"","url":"https://api.github.com/users/c42f","html_url":"https://github.com/c42f","followers_url":"https://api.github.com/users/c42f/followers","following_url":"https://api.github.com/users/c42f/following{/other_user}","gists_url":"https://api.github.com/users/c42f/gists{/gist_id}","starred_url":"https://api.github.com/users/c42f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c42f/subscriptions","organizations_url":"https://api.github.com/users/c42f/orgs","repos_url":"https://api.github.com/users/c42f/repos","events_url":"https://api.github.com/users/c42f/events{/privacy}","received_events_url":"https://api.github.com/users/c42f/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/c42f/displaz","description":"A hackable lidar viewer","fork":false,"url":"https://api.github.com/repos/c42f/displaz","forks_url":"https://api.github.com/repos/c42f/displaz/forks","keys_url":"https://api.github.com/repos/c42f/displaz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/c42f/displaz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/c42f/displaz/teams","hooks_url":"https://api.github.com/repos/c42f/displaz/hooks","issue_events_url":"https://api.github.com/repos/c42f/displaz/issues/events{/number}","events_url":"https://api.github.com/repos/c42f/displaz/events","assignees_url":"https://api.github.com/repos/c42f/displaz/assignees{/user}","branches_url":"https://api.github.com/repos/c42f/displaz/branches{/branch}","tags_url":"https://api.github.com/repos/c42f/displaz/tags","blobs_url":"https://api.github.com/repos/c42f/displaz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/c42f/displaz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/c42f/displaz/git/refs{/sha}","trees_url":"https://api.github.com/repos/c42f/displaz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/c42f/displaz/statuses/{sha}","languages_url":"https://api.github.com/repos/c42f/displaz/languages","stargazers_url":"https://api.github.com/repos/c42f/displaz/stargazers","contributors_url":"https://api.github.com/repos/c42f/displaz/contributors","subscribers_url":"https://api.github.com/repos/c42f/displaz/subscribers","subscription_url":"https://api.github.com/repos/c42f/displaz/subscription","commits_url":"https://api.github.com/repos/c42f/displaz/commits{/sha}","git_commits_url":"https://api.github.com/repos/c42f/displaz/git/commits{/sha}","comments_url":"https://api.github.com/repos/c42f/displaz/comments{/number}","issue_comment_url":"https://api.github.com/repos/c42f/displaz/issues/comments{/number}","contents_url":"https://api.github.com/repos/c42f/displaz/contents/{+path}","compare_url":"https://api.github.com/repos/c42f/displaz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/c42f/displaz/merges","archive_url":"https://api.github.com/repos/c42f/displaz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/c42f/displaz/downloads","issues_url":"https://api.github.com/repos/c42f/displaz/issues{/number}","pulls_url":"https://api.github.com/repos/c42f/displaz/pulls{/number}","milestones_url":"https://api.github.com/repos/c42f/displaz/milestones{/number}","notifications_url":"https://api.github.com/repos/c42f/displaz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/c42f/displaz/labels{/name}","releases_url":"https://api.github.com/repos/c42f/displaz/releases{/id}","deployments_url":"https://api.github.com/repos/c42f/displaz/deployments","created_at":"2012-11-08T13:48:08Z","updated_at":"2017-03-30T08:21:11Z","pushed_at":"2017-03-29T20:50:26Z","git_url":"git://github.com/c42f/displaz.git","ssh_url":"git@github.com:c42f/displaz.git","clone_url":"https://github.com/c42f/displaz.git","svn_url":"https://github.com/c42f/displaz","homepage":"http://c42f.github.io/displaz","size":2768,"stargazers_count":65,"watchers_count":65,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":26,"mirror_url":null,"open_issues_count":49,"forks":26,"open_issues":49,"watchers":65,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/c42f/displaz/pulls/165"},"html":{"href":"https://github.com/c42f/displaz/pull/165"},"issue":{"href":"https://api.github.com/repos/c42f/displaz/issues/165"},"comments":{"href":"https://api.github.com/repos/c42f/displaz/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/c42f/displaz/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/c42f/displaz/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/c42f/displaz/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/c42f/displaz/statuses/0303d52b63e464ab1f5a8062818ec9dfb181dccb"}}}}
{"actor":{"display_login":"c42f"}}