Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Loopy inductors / chokes #190

@conjoneshmc

Description

@conjoneshmc

Description

The current symbol for inductors features bumps on the side (at least for the IEEE variant). However, inductors can also be drawn with a series of loops instead, so that it looks more like a coil. I noticed this feature was missing from the component library so I thought I'd request it here.

The math for drawing this component would probably be hard to figure out manually, but CeTZ comes to the rescue and has a handy cetz.decorations.coil function that can do most of the heavy lifting. So it shouldn't be too difficult to implement.

We could probably modify the existing inductor component to accept a coiled parameter and draws the bumpy or loopy version of the inductor depending on whether it's set or not. CeTZ's coil utility also accepts some extra parameters like coil ratio or amplitude, so we could add them to the inductor's style parameters as well.

Here is my best attempt at making it:

    #let draw(ctx, position, style) = {
        interface((-style.width / 2, -style.height / 2), (style.width / 2, style.height / 2), io: position.len() < 2)

        set-style(stroke: style.stroke)
        coil(
            line((-style.width / 2, 0), (style.width / 2, 0)),
            amplitude: style.height,
            segments: style.bumps,
            factor: style.coil-ratio
        )

        if variable {
            adjust-arrow("variable")
        } else if preset {
            adjust-arrow("preset")
        } else if sensor {
            adjust-arrow("sensor")
        }
    }
Image

Side note: I also thought of adding a "flipped" parameter to the inductor that controls which side the bumps or loops are drawn on. There are also some other variants that have lines going through the center to indicate what core the inductor is made of, but that's probably best for another issue.

References or images

Here is the reference I loosely tried to base my component off:

Image

Contribute

  • I am willing to submit a pull request for this feature
  • I can help with testing this feature

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions