Possible to subtract shapes in footprints or layout?

Is there a way to knock one shape out from another in KiCad? For text, there is a knockout option, but it creates a box. Am I missing a trick, or is this a missing feature? Is there any way to subtract shapes on a layer?

I.e. in this example subtract the X from the circle

If you turn the circle into a ā€œcopper regionā€ (doesnā€™t need to be on a copper layer), the text can knock a hole into it with ā€œKnockoutā€ enabled. Make sure to update copper fills (with B key). However the text will still have its rectangular outline.

You didnā€™t say what you want to subtract the ā€˜Xā€™ from and/or expose. So, Iā€™ll assume you want to Knock-Out the Copper ā€˜Xā€™ from Copper layer

Hereā€™s the way I do itā€¦ with some examplesā€¦, including 'sketched itemsā€¦ (Kicad v6)

I still donā€™t think I quite get it. How can I have a footprint with an X filled with solder mask inside of a circle with no solder mask?

Pretty much how you already tried, except that you canā€™t use a filled circle. It should be a ring. Depending on the size of the text you may need to fill empty spaces with e.g. lines. And there are unfortunately pretty large margins around the letter in the box.

kuva

1 Like

Ah. It would be a really nice feature to be able to subtract two polygons from each other on any layer. I guess weā€™d need the ability to create from selection > polygon for text as a prerequisite for this example though.

I admit Iā€™m not clear on ā€˜Exactlyā€™ what you want, especially regarding the ā€˜Circleā€™ (so, clarify it for my old brain).
That said, getting the ā€œXā€ in Solder-Mask without the Square is simpleā€¦

An arbitrary shape such as this, with some black text in it. The image shows a diamond exposing the FR4 inside with some copper layer pattern on the back. Just want to draw text in solder mask on the diamond (or circle, or whatever :slight_smile: ).

Setting aside the ā€˜Shapeā€™ (diamond, circle, squareā€¦etc), this is the best of my effortā€¦

All are on the Back.

So you did this with filled zones technique you bullet pointed out above? Is that possible to do with a footprint?

I did Not use any Zones. The Copper Rectangle is simply a ā€˜Filledā€™ Rectangle.

All other items are Footprints made by the ā€˜Image_Converterā€™ tool from .png graphics made with Transparent background (in a Graphics program). Double-clicked and set to Back layer.

And, Iā€™m still not clear on your goal - in fact, Iā€™m wondering if youā€™re wanting ā€˜No Maskā€™ in the shape of a Text ā€˜Xā€™ that has No masking such that itā€™s Unmasked area exposes the Copper)ā€¦ Thatā€™s why I put the Copper Rectangle there so the 3D-view would Clarify for you that a ā€˜Maskā€™ covers the Copper.

And, if thatā€™s the case, my first post above exposes what I suspect is your ā€˜Subtractionā€™ goal that exposes Copper. And, itā€™s just a matter of which ā€˜sideā€™ so, to speak, of the Lines/Text to expose - meaning, it could be the Inverse of my graphicsā€¦

Thanks for taking the time to get back to me again. I appreciate it.

Just to make it super clear what I mean by a ā€˜subtractionā€™ operation, I pasted the following graphics (credit goes here). In vector graphics applications (and I guess the footprint editor is just a specialised vector graphics app) a common workflow is to create complex shapes from primitive shapes using subtraction operations. In this example, you can see the more complex shape is subtracted from the simple shape to create a new polygon.

KiCad has the option ā€˜Create polygon from selectionā€™, so it is almost at the finish line for functionality to do a subtraction op.

The image in my original post has probably added to the confusion as Iā€™d gone off track trying to get the result I wanted. What Iā€™d expect to be able to do is draw a primitive shape, draw some text, convert text to polygon, and then just hit the punch-out/knockout/subtraction button and be on my merry way with the next task. The specific layer is somewhat irrelevant, although F.Mask and B.Mask are unique in that they specify areas where material is not deposited in manufacture, but the technique I mention would be very useful for generating polygons on any layer.

Just thinking out loud here, but with such functionality, we could do away with the slightly odd ā€˜knockoutā€™ option in the footprint text properties dialogue and replace it with a more generic workflow.

image
image
image

Iā€™ve written Appā€™s for creating SVG graphics and fully understand ā€˜Subtractionā€™ including SVG"sā€™Intrinsicā€™ subtraction and ā€˜Pathā€™ usageā€¦

You canā€™t do that in Kicad with layers.

In PCB mfg, when you want to expose (or cover) a particular Area/Shape (having Copper underneath), you indicate it on a Drawing (similar as shown on this product that I have a Patent for), but would indicate ā€œNo Solder Mask Over This Areaā€.

Sounds like you should make a Kicad Feature Request (I think thereā€™s a Form/Page to do itā€¦ I donā€™t know but have seen others refer to it.)

The four rectangular cutouts in PCB SVG below are done with ā€˜Intrinsicā€™ subtraction
LoveItPCB

Well. I guess Iā€™ll muddle along with the image conversion approach then for now. I put a feature request in over on gitlab. Letā€™s see what the powers think.

FYI - Once upon a time, the SVG specification referred to Path Subtraction as, ā€˜Intrinsicā€™ and ā€˜windingā€™ but that is too general/confusing so, they clarified/renamed it to ā€˜Fill-Ruleā€™

Below are screenshot of my simple Example of doing it and of older spec example

Good luck!

<?xml version="1.0" standalone="no"?>
<!-- Hand Coded -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
width="500" height="400">
<!-- Rectangle with cutout. Rectangle points go CW, Cutout goes CCW. That makes it -->
<!-- NOTE: The cutout uses a MoveTo for closing it, instead of "Z" close path-->
<!-- that ensures App's like Fritzing recognizes it, or it will be left 'Open' -->
<path d="M0,0 L500,0 L500,400 L0,400 L0,0 Z
M300,100 L300,300 L400,300 L400,100 L300,100" fill="green" stroke-width="3" />
</svg>

Result:

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