Commits

saar drimer committed 70b4057

enhanced meander capabilities

Comments (0)

Files changed (1)

     for layer in utils.get_surface_layers(cfg):
         routing[layer] = {}
         for i, path in enumerate(svg_in.xpath(xpath_expr % layer, namespaces={'inkscape':cfg['namespace']['inkscape'], 'svg':cfg['namespace']['svg']})):
+
+            generated_path = None
+
             routing[layer][str(i)] = {}
             rd = svg.absolute_to_relative_path(path.get('d'))
             gerber_lp = path.get('gerber_lp')
                 routing[layer][str(i)]['style'] = path_style
 
             if pcbmode_params is not None:
-                pt = re.match('^\s*([^:]*)', pcbmode_params)
-                if pt.group(0).lower() == 'meander':
-                    # creates a meander SVG path
-                    meander_params = utils.process_meander_type(pcbmode_params)
-                    generated_path = svg.create_meandering_path(meander_params)
+                trace_type = re.match('type\s*:\s*([^;]*)', pcbmode_params)
+                trace_type = trace_type.group(1).lower()
+                meander_params = utils.process_meander_type(pcbmode_params, trace_type)
+                generated_path = svg.create_meandering_path(meander_params)
                 routing[layer][str(i)]['pcbmode'] = pcbmode_params
 
 
                             generated_paths[inkparam.lstrip('#')] = generated_path
 
 
-            generated_path = None
+
 
     # add path-effects to routing file
     path_effects = svg_in.xpath("//inkscape:path-effect", namespaces={'inkscape':cfg['namespace']['inkscape']})