Skip to main content

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

Project description

Taperable Helix

Documentation Status

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

Package Docs

def helix(
    radius: float,
    pitch: float,
    height: float,
    taper_rpos: float = 0,
    inset_offset: float = 0,
    horz_offset: float = 0,
    vert_offset: float = 0,
    first_t: float = 0,
    last_t: float = 1,
) -> Callable[[float], Tuple[float, float, float]]:
    ...

Examples

def helical_line(
    radius: float = 5, pitch: float = 2, height: float = 6, num_points: int = 100
) -> List[Tuple[float, float, float]]:
    f = helix(radius, pitch, height)
    points = list(map(f, linspace(start=0, stop=1, num=num_points, dtype=float)))
    # print(f"helical_line: points={points}")
    return points
/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]],
]:
    taper_out_rpos = 0.1
    taper_in_rpos = 0.9
    first_t = 0
    last_t = 1

    # Create three helixes that taper to a point
    fU = helix(radius, pitch, height, taper_out_rpos=taper_out_rpos, taper_in_rpos=taper_in_rpos, vert_offset=tri_height / 2)
    points_fU = list(map(fU, linspace(first_t, last_t, num=100, dtype=float)))

    fM = helix(radius, pitch, height, taper_out_rpos=taper_out_rpos, taper_in_rpos=taper_in_rpos, horz_offset=tri_width)
    points_fM = list(map(fM, linspace(first_t, last_t, num=100, dtype=float)))

    fL = helix(
        radius, pitch, height, taper_out_rpos=taper_out_rpos, taper_in_rpos=taper_in_rpos, vert_offset=-tri_height / 2
    )
    points_fL = list(map(fL, linspace(first_t, last_t, num=100, dtype=float)))
    return (points_fU, points_fM, points_fL)
/data/helical_tri.webp

Prerequisites

Using

  • python >= 3.7

Development and Examples

  • sphinx

  • plotly

    • numpy

    • panda

    • python-kaleido

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.

History

0.1.0 (2020-08-31)

  • First release on PyPI.

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.6.1.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

taperable_helix-0.6.1-py2.py3-none-any.whl (6.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: taperable_helix-0.6.1.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for taperable_helix-0.6.1.tar.gz
Algorithm Hash digest
SHA256 b2cde6d569d9613167379036dbc02edd8bef914a35b16ba7d9ff18340d407724
MD5 239188312770f598f087de4edc1affd8
BLAKE2b-256 4b7044b4cdff5366be6ecf25873b30ced44ef4c7d329b2d1000f1e9dc03b23f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: taperable_helix-0.6.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.7 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/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for taperable_helix-0.6.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b3adb262beec5580f9b5eec2dccf07e8f18c85a3559dde8de05b79a1162fed70
MD5 8e284d19bb74b071c41ccde87e5855a0
BLAKE2b-256 84983d07c42c2b33db627d21a7027e265be1341289794b4c994835510f993a29

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