Skip to main content

Add your description here

Project description

random-shapes

Generate random shapes with ease.

Logo

Installation

You can install random-shapes via pip:

    pip install random-shapes

However, uv is recommended for installing python packages:

    uv add random-shapes

Usage

Install the optional library matplotlib for visualization:

    pip install random-shapes[viz]
    # or
    uv add random-shapes --extra viz

With random-shapes it is easy to generate a random shape (bezier.Curve):

    from random_shapes import get_random_shape

    shp = get_random_shape(n=10, r=0.05, edgy=0.2)
    shp.plot(pts_per_edge=10)

Random shape example

This shape can then be turned into a binary image:

    import matplotlib.pyplot as plt

    from random_shapes import bezier_polygon_to_binary_image

    binary_image = bezier_polygon_to_binary_image(shp)
    plt.imshow(binary_image, cmap="gray")

Binary image example

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

random_shapes-0.0.1.tar.gz (566.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

random_shapes-0.0.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file random_shapes-0.0.1.tar.gz.

File metadata

  • Download URL: random_shapes-0.0.1.tar.gz
  • Upload date:
  • Size: 566.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.24

File hashes

Hashes for random_shapes-0.0.1.tar.gz
Algorithm Hash digest
SHA256 707c21bc26649efd88b8e6b6570bcf5ae207c1ab0a9d80e15081535dadb672b0
MD5 a60f070613751a9c671822954881f791
BLAKE2b-256 57959d8545cbeca454bfa1bec86b2d25f4b07f27439810ce9fde59d80f9acd86

See more details on using hashes here.

File details

Details for the file random_shapes-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for random_shapes-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c66d294cc02906e7afbc85116458e829b2da5e0966f01c300e04aa4d7d345a4e
MD5 9d19603e32344b797cf9a870e35b4768
BLAKE2b-256 4c6510c0c698243c6eec7b2e89f70d7c0ec76749c702e875fbc6fab25376ba1f

See more details on using hashes here.

Supported by

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