Import DXF as filled copper zone

I would like to create a filled zone on a copper layer in a complex, irregular shape. I’ve drawn my shape in Inkscape and I can export it as a DXF. Is there a way to import a DXF as a zone? Or is this a case where I’m going to need to modify the .kicad_pcb file directly in order to do what I want?

Thanks!

You can do this but it’s not simple. I can make a video later this week since this 10 min explanation may not be good enough.

The first thing you need to do is convert your shape into a footprint using the bitmap tool.

Then you open up your layout and put in a dummy fill zone with the net you want. The one below is a triangle with no net assigned. Open your kicad_pcb file in a text editor and look for (zone (net 0) (net_name “”) . You will want to replace the bold xy points. Next import the footprint you made from the bitmap tool. You will see (module then your footprint library and name. You want to take the bold xy point from that and replace both polygon and filled_polygon in the zone section. Delete your footprint you used to copy the xy positions from. Once you save that reopen the file and the zone shape should now be the same as your bitmap footprint.

(zone (net 0) (net_name “”) (layer F.Cu) (tstamp 0) (hatch edge 0.508)
(connect_pads (clearance 0.508))
(min_thickness 0.254)
(fill yes (arc_segments 16) (thermal_gap 0.508) (thermal_bridge_width 0.508))
(polygon
(pts
(xy 88.519 46.355) (xy 132.207 47.371) (xy 94.869 64.262)
)
)
(filled_polygon
(pts
(xy 131.646855 47.485008) (xy 94.942525 64.089348) (xy 88.700292 46.486251)
)
)
)


(module .pretty:Your Shape (layer F.Cu) (tedit 57150158) (tstamp 5A63071D)
(at 35.052 18.923)
(fp_text reference G*** (at 0 0) (layer F.SilkS) hide
(effects (font (thickness 0.3)))
)
(fp_text value LOGO (at 0.75 0) (layer F.SilkS) hide
(effects (font (thickness 0.3)))
)
(fp_poly (pts (xy 10.16 -4.515556) (xy -10.16 -4.515556) (xy -10.16 -6.773333) (xy 10.16 -6.773333) (xy 10.16 -4.515556)) (layer F.SilkS) (width 0.01))


(zone (net 0) (net_name “”) (layer F.Cu) (tstamp 0) (hatch edge 0.508)
(connect_pads (clearance 0.508))
(min_thickness 0.254)
(fill yes (arc_segments 16) (thermal_gap 0.508) (thermal_bridge_width 0.508))
(polygon
(pts
(xy 10.16 -4.515556) (xy -10.16 -4.515556) (xy -10.16 -6.773333) (xy 10.16 -6.773333) (xy 10.16 -4.515556)
)
)
(filled_polygon
(pts
(xy 10.16 -4.515556) (xy -10.16 -4.515556) (xy -10.16 -6.773333) (xy 10.16 -6.773333) (xy 10.16 -4.515556)
)
)
)

3 Likes

Thanks! It’s actually even easier than that, because you can just paste the points once, into the polygon section, and then use “Re-fill all zones” in KiCad to fix the filled_polygon section.

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