https://github.com/cadop/dhart
A library for creating Navigation Graphs, Visibility graphs, Raycasting used in design analysis, architecture, robotics, and human factors.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 6 committers (33.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.9%) to scientific vocabulary
Keywords
Repository
A library for creating Navigation Graphs, Visibility graphs, Raycasting used in design analysis, architecture, robotics, and human factors.
Basic Info
- Host: GitHub
- Owner: cadop
- License: gpl-3.0
- Language: C++
- Default Branch: main
- Homepage: https://cadop.github.io/dhart/
- Size: 249 MB
Statistics
- Stars: 15
- Watchers: 2
- Forks: 11
- Open Issues: 25
- Releases: 1
Topics
Metadata Files
README.md
Overview
Welcome to DHART:a C++ package with interfaces to Python, C, and C# for Design, Humans, Analysis, and RoboTics.
There are a few components to the package, but the main focus is in providing fast ray-casting interfaces for python and C# for a variety of analysis and evaluation techniques. Generally, you should be able to build a grid-like structure of the floors for a 3D model, calculate shortest paths by distance/visibility/energy and custom metrics, and use these tools inside of a variety of programs such as Unity, Rhino, and more.
We have extensive documentation on the API, and welcome new contributions and bug fixes. Please make sure to take a look at the contributing guide.
Limitations
- Currently it is available on Windows OS, and some work has been done to port it to Linux.
- Integration with Rhino is currently limited to viewing analysis results through
jsonfiles.
Coming Soon
- Rhino and Grasshopper Plugin
- Additional documentation for how to simulate LIDAR in python
- Dedicated Releases for each language
- Revit Plugin
Features
- Python, C, C#, C++ interface
- Extract connected grid-based graphs from 3d models
- Calculate shortest path based on Distance, Energy, Visibility, and others
- Graph parsing traverses stairs and slopes
- Easily generate visibility graphs and analyze locations of environment
- Calculate view scores, percentage of view, and points of interest
- Uses Embree raytracer for fast raycasting
- Has switchable backend to use nanoRT for raycasting with double precision
- Demos and instructions for integrating with Rhino 3D and Unity
Credits
This repository contains work that was supported in part by the U.S. Army Combat Capabilities Development Command (CCDC) Armaments Center and the U.S. Army ManTech Office under Contract Delivery Order W15QKN19F0002 - Advanced Development of Asset Protection Technologies (ADAPT).
Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Army Contracting Command - New Jersey.
If you find this repo useful, please cite using the following bibtex
bibtex
@article{schwartz2021human,
title={Human centric accessibility graph for environment analysis},
author={Schwartz, Mathew},
journal={Automation in Construction},
volume={127},
pages={103557},
year={2021},
publisher={Elsevier}
}
Example Usage
- Python docs: https://cadop.github.io/dhart/Python%20Docs/build/html/index.html
- C++ and C Interface docs: https://cadop.github.io/dhart/C++/html/index.html
- C# docs: https://cadop.github.io/dhart/C%23%20Public%20Docs/html/index.html
Once the python package is installed, the basic setup for loading a model (e.g. obj), setting its rotation (if its not default z up), and creating a BVH (the accelerated structure of the mesh) is done by:
```python from dhart.geometry import LoadOBJ, CommonRotations from dhart.raytracer import (EmbreeBVH,Intersect, IntersectForPoint, IntersectOccluded) import dhart
Get model path
objpath = dhart.getsample_model('plane.obj')
Load mesh
loadedobj = LoadOBJ(objpath, rotation=CommonRotations.YuptoZup)
Create BVH
bvh = EmbreeBVH(loaded_obj) ```
After this, different methods for casting a ray can be used:
```python
Define point to start ray
p1 = (0, 0, 2)
Define direction to cast ray
dir = (0, 0, -1)
Cast a ray for the hitpoint
hitpoint = IntersectForPoint(bvh, p1, dir, -1) print(f"Hit point: {hitpoint}")
Cast a ray for distance/meshid
distance, meshid = Intersect(bvh, p1, dir, -1) print(f"distance is {distance}, meshid is {meshid}")
See if it occludes
doesocclude = IntersectOccluded(bvh, p1, (0, 0, -1), 9999) print(f"Does the ray connect? {doesocclude}") ```
which would output
Hit point: (0.0, 0.0, 0.0)
distance is 2.0, meshid is 0
Does the ray connect? True
Getting started
Installing
- Requires Windows 10
- Tested on Python 3.8 +
For Python you can use
pip install dhart
In the latest release you can additionally use pip install dhart[dev] to install packages needed for visualization of examples and documentation.
- However, if you would like to use Python with Rhino Grasshopper, you will need to follow the install instructions in the Python Docs.
For C# you can download from the Releases page. - Of course, you can always clone this repo and build the project yourself.
We supply .dll's to try and make the installation and linking process as easy as possible.
Building from Source
You can use cmake on the commandline or Visual Studio, follow the instructions in BUILD.md to get started.
Owner
- Login: cadop
- Kind: user
- Repositories: 7
- Profile: https://github.com/cadop
GitHub Events
Total
- Issues event: 12
- Watch event: 3
- Delete event: 4
- Issue comment event: 19
- Push event: 73
- Pull request review event: 50
- Pull request review comment event: 65
- Pull request event: 23
- Fork event: 2
- Create event: 5
Last Year
- Issues event: 12
- Watch event: 3
- Delete event: 4
- Issue comment event: 19
- Push event: 73
- Pull request review event: 50
- Pull request review comment event: 65
- Pull request event: 23
- Fork event: 2
- Create event: 5
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| db368 | d****8@n****u | 539 |
| Gemuele Aludino | g****o@g****m | 329 |
| cadop | c****p | 324 |
| cadop | c****p@n****u | 127 |
| mariuszhermansdorfer | 4****r | 7 |
| github-actions[bot] | a****n@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 43
- Total pull requests: 55
- Average time to close issues: 5 months
- Average time to close pull requests: 13 days
- Total issue authors: 6
- Total pull request authors: 6
- Average comments per issue: 1.21
- Average comments per pull request: 0.65
- Merged pull requests: 41
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 12
- Pull requests: 23
- Average time to close issues: 3 months
- Average time to close pull requests: 2 days
- Issue authors: 3
- Pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.26
- Merged pull requests: 16
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- cadop (34)
- coliem (3)
- mariuszhermansdorfer (3)
- rkpamegan (1)
- Fruity-Grebbles (1)
- apric0ts (1)
Pull Request Authors
- cadop (38)
- coliem (6)
- rkpamegan (5)
- mariuszhermansdorfer (4)
- apric0ts (2)
- shinkee635 (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 36 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 7
- Total maintainers: 1
pypi.org: dhart
Design Humans Analysis RoboTics
- Homepage: https://github.com/cadop/dhart
- Documentation: https://dhart.readthedocs.io/
- License: GNU General Public License v3 (GPLv3)
-
Latest release: 0.2.8
published over 3 years ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- numpy *
- scipy *