-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Amirmit' of https://github.com/kieran-mackle/hypervehicle…
… into joss
- Loading branch information
Showing
23 changed files
with
586 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,10 @@ __pycache__/ | |
.coverage | ||
docs/build/ | ||
testing* | ||
build/ | ||
|
||
# Miscellaneous | ||
*.stl | ||
*.csv | ||
*.vtk | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.11" | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/source/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
formats: | ||
|
||
# Optional but recommended, declare the Python requirements required | ||
# to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
python: | ||
install: | ||
- requirements: docs/source/requirements.txt | ||
- method: pip | ||
path: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,50 @@ | ||
[](docs/hangar.md) | ||
|
||
<p align="center"> | ||
|
||
<a href="https://pypi.org/project/hypervehicle/"> | ||
<img src="https://img.shields.io/pypi/v/hypervehicle?color=blue&style=plastic" alt="Latest version" width=95 height=20> | ||
</a> | ||
|
||
<a href="https://github.com/psf/black"> | ||
<img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"> | ||
</a> | ||
|
||
<a> | ||
<img src="https://github.com/kieran-mackle/hypervehicle/actions/workflows/tests.yml/badge.svg" alt="Test Status" class="center"> | ||
</a> | ||
|
||
</p> | ||
|
||
A Python package to rapidly generate parametric geometries | ||
defined by hyperpatches. Check out the | ||
[hangar](docs/source/hangar.md) for some examples. | ||
|
||
|
||
## Getting Started | ||
## Installation | ||
|
||
### Prerequisites | ||
Hypervehicle relies on the [GDTK](https://github.com/gdtk-uq/gdtk) geometry | ||
package. Note that a full install of GDTK is not required. Instead, you can simply do a | ||
[sparse checkout](https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository) | ||
of the relevant files, using the commands below. | ||
To install `hypervehicle`, use the command below. | ||
|
||
``` | ||
mkdir gdtk | ||
cd gdtk/ | ||
git init | ||
git remote add -f origin https://github.com/gdtk-uq/gdtk.git | ||
git config core.sparseCheckout true | ||
echo "src/lib/" >> .git/info/sparse-checkout | ||
git pull origin master | ||
cd src/lib | ||
python3 -m pip install -e ./ | ||
cd ../../../ | ||
pip install hypervehicle | ||
``` | ||
|
||
#### PyMesh | ||
|
||
Having [PyMesh](https://github.com/PyMesh/PyMesh) installed can greatly enhance the capabilities | ||
offered by `HyperVehicle`. However, it can be difficult to install. Troubleshooting | ||
guide coming soon. | ||
|
||
## Usage | ||
Please see the [example geometry generation](docs/source/examples/x43.md) | ||
to generate a mockup of the X-43A, shown above. | ||
|
||
### Installation | ||
|
||
To install `hypervehicle` from source, use the command below. | ||
## Citing HyperVehicle | ||
If you use HyperVehicle in any published work, please cite it using the BibTex reference below. | ||
|
||
``` | ||
pip install git+https://github.com/kieran-mackle/hypervehicle | ||
```text | ||
@inproceedings{Mackle2024, | ||
author = {Mackle, Kieran and Jahn, Ingo}, | ||
booktitle = {AIAA Science and Technology Forum and Exposition}, | ||
title = {Efficient and Flexible Methodology for the Aerodynamic Shape Optimisation of Hypersonic Vehicle Concepts in a High-Dimensional Design Space}, | ||
year = {2024}, | ||
} | ||
``` | ||
|
||
## Usage | ||
Please see the [example geometry generation](docs/source/examples/x43.md) | ||
to generate a mockup of the X-43A, shown above. | ||
## License | ||
HyperVehicle is licensed under [GPLv3](COPYING). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sphinx | ||
furo | ||
sphinx_copybutton | ||
myst_parser | ||
sphinx_inline_tabs | ||
Jinja2<3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
from hypervehicle import Vehicle | ||
from hypervehicle.generator import Generator | ||
from hypervehicle.components import SweptComponent | ||
from hypervehicle.geometry import Vector3, Line, CoonsPatch | ||
|
||
|
||
class ParametricWedge(Generator): | ||
def __init__(self, **kwargs) -> None: | ||
# Wedge parameters | ||
self.wingspan = 1 | ||
self.chord = 1 | ||
self.thickness = 0.1 | ||
|
||
# Complete instantiation | ||
super().__init__(**kwargs) | ||
|
||
def create_instance(self) -> Vehicle: | ||
# Create vehicle object | ||
wedge_tags = Vehicle() | ||
wedge_tags.configure(name="Wedge_Tags", verbosity=1) | ||
|
||
# Define wedge cross-section points | ||
# ^ +y | ||
# | | ||
# W _ - _ N ___ | ||
# _ - | - _ | | ||
# +x <--- < -------------- > | thickness | ||
# - _ | _ - | | ||
# S - _ - E ___ | ||
# | ||
# |-----------------| | ||
# wingspan | ||
|
||
NW = Vector3(x=0, y=0.5 * self.thickness) | ||
NE = Vector3( | ||
x=-0.5 * self.chord, | ||
y=0, | ||
) | ||
SE = Vector3(x=0, y=-0.5 * self.thickness) | ||
SW = Vector3(x=0.5 * self.chord, y=0) | ||
|
||
# Define patches forming wedge | ||
sections = [] | ||
for i in [-1, 1]: | ||
z_loc = 0.5 * i * self.wingspan | ||
axial_shift = Vector3(x=0, y=0, z=z_loc) | ||
|
||
N = Line(p0=NW + axial_shift, p1=NE + axial_shift) | ||
S = Line(p0=SW + axial_shift, p1=SE + axial_shift) | ||
E = Line(p0=SE + axial_shift, p1=NE + axial_shift) | ||
W = Line(p0=SW + axial_shift, p1=NW + axial_shift) | ||
|
||
patch = CoonsPatch(north=N, south=S, east=E, west=W) | ||
sections.append(patch) | ||
|
||
fuselage_tags = { | ||
"swept_tag": "FreeStream", | ||
"end_0_tag": "Inlet", | ||
"end_1_tag": "Outlet", | ||
} | ||
fuselage = SweptComponent( | ||
cross_sections=sections, | ||
sweep_axis="z", | ||
stl_resolution=10, | ||
tags=fuselage_tags, | ||
) | ||
wedge_tags.add_component(fuselage) | ||
|
||
# Generate STL | ||
return wedge_tags | ||
|
||
|
||
if __name__ == "__main__": | ||
# To create the nominal geometry | ||
parametric_wedge_generator = ParametricWedge() | ||
wedge_tags = parametric_wedge_generator.create_instance() | ||
wedge_tags.generate() | ||
wedge_tags.to_vtk(prefix="tagged_wedge") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = "0.4.0" | ||
__version__ = "0.5.0" | ||
|
||
|
||
from .vehicle import Vehicle |
Oops, something went wrong.