Skip to content

Commit

Permalink
update readme and toc size
Browse files Browse the repository at this point in the history
  • Loading branch information
cadop committed Jul 5, 2022
1 parent e8cd070 commit ec479f3
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 97 deletions.
75 changes: 75 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

### Prelim

This guide will describe how to retrieve the contents of this repository,
and build from source.

Please note: DHART is currently designed to run on a PC running the Windows 10
operating system.
Also note: This guide is a 'work-in-progress' and subject to change.

Git for Windows:
If you do not already have Git for Windows on your machine,
please download and install Git for Windows at https://gitforwindows.org/
Microsoft Visual Studio 2019:
https://visualstudio.microsoft.com/downloads/
You may use the Community edition.
CMake (Windows win64-x64)
https://cmake.org/download/


Once the software above is installed on your machine,
you may continue with the following:

0. Open Git Bash.
Git Bash (MINGW64) begins at ~, your home directory.
You may remain here, or navigate to a directory of your choice.
In the next step, you will clone the repository.

1. Type git clone [email protected]/cadop/dhart.git at the prompt
and hit ENTER. The repository will then be cloned to your local machine.


### Using CMAKE Commands

Currently we directly call the configuration arguments when using cmake.

Python Debug

1. `cmake ./src/ -G"Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM="x64" -DCMAKE_CONFIGURATION_TYPES="Debug" -DCMAKE_INSTALL_PREFIX=".\..\build\Python" -DDHARTAPI_Config="All" -DDHARTAPI_EnableTests="False" -DDHARTAPI_EnablePython="True" -DDHARTAPI_EnableCSharp="False" -DINSTALL_GTEST="False" ".\" 2>&1`

1. `cmake --build . --config Debug`

Python Release

1. `cmake ./src/ -G"Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM="x64" -DCMAKE_INSTALL_PREFIX=".\..\build\Python" -DDHARTAPI_Config="All" -DDHARTAPI_EnableTests="False" -DCMAKE_CONFIGURATION_TYPES="Release" -DDHARTAPI_EnablePython="True" -DDHARTAPI_EnableCSharp="False" -DINSTALL_GTEST="False" ".\" 2>&1`

1. `cmake --build . --config Release`

Then
1. `cmake --install .`

1. cd to build/Python and run `pip install .`

### Using Visual Studio

1. Open Microsoft Visual Studio 2019. After seeing the splash/welcome screen, please click the button that reads Open a local folder.


1. When the Browse window appears, navigate to the folder
(the repository that you had cloned) on your local machine.
Then, navigate to `src/`. Click the Select folder button to confirm.

1. You may see a banner that asks to generate or configure the cmake project. Click generate.

1. If the Solution Explorer view is not already open, you may open by
navigating to View > Solution Explorer, or alternatively, you can also use the Ctrl + Alt + L shortcut to reveal Solution Explorer. Here, you can examine the sources imported by Visual Studio.

1. We are now ready to build.
CMake is used to aid in the compilation process.
There are a few provided configuration files. Specifically, debug and release, as well as C# and Python specific ones. Select the one you are interested in and navigate to Build > Build All.

1. Once it has successfully built, you need to install. Going back to the same build menu dropdown, click on install. This will save the files to a build directory.


You can find the build files in .\dhart\src\out\build\x64-Debug
113 changes: 23 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@

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 and custom metrics, and use these tools inside of a variety of programs such as Unity, Rhino, Revit, and more.
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 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.

Currently it is only available on Windows OS. We happily would accept contributors to help expand to Linux.
### Limitations

Features
--------
- Currently it is only available on Windows OS. (We happily would accept contributors to help expand to Linux. )
- Integration with Rhino is currently limited to viewing analysis results through `json` files.

### 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
Expand All @@ -19,11 +28,10 @@ Features
- 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
- Demos and instructions for integrating with Rhino 3D and Unity
- Demos and instructions for integrating with Unity


Credits
-------
## Credits


This repository contains work that was supported in part by the U.S.
Expand All @@ -32,6 +40,10 @@ 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,
Expand All @@ -45,8 +57,6 @@ If you find this repo useful, please cite using the following bibtex
}
```

There were dozens of contributors to this project over the years. It has been led by Mathew Schwartz (NJIT) with a large part of the development by Drew Balletto.


Example Usage
-------------
Expand Down Expand Up @@ -95,7 +105,7 @@ print(f"Does the ray connect? {does_occlude}")

which would output

```python
```
Hit point: (0.0, 0.0, 0.0)
distance is 2.0, meshid is 0
Does the ray connect? True
Expand All @@ -109,6 +119,7 @@ Installing
----------

- Requires Windows 10
- Tested on Python 3.8 +

For Python you can use

Expand All @@ -119,88 +130,10 @@ For Python you can use
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.

Depending on your goal, you may want to download the Python or the C# release. Each one has a different process.

When visiting the documentation page, click on Python to follow installation guide for running in a python environment or as a Python Grasshopper node for Rhino. Click on the C# documentation for a guide on how to use the project with Unity.
We supply `.dll`'s to try and make the installation and linking process as easy as possible.


Building from Source
--------------------

### Prelim

This guide will describe how to retrieve the contents of this repository,
and build from source.

Please note: DHART is currently designed to run on a PC running the Windows 10
operating system.
Also note: This guide is a 'work-in-progress' and subject to change.

Git for Windows:
If you do not already have Git for Windows on your machine,
please download and install Git for Windows at https://gitforwindows.org/
Microsoft Visual Studio 2019:
https://visualstudio.microsoft.com/downloads/
You may use the Community edition.
CMake (Windows win64-x64)
https://cmake.org/download/


Once the software above is installed on your machine,
you may continue with the following:

0. Open Git Bash.
Git Bash (MINGW64) begins at ~, your home directory.
You may remain here, or navigate to a directory of your choice.
In the next step, you will clone the repository.

1. Type git clone [email protected]/cadop/dhart.git at the prompt
and hit ENTER. The repository will then be cloned to your local machine.


### Using CMAKE Commands

Currently we directly call the configuration arguments when using cmake.

Python Debug

1. `cmake ./src/ -G"Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM="x64" -DCMAKE_CONFIGURATION_TYPES="Debug" -DCMAKE_INSTALL_PREFIX=".\..\build\Python" -DDHARTAPI_Config="All" -DDHARTAPI_EnableTests="False" -DDHARTAPI_EnablePython="True" -DDHARTAPI_EnableCSharp="False" -DINSTALL_GTEST="False" ".\" 2>&1`

1. `cmake --build . --config Debug`

Python Release

1. `cmake ./src/ -G"Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM="x64" -DCMAKE_INSTALL_PREFIX=".\..\build\Python" -DDHARTAPI_Config="All" -DDHARTAPI_EnableTests="False" -DCMAKE_CONFIGURATION_TYPES="Release" -DDHARTAPI_EnablePython="True" -DDHARTAPI_EnableCSharp="False" -DINSTALL_GTEST="False" ".\" 2>&1`

1. `cmake --build . --config Release`

1. `cmake --install .`

1. cd to build/Python and run `pip install .`

### Using Visual Studio



1. Open Microsoft Visual Studio 2019. After seeing the splash/welcome screen, please click the button that reads Open a local folder.


1. When the Browse window appears, navigate to the folder
(the repository that you had cloned) on your local machine.
Then, navigate to `src/`. Click the Select folder button to confirm.

1. You may see a banner that asks to generate or configure the cmake project. Click generate.

1. If the Solution Explorer view is not already open, you may open by
navigating to View > Solution Explorer, or alternatively, you can also use the Ctrl + Alt + L shortcut to reveal Solution Explorer. Here, you can examine the sources imported by Visual Studio.

1. We are now ready to build.
CMake is used to aid in the compilation process.
There are a few provided configuration files. Specifically, debug and release, as well as C# and Python specific ones. Select the one you are interested in and navigate to Build > Build All.

1. Once it has successfully built, you need to install. Going back to the same build menu dropdown, click on install. This will save the files to a build directory.


You can find the build files in .\dhart\src\out\build\x64-Debug
You can use cmake on the commandline or Visual Studio, follow the instructions in `BUILD.md` to get started.
2 changes: 1 addition & 1 deletion docs/Python Docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Contents
To get started from the very beginning with this package, please follow the installation guide below.

.. toctree::
:maxdepth: 2
:maxdepth: 5

install.rst
start.rst
Expand Down
12 changes: 6 additions & 6 deletions docs/Python Docs/source/user_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ with ``python``. Depending on your case, you will type:


In the above line ``[preferred name]`` is really what you would like it to say. For this explanation,
we will call the environment ``hf_analysis``, which means you type:
we will call the environment ``dhart_venv``, which means you type:


``py -3.8 -m venv hf_analysis``
``py -3.8 -m venv dhart_venv``


It should take a second or two to finish. You will not see anything happen. If you now type ``dir``, you should
see a folder called ``hf_analysis``. Now you need to 'activate' the virtual environment by typing:
see a folder called ``dhart_venv``. Now you need to 'activate' the virtual environment by typing:


``hf_analysis\Scripts\activate``
``dhart_venv\Scripts\activate``


Now you should see ``(hf_analysis)`` before the directory in the command prompt. This means you are successfully
Now you should see ``(dhart_venv)`` before the directory in the command prompt. This means you are successfully
in the virtual environment. Anytime you want to reload the installed environment, you will navigate to the
folder you made and type the above line for activating the environment. If you want to end your virtual environment,
simply type ``deactivate`` in the command prompt.
Expand Down Expand Up @@ -96,4 +96,4 @@ You should see the output being a path to your virtual environment folder:

``[your directory]\\lib\\site-packages\\dhart\\Example Models\\``

Where [your directory] would be ``C:\\Documents\\py_envs\\hf_analysis`` if following the directions in this document.
Where [your directory] would be ``C:\\Documents\\py_envs\\dhart_venv`` if following the directions in this document.
Binary file added featured_ex.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ec479f3

Please sign in to comment.