adding button & icon

This commit is contained in:
easyw
2019-11-02 11:18:13 +01:00
parent a56313f509
commit f3d0485ff7
3 changed files with 222 additions and 3 deletions

View File

@ -2,14 +2,17 @@ from math import *
import pcbnew
from .CircularZoneDlg import CircularZoneDlg
import wx
import os
class CircularZone(pcbnew.ActionPlugin):
def defaults(self):
self.name = "Create a circular zone"
self.category = "Undefined"
self.description = ""
self.name = "Circular Zone\nKeepout Zone Generator"
self.category = "Modify PCB"
self.description = "Create a Circular Zone\nor a Circular Keepout Zone"
self.icon_file_name = os.path.join(os.path.dirname(__file__), "./round_keepout_area.png")
self.show_toolbar_button = True
def build(self, center_x, center_y, radius, keepout, edge_count):
sp = pcbnew.SHAPE_POLY_SET()

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="27.625002"
width="28.281784"
version="1.1"
id="svg2"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="round_keepout_area.svg">
<metadata
id="metadata40">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1009"
id="namedview38"
showgrid="true"
inkscape:snap-to-guides="false"
inkscape:snap-grids="true"
inkscape:zoom="16"
inkscape:cx="9.4198507"
inkscape:cy="22.223419"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0">
<inkscape:grid
type="xygrid"
id="grid3017"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5"
spacingy="0.5"
originx="0.81250108"
originy="0.81250108" />
</sodipodi:namedview>
<defs
id="defs4" />
<path
id="path43"
sodipodi:type="arc"
sodipodi:cx="14.312501"
sodipodi:cy="13.812501"
sodipodi:rx="12.461538"
sodipodi:ry="12.461538"
sodipodi:start="0"
sodipodi:end="6.2826034"
d="M 26.774039,13.812501 A 12.461538,12.461538 0 0 1 14.314314,26.274039 12.461538,12.461538 0 0 1 1.8509632,13.816127 12.461538,12.461538 0 0 1 14.307062,1.3509638 12.461538,12.461538 0 0 1 26.774037,13.805249"
sodipodi:open="true"
style="fill:none;stroke:#008000;stroke-width:2.07692313" />
<g
transform="matrix(1.6382539,0,0,1.5572263,2.5697218,1.1756426)"
id="g16">
<rect
height="16"
width="16"
y="0"
x="0"
id="rect18"
style="fill-opacity:0" />
</g>
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 8.8125011,4.3125011 2.9999999,-3"
id="path3886"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path3888"
d="m 11.812501,4.3125011 3,-3"
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 14.812501,4.3125011 3,-3"
id="path3890"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path3906"
d="m 10.812501,26.312501 3,-3"
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 13.812501,26.312501 3,-3"
id="path3908"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path3910"
d="m 16.812501,26.312501 3,-3"
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 23.812501,13.312501 3,-3"
id="path3922"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path3924"
d="m 23.812501,16.312501 3,-3"
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 23.812501,19.312501 3,-3"
id="path3926"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 1.8125011,11.312501 3,-2.9999999"
id="path3932"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path3934"
d="m 1.8125011,14.312501 3,-3"
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 1.8125011,17.312501 3,-3"
id="path3936"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path3938"
d="m 2.8125011,19.312501 2,-2"
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 3.8125011,21.312501 1.5,-1.5"
id="path3940"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
id="path3783"
style="opacity:0.75;fill:none;stroke:#d10b0b;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 19.1875,8.9375007 9.437501,18.6875 M 20.8125,13.812501 c 0,3.58985 -2.910149,6.499999 -6.499999,6.499999 -3.589851,0 -6.5,-2.910149 -6.5,-6.499999 0,-3.589851 2.910149,-6.5000001 6.5,-6.5000001 3.58985,0 6.499999,2.9101491 6.499999,6.5000001 z"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 5.8125011,23.312501 1.5,-1.5"
id="path3940-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
inkscape:connector-curvature="0"
id="path3938-7"
d="m 8.3125011,25.312501 1.9999999,-2"
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 17.812501,4.3125011 1.5,-1.5"
id="path3940-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 23.812501,9.8125011 1.5,-1.5"
id="path3940-5-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 20.812501,5.3125011 1.5,-1.5"
id="path3940-5-3-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 22.812501,7.3125011 1.5,-1.5"
id="path3940-5-3-5-6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 6.8125011,6.3125008 -1.5,-1.5"
id="path3940-5-3-5-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#008000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 23.312501,22.812501 -1.5,-1.5"
id="path3940-5-3-5-2-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</svg>

After

Width:  |  Height:  |  Size: 8.2 KiB