Skip to main content

Generate helixes that can optionally taper to a point at each end.

Project description

https://img.shields.io/pypi/v/taperable_helix.svg Documentation Status

Generate helixes that can optionally taper to a point at each end.

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
https://raw.githubusercontent.com/winksaville/py-taperable-helix/master/data/helical_line.webp
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)
https://raw.githubusercontent.com/winksaville/py-taperable-helix/master/data/helical_tri.webp

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

taperable_helix-0.8.12.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

taperable_helix-0.8.12-py2.py3-none-any.whl (7.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file taperable_helix-0.8.12.tar.gz.

File metadata

  • Download URL: taperable_helix-0.8.12.tar.gz
  • Upload date:
  • Size: 18.9 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

Hashes for taperable_helix-0.8.12.tar.gz
Algorithm Hash digest
SHA256 d9c47d699f07350952fe6d40b10068a03daff6d9d40e72a00a7d46eef93fb344
MD5 54231db0f1dc1594707fa70c05dfb2ff
BLAKE2b-256 89e30f67d08e0f015eb8a73a902a0d812440fa7b70bf794a03c8c5b5ce78d83d

See more details on using hashes here.

File details

Details for the file taperable_helix-0.8.12-py2.py3-none-any.whl.

File metadata

  • Download URL: taperable_helix-0.8.12-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

Hashes for taperable_helix-0.8.12-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 97afa47ad3166cfa976305764cd0b4ae64bef8a10ffc31828e4a5258ea41d539
MD5 bc7422543a84e00bd703e12e0df595da
BLAKE2b-256 535b868a3a880f16b0da1477c6ad8fdfcb8e3e915f822dccb20771c853af6fd9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page