@@ -91,17 +91,29 @@ def From_PCB(self, pcb):
9191 self .layers = Layers ()
9292 self .layers .From_PCB (item )
9393
94+ elif item [0 ] == 'footprint' :
95+ # This is the new name of modules
96+ # KiCad 6 supports "module" as a legacy option
97+ # So that's what we will use.
98+ module = Module ()
99+ module .From_PCB (item )
100+ self .module .append (module )
101+
94102 elif item [0 ] == 'module' :
95103 module = Module ()
96104 module .From_PCB (item )
97- # print(module.fp_text[0].text)
98105 self .module .append (module )
99106
100107 elif item [0 ] == 'segment' :
101108 segment = Segment ()
102109 segment .From_PCB (item )
103110 self .segment .append (segment )
104111
112+ elif item [0 ] == 'arc' :
113+ arc = Arc ()
114+ arc .From_PCB (item )
115+ self .arc .append (arc )
116+
105117 elif item [0 ] == 'gr_arc' :
106118 arc = Arc ()
107119 arc .From_PCB (item )
@@ -160,6 +172,9 @@ def To_PCB(self):
160172 for item in self .segment :
161173 pcb .append (item .To_PCB ())
162174
175+ for item in self .arc :
176+ pcb .append (item .To_PCB ())
177+
163178 for item in self .gr_arc :
164179 pcb .append (item .To_PCB ())
165180
@@ -214,6 +229,11 @@ def To_SVG(self):
214229 tag = BeautifulSoup (item .To_SVG (), 'html.parser' )
215230 layer = item .layer
216231 base .svg .find ('g' , {'inkscape:label' : layer }, recursive = False ).append (tag )
232+
233+ for item in self .arc :
234+ tag = BeautifulSoup (item .To_SVG (), 'html.parser' )
235+ layer = item .layer
236+ base .svg .find ('g' , {'inkscape:label' : layer }, recursive = False ).append (tag )
217237
218238 for item in self .module :
219239 tag = item .To_SVG (hiddenLayers = hiddenLayers )
@@ -309,6 +329,14 @@ def From_SVG(self, svg):
309329 segment = Segment ()
310330 segment .From_SVG (tag , path )
311331 self .segment .append (segment )
332+
333+ elif tag ['type' ] == "arc" :
334+ paths = parse_path (tag ['d' ])
335+
336+ for path in paths :
337+ arc = Arc ()
338+ arc .From_SVG (tag , path )
339+ self .arc .append (arc )
312340
313341 elif tag ['type' ] == "gr_line" :
314342 paths = parse_path (tag ['d' ])
0 commit comments