Skip to main content

Parametric coil and inductor geometry generator

Project description

PyPI - Version PyPI - License

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:

  1. Circle Coil
  2. Ellipse Coil
  3. Ellipse Coil with Curvature Similarity
  4. 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

Alt Text

Ellipse Coil

Alt Text

Ellipse Coil Shape Similarity

Alt Text

Ellipse Coil Curvature Similarity

Alt Text

Plot Coil Geometries

Alt Text

🔗 Project Links

Installation

pip install coil-geom
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")
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.create_geom()
x2, y2 = ce.create_geom()
x3, y3 = ces.create_geom()
x4, y4 = cec.create_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()

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

coil_geom-0.2.15.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

coil_geom-0.2.15-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file coil_geom-0.2.15.tar.gz.

File metadata

  • Download URL: coil_geom-0.2.15.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.9

File hashes

Hashes for coil_geom-0.2.15.tar.gz
Algorithm Hash digest
SHA256 1509970f0388bc86ab77db70bc7123ac9bb6c858f90f5f08891266a079d3232e
MD5 4bccc938590a3f8ee0db75d2278c6f82
BLAKE2b-256 0b83c02d582f6135c1bdae97795ec14d5e6eccb99a5e1671d1dc7b6cbc48870b

See more details on using hashes here.

File details

Details for the file coil_geom-0.2.15-py3-none-any.whl.

File metadata

  • Download URL: coil_geom-0.2.15-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.9

File hashes

Hashes for coil_geom-0.2.15-py3-none-any.whl
Algorithm Hash digest
SHA256 2fdb9e6f03622c483cb9e8d1f22c5cc6054b7257e7d8f6d5bc2b99f88d2de19b
MD5 529bb94db96cc51c54119f10771fcb16
BLAKE2b-256 4b22c1f67aca059b3c3fc5ae547cc77b6e2c4ea37706d9b875f973dd430c77fe

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