coil-geom
coil-geom is a Python package for generating and visualizing coil and inductor geometries using clean, parametric definitions. It is designed for engineering, scientific visualization, and symbolic / schematic-style plotting.
- Pure geometry first (NumPy-friendly)
- Save coil geometry data as PPTX, SVG, and PDF
- Suitable for electronics, physics, and CAD-style workflows
Coil Types There are four types of coil geometry:
- Circle Coil
- Ellipse Coil
- Ellipse Coil with Curvature Similarity
- Ellipse Coil with Shape Similarity
Each coil geometry consists of three parts: primary coil(circle or ellipse) and transition coil(circle or ellipse). Primary coil can be a circle or an ellipse. Transition coil also can be a circle or an ellipse. CircleCoil has two primary circles and a transition circle in-betweens. EllipseCoil has two primary ellipses and a transition circle in-betweens. EllipseCoilShape has two primary ellipses and an transition ellipse with shape similarity. EllipseCoilCurvature has two primary ellipses and a transition ellipse with curvature similarity.
Circle Coil
Ellipse Coil
Ellipse Coil Shape Similarity
Ellipse Coil Curvature Similarity
🔗 Project Links
- GitHub Repository: https://github.com/uhwang/Coil-Geom
- PyPI Page: https://pypi.org/project/coil-geom/
- Issue Tracker: Report a bug
Installation
pip install coil-geom
Export Coil Geometries (PPTX, SVG, and PDF)
import coil_geom as cg
c_c_up = cg.CircleCoil(p_dist=0.7, ncoil=5)
c_c_dn = cg.CircleCoil(ncoil=5)
c_e_up = cg.EllipseCoil(p_dist=0.4, ncoil=5)
c_e_dn = cg.EllipseCoil(ncoil=5)
c_es_up = cg.EllipseCoilShape(p_dist=0.4, target=0.8, ncoil=5)
c_es_dn = cg.EllipseCoilShape(ncoil=5)
c_ec_up = cg.EllipseCoilCurvature(p_dist=0.4, ncoil=5)
c_ec_dn = cg.EllipseCoilCurvature(ncoil=5)
cg.save_ppt(c_c_up , "c_c_up.pptx" )
cg.save_ppt(c_c_dn , "c_c_dn.pptx" )
cg.save_ppt(c_e_up , "c_e_up.pptx" )
cg.save_ppt(c_e_dn , "c_e_dn.pptx" )
cg.save_ppt(c_es_up, "c_es_up.pptx", debug=True)
cg.save_ppt(c_es_dn, "c_es_dn.pptx", debug=True)
cg.save_ppt(c_ec_up, "c_ec_up.pptx", lead_l=2, lead_r=2)
cg.save_ppt(c_ec_dn, "c_ec_dn.pptx")
cg.save_svg(c_c_up , "c_c_up.svg" )
cg.save_svg(c_c_dn , "c_c_dn.svg" )
cg.save_svg(c_e_up , "c_e_up.svg" )
cg.save_svg(c_e_dn , "c_e_dn.svg" )
cg.save_svg(c_es_up, "c_es_up.svg", debug=True)
cg.save_svg(c_es_dn, "c_es_dn.svg", debug=True)
cg.save_svg(c_ec_up, "c_ec_up.svg", lead_l=2, lead_r=2)
cg.save_svg(c_ec_dn, "c_ec_dn.svg")
cg.save_pdf(c_c_up , "c_c_up.pdf" )
cg.save_pdf(c_c_dn , "c_c_dn.pdf" )
cg.save_pdf(c_e_up , "c_e_up.pdf" )
cg.save_pdf(c_e_dn , "c_e_dn.pdf" )
cg.save_pdf(c_es_up, "c_es_up.pdf", debug=True)
cg.save_pdf(c_es_dn, "c_es_dn.pdf", debug=True)
cg.save_pdf(c_ec_up, "c_ec_up.pdf")
cg.save_pdf(c_ec_dn, "c_ec_dn.pdf")
Plot Coil Geometries
import matplotlib.pyplot as plt
import coil_geom as cg
cc = cg.CircleCoil(ncoil=5)
ce = cg.EllipseCoil(ncoil=5)
ces = cg.EllipseCoilShape(ncoil=5)
cec = cg.EllipseCoilCurvature(ncoil=5)
x1, y1 = cc.get_geom()
x2, y2 = ce.get_geom()
x3, y3 = ces.get_geom()
x4, y4 = cec.get_geom()
fig, axs = plt.subplots(nrows=4, ncols=1, figsize=(8, 6))
fig.suptitle('Circle & Ellipse Coil Geometry')
axs[0].plot(x1, y1)
axs[0].set_aspect('equal')
axs[1].plot(x2, y2)
axs[1].set_aspect('equal')
axs[2].plot(x3, y3)
axs[2].set_aspect('equal')
axs[3].plot(x4, y4)
axs[3].set_aspect('equal')
plt.show()
Plot 3 Phase Delta Connection
def three_delta(coil, lead_l, lead_r):
xs, ys = [], []
c1 = coil.create_geom(False, lead_l, lead_r)
xs.append(c1.x)
ys.append(c1.y)
c2 = c1.flipud().rotate(60, axis=0)
xs.append(c2.x)
ys.append(c2.y)
c3 = c1.flipud().rotate(-60, axis=2)
xs.append(c3.x)
ys.append(c3.y)
return xs, ys
Plot 3 Phase Y Connection
def three_y(coil, lead_l, lead_r):
xs, ys = [], []
c = coil.create_geom(False, lead_l, lead_r)
c1 = c.rotate(90, axis=0)
xs.append(c1.x)
ys.append(c1.y)
c2 = c1.rotate(120, axis=0)
xs.append(c2.x)
ys.append(c2.y)
c3 = c2.rotate(120, axis=0)
xs.append(c3.x)
ys.append(c3.y)
return xs, ys
Metadata
Release files for coil-geom 0.2.25
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| coil_geom-0.2.25.tar.gz | 18.7 kB | Without provenance | Details for coil_geom-0.2.25.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coil_geom-0.2.25-py3-none-any.whl | Python 3 | none | any | Details for coil_geom-0.2.25-py3-none-any.whl |
Total release size: 37.4 kB
Release files / coil_geom-0.2.25.tar.gz
| Download URL | coil_geom-0.2.25.tar.gz |
|---|---|
| Size | 18.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2a513aa5de8037c98d438ee17534d91809f5fab6c8c738204744a852586213a
|
|
BLAKE2b-256 checksum How to use checksums |
3ecb6cfd23cda245a45c576f7aebfb8554299a8b6c4efadefae08fa3fd8b55e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.9
|
Release files / coil_geom-0.2.25-py3-none-any.whl
| Download URL | coil_geom-0.2.25-py3-none-any.whl |
|---|---|
| Size | 18.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2000f1afc177d7c1f1909b2899d564368ddad0b398be82f21c1cc46b08c3e88
|
|
BLAKE2b-256 checksum How to use checksums |
8bd33697273449e0befcdf79d116c9d3704967a3c4231ff18064a60e4ab7dc6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.9
|
Security for coil-geom 0.2.25
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.