Making Oval and Half-Oval Shapes for Symbols

I don’t know if this is possible with KiCad (I couldn’t find an option) so I wrote a Python program to do it. It is handy to do stuff like this (setting aside for now whether an oval shape is appropriate for MOSFETs or not!):

Using it is pretty simple:

(Ignore the fact that the screenshot shows version 7.0; I tested on version 8.0).
Omit the ‘split’ parameter to draw a full oval.

@shabaz

Are these true ovals, semicircles or joined arcs?

Hello,
They are polylines, since I could not find a way to combine arcs and lines into a single shape.
The degrees between points is configurable in the Python code, for finer granularity on the curve.


The value to change is called degrees_per_step in the code, I set it to 15 degrees since that looks almost curved on a component the size of a MOSFET etc., but for a much larger shape, maybe it would be good to change that value to (say) 5 degrees.
Essentially, the program is drawing one polyline, that is composed of the top and bottom horizontal lines, plus all the finer lines that make the curve, at either one end (for a half oval), or at both ends for the full oval.

I took apart a 74ls00:

The right side is a semi circle, and the left side is a polyline with three segments. Both are filled with the background color.

You can also turn off the border in the properties of a polygon, which then just leaves the fill:

Edit: @shabaz It was by no means my intention to criticize your method. My only intention was to make an amendment with an alternative method, so others who search this forum later can decide for themselves which method is best for their situation.

2 Likes

The oval and half-oval are slightly different, in that there is a straight length at the top and bottom (disconnected at the left side for the so-called “half-oval”, and connected with another symmetrical shape at the other end. I couldn’t see how to achieve that with the semi-circle primitive.

Oh, no offence taken. I appreciated the comments.
I didn’t realize it was possible to have the fill and no border. That’s actually a much better solution, since then the user can just draw the straight lines at just the top and bottom of the rectangular shape.

Edit: Confirmed that your method works well. The screenshot below shows the method you mention for the top two shapes, and the Python line segments method at the bottom.

The upper shape is the dissected Nor/Or gate from the Kicad library.

The lower shape is a drawing by me consisting of two 90° arcs and four graphic lines.

I was a bit curious about the hollow arc in the 4001, so I also took it apart in the symbol editor. It is a polygon without border, and some “guessed” points along the arc. The arc makes the end nice and smooth, while the jagged polygon edge is covered by the width of the line from the arc.

Just for completion:

A polygon or the line function can be used, in the Symbol Editor only, to create a filled segment.
A line consisting of two or more sections will fill using the Right Mouse Button then select Properties. See the top two illustrations.
Two independent but connected lines will not work.

To create arcs: Draw an Arc between two points. (green arrows).
Close Arc function.
Left click highlight that arc (which will then show the radius point; red arrow).
Place cursor on radius point.
Left mouse button hold down to change radius.

To avoid the “guessed” points, draw the arc and the top & bottom lines first, then draw a multipart line (with no border) on a finer grid over the top of the border lines and arc.

If any reader, especially new to Kicad people, are unsure how a symbol or footprint is created, just open a suitable example in either the Footprint or Symbol Editor and pull the item apart to see how it was constructed. When you have finished exploring the item, close the Editor.

Permanent harm cannot occur to Kicad library items as they are “Read only”.:grinning:

Yes, that is what I call guessing :slight_smile:
… And you can guess more accurately by holding down the [Ctrl] key, which supresses grid snapping.

The comment wasn’t aimed at you.

The comment was for all those people who avoid the Footprint and Symbol Editors because they think they are too hard and time consuming.

First drawing an arc and then placing a series of joined lines over the top of that arc requires little guesswork or brain power; as both you and I know.

I was preaching to the unconverted :grinning:

It would make drawing easier if the intersection snapping code of kicad nightly in PCB editor could be ported to the symbol and footprint editors. Or allow copy pasting form pcb editor into symbol editor with some layer logic.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.