Skip to main content

Geometry Box

A simple python package for geometrical operations.

import geometry_box as gb

circle = gb.Circle(radius=2.0, cent=(3.0, 6.0))
print(circle.area)  # prints circle area
print(circle.perimeter)  # prints circle perimeter
circle.shape_factor()  # returns shape factor: perimeter/equivalent circle perimeter.
circle.eval_locus(num_points=50)  # finds 50 points along the periphery of circle
circle.eval_locus(num_points=250).plot()  # plots a circle displays using `matplotlib.pyplot.show()`
circle.eval_locus().plot(f_path='/path/to/file')  # saves a plot at the specified path
#
import matplotlib.pyplot as plt

fig, axs = plt.subplots()
circle.eval_locus().plot(axis=axs)  # plots circle on the axs object

A sample code for plotting various shapes

import geometry_box as gb
from os import path
import matplotlib.pyplot as plt

fig, axs = plt.subplots(2, 4)
gb.Circle().eval_locus().plot(axis=axs[0, 0])
gb.Ellipse().eval_locus().plot(axis=axs[0, 1])
gb.RegularPolygon(3).eval_locus().plot(axis=axs[0, 2])
gb.Rectangle().eval_locus().plot(axis=axs[0, 3])
gb.BoundingBox2D().eval_locus().plot(axis=axs[1, 0])
gb.CShape().eval_locus().plot(axis=axs[1, 1])
gb.Capsule().eval_locus().plot(axis=axs[1, 2])
gb.NLobeShape(3).eval_locus().plot(axis=axs[1, 3])
plt.tight_layout()
plt.savefig(path.join(path.dirname(__file__), "shapes.pdf"))
plt.close()

It produces the following figure

Shape

Metadata

Release files for geometry-box 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geometry-box 0.1.2
File Size Uploaded Provenance Actions
geometry_box-0.1.2.tar.gz 9.1 kB Without provenance Details for geometry_box-0.1.2.tar.gz

Release files / geometry_box-0.1.2.tar.gz

Download URL geometry_box-0.1.2.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ac11bced9973cc3ddcf9703eea4df2cff5d0fb30d6bc82dd4c6df79ea5fb7deb
BLAKE2b-256 checksum
How to use checksums
b6b7e3c95612109e17fd3556f51a68622c1e7bfe603d16ac2f3633d7a953e77e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Security for geometry-box 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page