{"id":30895490,"url":"https://github.com/ladybug-tools/honeybee-vtk","last_synced_at":"2026-02-13T02:02:28.138Z","repository":{"id":38067666,"uuid":"328046346","full_name":"ladybug-tools/honeybee-vtk","owner":"ladybug-tools","description":"🐝 🌐 Honeybee extension for translating HBJSON files to VTK format ","archived":false,"fork":false,"pushed_at":"2023-05-31T20:35:54.000Z","size":59419,"stargazers_count":10,"open_issues_count":22,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-04T16:28:07.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.ladybug.tools/honeybee-vtk/docs/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ladybug-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-01-09T00:57:24.000Z","updated_at":"2025-07-05T02:49:14.000Z","dependencies_parsed_at":"2023-02-10T14:45:19.740Z","dependency_job_id":"f7e6cd3d-7dd1-418e-8936-a28d45383c39","html_url":"https://github.com/ladybug-tools/honeybee-vtk","commit_stats":{"total_commits":1185,"total_committers":11,"mean_commits":"107.72727272727273","dds":"0.14514767932489447","last_synced_commit":"7bd22c78062131dd808c35913e786372e958e3cc"},"previous_names":[],"tags_count":119,"template":false,"template_full_name":null,"purl":"pkg:github/ladybug-tools/honeybee-vtk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladybug-tools%2Fhoneybee-vtk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladybug-tools%2Fhoneybee-vtk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladybug-tools%2Fhoneybee-vtk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladybug-tools%2Fhoneybee-vtk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ladybug-tools","download_url":"https://codeload.github.com/ladybug-tools/honeybee-vtk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladybug-tools%2Fhoneybee-vtk/sbom","scorecard":{"id":576889,"data":{"date":"2025-08-11","repo":{"name":"github.com/ladybug-tools/honeybee-vtk","commit":"7bd22c78062131dd808c35913e786372e958e3cc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Code-Review","score":2,"reason":"Found 5/20 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/ladybug-tools/honeybee-vtk/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/ladybug-tools/honeybee-vtk/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:96: update your workflow using https://app.stepsecurity.io/secureworkflow/ladybug-tools/honeybee-vtk/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/ladybug-tools/honeybee-vtk/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/ladybug-tools/honeybee-vtk/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/ladybug-tools/honeybee-vtk/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/ladybug-tools/honeybee-vtk/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/ladybug-tools/honeybee-vtk/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/ladybug-tools/honeybee-vtk/ci.yaml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:43","Warn: pipCommand not pinned by hash: Dockerfile:31-36","Warn: pipCommand not pinned by hash: Dockerfile:31-36","Warn: pipCommand not pinned by hash: Dockerfile:50","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:64","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:65","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:66","Warn: npmCommand not pinned by hash: .github/workflows/ci.yaml:69","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:91","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:92","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:22","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:23","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:24","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of  11 pipCommand dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"22 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2019-217 / GHSA-462w-v97r-4m45","Warn: Project is vulnerable to: PYSEC-2014-8 / GHSA-8r7q-cvjq-x353","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: PYSEC-2014-82 / GHSA-fqh9-2qgg-h84h","Warn: Project is vulnerable to: PYSEC-2021-66 / GHSA-g3rq-g295-4j3m","Warn: Project is vulnerable to: GHSA-h5c8-rqwp-cp95","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: PYSEC-2019-220 / GHSA-hj2j-77xm-mc5v","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: PYSEC-2013-22 / GHSA-27x4-j476-jp5f","Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf","Warn: Project is vulnerable to: GHSA-cx63-2mw6-8hw5","Warn: Project is vulnerable to: PYSEC-2022-43012 / GHSA-r9hx-vwmv-q579","Warn: Project is vulnerable to: PYSEC-2022-43017 / GHSA-qwmp-2cf2-g9g6","Warn: Project is vulnerable to: GHSA-qr4w-53vh-m672","Warn: Project is vulnerable to: PYSEC-2023-183","Warn: Project is vulnerable to: GHSA-3f63-hfp8-52jq","Warn: Project is vulnerable to: GHSA-44wm-f244-xhp3","Warn: Project is vulnerable to: PYSEC-2023-227 / GHSA-8ghj-p4vj-mr35","Warn: Project is vulnerable to: GHSA-j7hp-h8jx-5ppr","Warn: Project is vulnerable to: PYSEC-2022-42979 / GHSA-m2vv-5vj5-2hm7","Warn: Project is vulnerable to: PYSEC-2023-175"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T18:05:32.289Z","repository_id":38067666,"created_at":"2025-08-20T18:05:32.289Z","updated_at":"2025-08-20T18:05:32.289Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29392817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T00:53:09.511Z","status":"online","status_checked_at":"2026-02-13T02:00:10.076Z","response_time":78,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-08T22:06:41.863Z","updated_at":"2026-02-13T02:02:28.119Z","avatar_url":"https://github.com/ladybug-tools.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# honeybee-vtk\n🐝 VTK - Honeybee extension for viewing HBJSON in a web browser.\n\n![HBJSON exported to web](/images/room.gif)\n\n[![Build Status](https://github.com/ladybug-tools/honeybee-vtk/workflows/CI/badge.svg)](https://github.com/ladybug-tools/honeybee-vtk/actions)\n[![Coverage Status](https://coveralls.io/repos/github/ladybug-tools/honeybee-vtk/badge.svg?branch=master)](https://coveralls.io/github/ladybug-tools/honeybee-vtk?branch=master)\n[![Python 3.7](https://img.shields.io/badge/python-3.7-green.svg)](https://www.python.org/downloads/release/python-370/)\n\n[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/ladybug-tools/honeybee-vtk)](https://github.com/ladybug-tools/honeybee-vtk/releases)\n[![GitHub](https://img.shields.io/github/license/ladybug-tools/honeybee-vtk)](https://github.com/ladybug-tools/honeybee-vtk/blob/master/LICENSE)\n\n\n[![GitHub last commit](https://img.shields.io/github/last-commit/ladybug-tools/honeybee-vtk)](https://github.com/ladybug-tools/honeybee-vtk/commits/master)\n[![GitHub issues](https://img.shields.io/github/issues/ladybug-tools/honeybee-vtk)](https://github.com/ladybug-tools/honeybee-vtk/issues)\n[![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/ladybug-tools/honeybee-vtk)](https://github.com/ladybug-tools/honeybee-vtk/issues?q=is%3Aissue+is%3Aclosed)\n\n## Installation\n\n```console\npip install honeybee-vtk\n```\n\n## QuickStart\n\n```python\nimport honeybee_vtk\n```\n## Translate a HBJSON file to an HTML or vtkjs file\n```console\nUsage: honeybee-vtk translate [OPTIONS] HBJSON_FILE\n\n  Translate a HBJSON file to an HTML or a vtkjs file.\n\n  Args:\n      hbjson-file: Path to an HBJSON file.\n\nOptions:\n  -n, --name TEXT                 Name of the output file.  [default: model]\n  -f, --folder DIRECTORY          Path to target folder.  [default: .]\n  -ft, --file-type [html|vtkjs|vtp|vtk]\n                                  Switch between html and vtkjs formats\n                                  [default: html]\n\n  -mdm, --model-display-mode [shaded|surface|surfacewithedges|wireframe|points]\n                                  Set display mode for the model.  [default:\n                                  shaded]\n\n  -gdm, --grid-display-mode [shaded|surface|surfacewithedges|wireframe|points]\n                                  Set display mode for the grid.  [default:\n                                  shaded]\n\n  -go, --grid-options [ignore|points|meshes]\n                                  Export sensor grids as either points or\n                                  meshes.  [default: ignore]\n\n  -sh, --show-html, --show        Open the generated HTML file in a browser.\n                                  [default: False]\n\n  -cf, --config PATH              File Path to the config json file which can\n                                  be used to mount simulation data on HBJSON.\n\n  -vd, --validate-data            Validate simulation data before loading on\n                                  the model. This is recommended when using\n                                  this command locally.  [default: False]\n\n  --help                          Show this message and exit.\n```\n\n## Export images from an HBJSON file\n```console\nUsage: honeybee-vtk export-images [OPTIONS] HBJSON_FILE\n\n  Export images from radiance views in a HBJSON file.\n\n  Args:\n      hbjson-file: Path to an HBJSON file.\n\nOptions:\n  -f, --folder DIRECTORY          Path to target folder.  [default: .]\n  -it, --image-type [png|jpg|ps|tiff|bmp|pnm]\n                                  choose the type of image file.  [default:\n                                  jpg]\n\n  -iw, --image-width INTEGER      Width of images in pixels. If not set,\n                                  Radiance default x dimension of view will be\n                                  used.  [default: 0]\n\n  -ih, --image-height INTEGER     Height of images in pixels.If not set,\n                                  Radiance default y dimension of view will be\n                                  used.  [default: 0]\n\n  -bc, --background-color \u003cINTEGER INTEGER INTEGER\u003e...\n                                  Set background color for images  [default:\n                                  255, 255, 255]\n\n  -mdm, --model-display-mode [shaded|surface|surfacewithedges|wireframe|points]\n                                  Set display mode for the model.  [default:\n                                  shaded]\n\n  -go, --grid-options [ignore|points|meshes]\n                                  Export sensor grids as either points or\n                                  meshes.  [default: ignore]\n\n  -gdm, --grid-display-mode [shaded|surface|surfacewithedges|wireframe|points]\n                                  Set display mode for the Sensorgrids.\n                                  [default: surfacewithedges]\n\n  -vf, --view PATH                File Path to the Radiance view file.\n                                  Multiple view files are accepted.\n\n  -cf, --config PATH              File Path to the config json file which can\n                                  be used to mount simulation data on HBJSON.\n\n  -vd, --validate-data            Validate simulation data before loading on\n                                  the model. This is recommended when using\n                                  this command locally.  [default: False]\n\n  --grid / --model                Boolean to decide whether to export the\n                                  images of a whole model or only the grids.\n                                  Set it to True to export the grids.\n                                  [default: False]\n\n  -gf, --grid-filter TEXT         Filter sensor grids by name. Use this option\n                                  multiple times to use multiple grid\n                                  identifiers as filters.  [default: ]\n\n  --text-content TEXT             Text to be displayed on the image.\n  -th, --text-height INTEGER      Set the height of the text in pixels.\n                                  [default: 15]\n\n  -tc, --text-color \u003cINTEGER INTEGER INTEGER\u003e...\n                                  Set the text color.  [default: 0, 0, 0]\n  -tp, --text-position \u003cFLOAT FLOAT\u003e...\n                                  Set the text position in the image. The\n                                  setting is applied at the lower left point\n                                  of the text. (0,0) will give you the lower\n                                  left corner of the image. (1,1) will give\n                                  you the upper right corner of the image.\n                                  [default: 0.5, 0.0]\n\n  -tb, --text-bold                Set the text to be bold.  [default: False]\n  --help                          Show this message and exit.\n```\n\n## Write a config file to be consumed by the Translate command\n```console\nUsage: honeybee-vtk config [OPTIONS] INPUT_FILE\n\n  Write a config file to be consumed by honeybee-vtk.\n\n  Args:\n      input_file: A path to the input file in json format.\n      folder_path: Path to the folder where the config file shall be written.\n          Defaults to the current working directory.\n      name: A string as the name of the config file. Defaults to 'config'.\n\nOptions:\n  -fp, --folder-path PATH  Path to the folder where the config file shall be\n                           written.  [default: .]\n\n  -n, --name TEXT          Name of the config file.  [default: config]\n  --help                   Show this message and exit.\n```\n## Create arrows and write to a vtp file and open it in a minimalist desktop [viewer](https://kitware.github.io/F3D/)\n\n```python\nfrom ladybug_geometry.geometry3d import Point3D, Vector3D\nfrom honeybee_vtk.to_vtk import create_arrow\n\npoints = [Point3D(0, 0, 0), Point3D(1, 1, 0), Point3D(1, 0, 0)]\nvectors = [Vector3D(0, 0, 1), Vector3D(1, 1, 1), Vector3D(2, 0, 0)]\narrows = create_arrow(points, vectors)\narrows.to_vtk('.', 'arrows')\n\n```\n![arrows](/images/arrows.png)\n\n## Create a group of points and color them based on distance from origin, write them to a vtp file and and open it in a minimalist desktop [viewer](https://kitware.github.io/F3D/)\n\n```python\n\nfrom ladybug_geometry.geometry3d import Point3D\nfrom honeybee_vtk.to_vtk import convert_points\n\npoints = []\nfor x in range(-50, 50, 5):\n    for y in range(-50, 50, 5):\n        for z in range(-50, 50, 5):\n            points.append(Point3D(x, y, z))\n\norigin = Point3D(0, 0, 0)\ndistance = [pt.distance_to_point(origin) for pt in points]\n\n# convert points to polydata\npts = convert_points(points)\npts.add_data(distance, name='distance', cell=False)\npts.color_by('distance', cell=False)\npts.to_vtk('.', 'colored_points')\n\n```\n\n![arrows](/images/colored_points.png)\n\n\n## Draw a sunpath\n\n```python\nfrom ladybug.location import Location\nfrom ladybug.sunpath import Sunpath, Point3D, Vector3D\nfrom honeybee_vtk.to_vtk import convert_polyline, create_polyline\nfrom honeybee_vtk.types import JoinedPolyData\nimport math\n\n# Create location. You can also extract location data from an epw file.\nsydney = Location('Sydney', 'AUS', latitude=-33.87, longitude=151.22, time_zone=10)\n\n# Initiate sunpath\nsp = Sunpath.from_location(sydney)\n\nradius = 100\norigin = Point3D(0, 0, 0)\npolylines = sp.hourly_analemma_polyline3d(origin=origin, daytime_only=True, radius=radius)\nsp_pls = [convert_polyline(pl) for pl in polylines]\n\n# add a circle\nnorth = origin.move(Vector3D(0, radius, 0))\nplot_points = [\n    north.rotate_xy(math.radians(angle), origin)\n    for angle in range(0, 365, 5)\n]\n\nplot = create_polyline(plot_points)\n\n# join polylines into a single polydata\nsunpath = JoinedPolyData.from_polydata(sp_pls)\n# add plot\nsunpath.append(plot)\n\nsunpath.to_vtk('.', 'sunpath')\n```\n\n![sunpath](/images/sunpath.png)\n\n\n## Draw a sunpath with hourly data\n\n```python\n\nfrom ladybug.epw import EPW\nfrom ladybug.sunpath import Sunpath, Point3D, Vector3D\nfrom honeybee_vtk.to_vtk import convert_points, convert_polyline, create_polyline\nfrom honeybee_vtk.types import JoinedPolyData\nimport math\n\n# Get location from epw file\nepw = EPW('./tests/assets/in.epw')\nlocation = epw.location\n\n# Initiate sunpath\nsp = Sunpath.from_location(location)\n\nradius = 100\norigin = Point3D(0, 0, 0)\npolylines = sp.hourly_analemma_polyline3d(origin=origin, daytime_only=True, radius=radius)\nsp_pls = [convert_polyline(pl) for pl in polylines]\n\n# add a circle\nnorth = origin.move(Vector3D(0, radius, 0))\nplot_points = [\n    north.rotate_xy(math.radians(angle), origin)\n    for angle in range(0, 365, 5)\n]\n\nplot = create_polyline(plot_points)\n\n# join polylines into a single polydata\nsunpath = JoinedPolyData.from_polydata(sp_pls)\n# add plot\nsunpath.append(plot)\nsunpath.to_vtk('.', 'sunpath')\n\n# add sun positions and color them based on radiation\nday = sp.hourly_analemma_suns(daytime_only=True)\n# calculate sun positions from sun vector\npts = []\nhours = []\nfor suns in day:\n    for sun in suns:\n        pts.append(origin.move(sun.sun_vector.reverse() * radius))\n        hours.append(sun.hoy)\n\nradiation_data = epw.global_horizontal_radiation\nfiltered_radiation_data = radiation_data.filter_by_hoys(hours)\n\nsun_positions = convert_points(pts)\nsun_positions.add_data(\n    filtered_radiation_data.values, name='Globale Horizontal Radiation', cell=False\n)\nsun_positions.color_by('Global Horizontal Radiation', cell=False)\nsun_positions.to_vtk('.', 'sun_positions')\n\n```\n\n![sunpath with data](/images/sunpath_with_data.png)\n\n\n## Load HB model\n\n```python\nfrom honeybee_vtk.model import Model\n\nhbjson = r'./tests/assets/gridbased.hbjson'\nmodel = Model.from_hbjson(hbjson)\nmodel.to_html(folder='.', name='two-rooms', show=True)\n\n```\n\n![HBJSON model](/images/hbjson_model.png)\n\n\n## Load HB model - change display mode and colors\n\n```python\n\nfrom honeybee_vtk.model import Model, DisplayMode\nfrom ladybug.color import Color\n\nhbjson = r'./tests/assets/gridbased.hbjson'\nmodel = Model.from_hbjson(hbjson)\n\n# update model visualization to show edges\nmodel.update_display_mode(DisplayMode.SurfaceWithEdges)\n\n# set shades to wireframe mode and change their color to black\nmodel.shades.display_mode = DisplayMode.Wireframe\nmodel.shades.color = Color(0, 0, 0, 255)\n\n# create an HTML file with embedded visualization. You can share this HTML as is\n# and it will include all the information.\nmodel.to_html('.', name='two-rooms', show=True)\n\n# alternatively you can write it as a vtkjs file and visualize it in ParaviewGlance\n# the `to_html` method calls this method under the hood.\n# model.to_vtkjs(folder='.')\n\n```\n\n![Modified HBJSON model](/images/hbjson_model_2.png)\n\n\n## Load HB Model and daylight factor results\n\n```python\n\nfrom honeybee_vtk.model import Model, DisplayMode, SensorGridOptions\nimport pathlib\n\nhbjson = r'./tests/assets/revit_model/model.hbjson'\nresults_folder = r'./tests/assets/revit_model/df_results'\n\nmodel = Model.from_hbjson(hbjson, load_grids=SensorGridOptions.Mesh)\n\n# load the results for each grid\n# note that we load the results using the order for model to ensure the order will match\ndaylight_factor = []\nfor grid in model.sensor_grids.data:\n    res_file = pathlib.Path(results_folder, f'{grid.identifier}.res')\n    grid_res = [float(v) for v in res_file.read_text().splitlines()]\n    daylight_factor.append(grid_res)\n\n# add the results to sensor grids as a new field\n# per face is set to True since we loaded grids as a mesh\nmodel.sensor_grids.add_data_fields(daylight_factor, name='Daylight Factor', per_face=True)\nmodel.sensor_grids.color_by = 'Daylight Factor'\n\n# make it pop!\n# change display mode for sensor grids to be surface with edges\nmodel.sensor_grids.display_mode = DisplayMode.SurfaceWithEdges\n# update model visualization to wireframe\nmodel.update_display_mode(DisplayMode.Wireframe)\n# make shades to be shaded with edge\nmodel.shades.display_mode = DisplayMode.SurfaceWithEdges\n\n# export the model to a HTML file with embedded viewer and open the page in a browser\nmodel.to_html('c:/ladybug', name='revit-model', show=True)\n\n# alternatively you can write it as a vtkjs file and visualize it in ParaviewGlance\n# the `to_html` method calls this method under the hood.\n# model.to_vtkjs(folder='.')\n\n```\n\n![Daylight factor results](/images/revit_model_daylight_factor.png)\n\n\n## Load HB Model and annual daylight results\n\n```python\n\nfrom honeybee_vtk.model import Model, DisplayMode, SensorGridOptions\nimport pathlib\n\nhbjson = r'./tests/assets/gridbased.hbjson'\nresults_folder = r'./tests/assets/annual_metrics'\n\nmodel = Model.from_hbjson(hbjson, load_grids=SensorGridOptions.Mesh)\n\n# load the results for each grid\n# note that we load the results using the order for model to ensure the order will match\nannual_metrics = [\n    {'folder': 'da', 'extension': 'da', 'name': 'Daylight Autonomy'},\n    {'folder': 'cda', 'extension': 'cda', 'name': 'Continuous Daylight Autonomy'},\n    {'folder': 'udi', 'extension': 'udi', 'name': 'Useful Daylight Illuminance'},\n    {'folder': 'udi_lower', 'extension': 'udi', 'name': 'Lower Daylight Illuminance'},\n    {'folder': 'udi_upper', 'extension': 'udi', 'name': 'Excessive Daylight Illuminance'}\n]\nfor metric in annual_metrics:\n    results = []\n    for grid in model.sensor_grids.data:\n        res_file = pathlib.Path(\n            results_folder, metric['folder'], f'{grid.identifier}.{metric[\"extension\"]}'\n        )\n        grid_res = [float(v) for v in res_file.read_text().splitlines()]\n        results.append(grid_res)\n\n    # add the results to sensor grids as a new field\n    # per face is set to True since we loaded grids as a mesh\n    model.sensor_grids.add_data_fields(results, name=metric['name'], per_face=True)\n\n# Set color by to Useful Daylight Illuminance\nmodel.sensor_grids.color_by = 'Useful Daylight Illuminance'\n\n# make it pop!\n# change display mode for sensor grids to be surface with edges\nmodel.sensor_grids.display_mode = DisplayMode.SurfaceWithEdges\n# update model visualization to wireframe\nmodel.update_display_mode(DisplayMode.Wireframe)\n\n# export the model to a HTML file with embedded viewer and open the page in a browser\nmodel.to_html('.', name='two-rooms', show=True)\n\n# alternatively you can write it as a vtkjs file and visualize it in ParaviewGlance\n# the `to_html` method calls this method under the hood.\n# model.to_vtkjs(folder='.')\n\n```\n\n![Annual daylight results](/images/annual_daylight_metrics.png)\n\n\n## Save model with results as an image\n\n\n\n```python\nfrom honeybee_vtk.model import Model, DisplayMode, SensorGridOptions\nfrom honeybee_vtk.scene import Scene\n\nimport pathlib\n\nhbjson = r'./tests/assets/gridbased.hbjson'\nresults_folder = r'./tests/assets/df_results'\n\nmodel = Model.from_hbjson(hbjson, load_grids=SensorGridOptions.Mesh)\n\n# load the results for each grid\n# note that we load the results using the order for model to ensure the order will match\ndaylight_factor = []\nfor grid in model.sensor_grids.data:\n    res_file = pathlib.Path(results_folder, f'{grid.identifier}.res')\n    grid_res = [float(v) for v in res_file.read_text().splitlines()]\n    daylight_factor.append(grid_res)\n\n# add the results to sensor grids as a new field\n# per face is set to True since we loaded grids as a mesh\nmodel.sensor_grids.add_data_fields(\n    daylight_factor, name='Daylight Factor', per_face=True, data_range=(0, 20)\n)\nmodel.sensor_grids.color_by = 'Daylight Factor'\n\n# make it pop!\n# change display mode for sensor grids to be surface with edges\nmodel.sensor_grids.display_mode = DisplayMode.SurfaceWithEdges\n# update model visualization to wireframe\nmodel.update_display_mode(DisplayMode.Wireframe)\n# make shades to be shaded with edge\nmodel.shades.display_mode = DisplayMode.SurfaceWithEdges\n\n# create a scene to render the model\nscene = Scene()\nscene.add_model(model)\n# set a scale bar based on daylight factor values\ncolor_range = model.sensor_grids.active_field_info.color_range()\n\n# you can also save the scene as an image.\n# right now you can't control the camera but camera control can be implemented.\nscene.to_image('.', name='daylight_factor', image_scale=2, color_range=color_range)\n\n# alternatively you can start an interactive window\n# scene.show(color_range)\n\n```\n\n![Captured image](/images/captured_daylight_factor.png)\n\n![Interactive renderer](/images/interactive_scene.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladybug-tools%2Fhoneybee-vtk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fladybug-tools%2Fhoneybee-vtk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladybug-tools%2Fhoneybee-vtk/lists"}