You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found and fixed this issue when trying to render a board that is partly drawn using negative coordinates.
I'm relatively new to KiCAD, and couldn't figure out how to move the coordinate origin to the center of the workspace. I needed to draw a symmetrical board and didn't want to complicate the math, so my hack was to draw my board relative to the document origin in the top left. The resulting board uses negative coordinates for half of its geometry. Running PcbNew (version 0.6.0, from the Arch repo) on this board produces the following error trace:
Traceback (most recent call last):
File "/usr/bin/pcbdraw", line 33, in <module>
sys.exit(load_entry_point('PcbDraw==0.6.0', 'console_scripts', 'pcbdraw')())
File "/usr/lib/python3.8/site-packages/pcbdraw/pcbdraw.py", line 792, in main
board_cont.append(get_board_substrate(board, style, not args.no_drillholes, args.back))
File "/usr/lib/python3.8/site-packages/pcbdraw/pcbdraw.py", line 444, in get_board_substrate
process(container, f, os.path.join(tmp, svg_file), colors, boardsize)
File "/usr/lib/python3.8/site-packages/pcbdraw/pcbdraw.py", line 328, in process_board_substrate_base
clipPath.append(get_board_polygon(extract_svg_content(read_svg_unique(source))))
File "/usr/lib/python3.8/site-packages/pcbdraw/pcbdraw.py", line 276, in get_board_polygon
elements.append(SvgPathItem(svg_element.attrib["d"]))
File "/usr/lib/python3.8/site-packages/pcbdraw/pcbdraw.py", line 50, in __init__
raise SyntaxError("Only paths with absolute position are supported")
SyntaxError: Only paths with absolute position are supported
I traced this down to the regexp in class SvgPathItem that tries to split the given SVG path. It doesn't handle the following input correctly:
Thanks. The reason why I didn't make this a PR is because I hit this issue during my first time using this software, and didn't want to give the impression that I fully understood the effects of this change inside an unfamiliar codebase. I'll push a PR next time.
Found and fixed this issue when trying to render a board that is partly drawn using negative coordinates.
I'm relatively new to KiCAD, and couldn't figure out how to move the coordinate origin to the center of the workspace. I needed to draw a symmetrical board and didn't want to complicate the math, so my hack was to draw my board relative to the document origin in the top left. The resulting board uses negative coordinates for half of its geometry. Running PcbNew (version 0.6.0, from the Arch repo) on this board produces the following error trace:
I traced this down to the regexp in
class SvgPathItem
that tries to split the given SVG path. It doesn't handle the following input correctly:The fix is trivial:
Now it works.
The text was updated successfully, but these errors were encountered: