Generate helixes that can optionally taper to a point at each end.
Project description
Generate helixes that can optionally taper to a point at each end.
GitHub repo: https://github.com/winksaville/py-taperable-helix/
Documentation: https://taperable-helix.readthedocs.io/
PyPi package: https://pypi.org/project/taperable-helix/
Test PyPi package: https://test.pypi.org/project/taperable-helix/
Free software: MIT license
Source: helix.py
Examples
def helical_line(
radius: float = 5, pitch: float = 2, height: float = 6, num_points: int = 100
) -> List[Tuple[float, float, float]]:
h: Helix = Helix(radius=radius, pitch=pitch, height=height)
f = h.helix()
points = list(map(f, linspace(start=0, stop=1, num=num_points, dtype=float)))
# print(f"helical_line: points={points}")
return points
def helical_triangle(
radius: float = 1,
pitch: float = 2,
height: float = 4,
num_points: int = 100,
tri_height: float = 0.2,
tri_width: float = 0.2,
) -> Tuple[
List[Tuple[float, float, float]],
List[Tuple[float, float, float]],
List[Tuple[float, float, float]],
]:
# Create three helixes that taper to a point
# Create the base Helix
h: Helix = Helix(
radius=radius, pitch=pitch, height=height, taper_out_rpos=0.1, taper_in_rpos=0.9
)
# The Upper points, horz_offset defaults to 0
fU = h.helix(HelixLocation(vert_offset=tri_height / 2))
points_fU = list(map(fU, linspace(h.first_t, h.last_t, num=100, dtype=float)))
# The Lower points, again horz_offset defaults to 0
fL = h.helix(HelixLocation(vert_offset=-tri_height / 2))
points_fL = list(map(fL, linspace(h.first_t, h.last_t, num=100, dtype=float)))
# The Middle point, change vert_offset to 0
fM = h.helix(HelixLocation(horz_offset=tri_width))
points_fM = list(map(fM, linspace(h.first_t, h.last_t, num=100, dtype=float)))
return (points_fU, points_fM, points_fL)
Prerequisites
Using
python >= 3.7
Development and Examples
See dev-requirements.in for most up to date list:
pip-tools
bump2version
wheel
isort
black
flake8
tox
tox-conda
coverage
Sphinx~=3.2
sphinx-autodoc-typehints~=1.11
sphinx-prompt~=1.3
sphinx_substitution_extensions>=2020.09.30, <2021.12.00
twine
pytest
pytest-runner
Credits
This code originated from a post by Adam Urbanczyk to the CadQuery forum and this package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file taperable_helix-0.8.17.tar.gz.
File metadata
- Download URL: taperable_helix-0.8.17.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db74760cb7e5084730d537d414a800f144c84ed9e9fcd288f1941d5f7f66b0df
|
|
| MD5 |
3aacf3367c45d9af7c4250db571e2a3f
|
|
| BLAKE2b-256 |
a8c8a8f452c894344a57ba29737bcf318786145e3a245e6e49eaff768f3e7613
|
File details
Details for the file taperable_helix-0.8.17-py2.py3-none-any.whl.
File metadata
- Download URL: taperable_helix-0.8.17-py2.py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d166f9a4287b19c525da565046b528eb3a390a55ddcf02a887fe3eecb9ed0238
|
|
| MD5 |
4b9b23be1d6a8def8422bbbd701d5f44
|
|
| BLAKE2b-256 |
0fadaf867cedd33d192cc0c51edfcaf68b9ea09e143e4e32926debc24bf97488
|