Merge pull request #3624 from Russ4262/SlotCutter

[Path] Add new `Slot` operation to PathWB 2D tool group
This commit is contained in:
sliptonic
2020-06-19 11:12:01 -05:00
committed by GitHub
10 changed files with 2744 additions and 8 deletions

View File

@@ -104,6 +104,8 @@ SET(PathScripts_SRCS
PathScripts/PathSetupSheetOpPrototypeGui.py
PathScripts/PathSimpleCopy.py
PathScripts/PathSimulatorGui.py
PathScripts/PathSlot.py
PathScripts/PathSlotGui.py
PathScripts/PathStock.py
PathScripts/PathStop.py
PathScripts/PathSurface.py

View File

@@ -57,6 +57,7 @@
<file>icons/Path-Shape.svg</file>
<file>icons/Path-SimpleCopy.svg</file>
<file>icons/Path-Simulator.svg</file>
<file>icons/Path-Slot.svg</file>
<file>icons/Path-Speed.svg</file>
<file>icons/Path-Stock.svg</file>
<file>icons/Path-Stop.svg</file>
@@ -107,6 +108,7 @@
<file>panels/PageOpPocketFullEdit.ui</file>
<file>panels/PageOpProbeEdit.ui</file>
<file>panels/PageOpProfileFullEdit.ui</file>
<file>panels/PageOpSlotEdit.ui</file>
<file>panels/PageOpSurfaceEdit.ui</file>
<file>panels/PageOpWaterlineEdit.ui</file>
<file>panels/PathEdit.ui</file>

View File

@@ -0,0 +1,754 @@
<?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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="Path-Slot.svg"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
version="1.1"
id="svg2816"
height="64px"
width="64px">
<defs
id="defs2818">
<linearGradient
id="linearGradient1830">
<stop
id="stop1826"
offset="0"
style="stop-color:#729fcf;stop-opacity:1" />
<stop
id="stop1828"
offset="1"
style="stop-color:#204a87;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient1816">
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="0"
id="stop1812" />
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="1"
id="stop1814" />
</linearGradient>
<linearGradient
id="linearGradient1802">
<stop
id="stop1798"
offset="0"
style="stop-color:#729fcf;stop-opacity:1" />
<stop
id="stop1800"
offset="1"
style="stop-color:#204a87;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient1796">
<stop
id="stop1792"
offset="0"
style="stop-color:#729fcf;stop-opacity:1" />
<stop
id="stop1794"
offset="1"
style="stop-color:#204a87;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient1105">
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="0"
id="stop1101" />
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="1"
id="stop1103" />
</linearGradient>
<linearGradient
id="linearGradient4513">
<stop
id="stop4515"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop4517"
offset="1"
style="stop-color:#999999;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3681">
<stop
style="stop-color:#fff110;stop-opacity:1;"
offset="0"
id="stop3697" />
<stop
id="stop3685"
offset="1"
style="stop-color:#cf7008;stop-opacity:1;" />
</linearGradient>
<inkscape:perspective
id="perspective2824"
inkscape:persp3d-origin="32 : 21.333333 : 1"
inkscape:vp_z="64 : 32 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 32 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3622" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3622-9" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3653" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3675" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3697" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3720" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3742" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3764" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3785" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3806" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3806-3" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3835" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3614" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3614-8" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3643" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3643-3" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3672" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3672-5" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3701" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3701-8" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3746" />
<pattern
inkscape:collect="always"
xlink:href="#Strips1_1-4"
id="pattern5231"
patternTransform="matrix(0.67643728,-0.81829155,2.4578314,1.8844554,-26.450606,18.294947)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective5224" />
<pattern
inkscape:collect="always"
patternUnits="userSpaceOnUse"
width="2"
height="1"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
id="Strips1_1-4"
inkscape:stockid="Stripes 1:1">
<rect
style="fill:black;stroke:none"
x="0"
y="-0.5"
width="1"
height="2"
id="rect4483-4" />
</pattern>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective5224-9" />
<pattern
inkscape:collect="always"
xlink:href="#Strips1_1-6"
id="pattern5231-4"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,39.618381,8.9692804)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective5224-3" />
<pattern
inkscape:collect="always"
patternUnits="userSpaceOnUse"
width="2"
height="1"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
id="Strips1_1-6"
inkscape:stockid="Stripes 1:1">
<rect
style="fill:black;stroke:none"
x="0"
y="-0.5"
width="1"
height="2"
id="rect4483-0" />
</pattern>
<pattern
inkscape:collect="always"
xlink:href="#pattern5231-3"
id="pattern5296"
patternTransform="matrix(0.66513382,-1.0631299,2.4167603,2.4482973,-49.762569,2.9546807)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective5288" />
<pattern
inkscape:collect="always"
xlink:href="#Strips1_1-4-3"
id="pattern5231-3"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,-26.336284,10.887197)" />
<pattern
inkscape:collect="always"
patternUnits="userSpaceOnUse"
width="2"
height="1"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
id="Strips1_1-4-3"
inkscape:stockid="Stripes 1:1">
<rect
style="fill:black;stroke:none"
x="0"
y="-0.5"
width="1"
height="2"
id="rect4483-4-6" />
</pattern>
<pattern
inkscape:collect="always"
xlink:href="#Strips1_1-9"
id="pattern5330"
patternTransform="matrix(0.42844886,-0.62155849,1.5567667,1.431396,27.948414,13.306456)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective5323" />
<pattern
inkscape:collect="always"
patternUnits="userSpaceOnUse"
width="2"
height="1"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
id="Strips1_1-9"
inkscape:stockid="Stripes 1:1">
<rect
style="fill:black;stroke:none"
x="0"
y="-0.5"
width="1"
height="2"
id="rect4483-3" />
</pattern>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective5361" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective5383" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective5411" />
<linearGradient
gradientTransform="translate(127.27273,-51.272729)"
gradientUnits="userSpaceOnUse"
y2="40.168594"
x2="4.0605712"
y1="41.087898"
x1="37.89756"
id="linearGradient3687"
xlink:href="#linearGradient3681"
inkscape:collect="always" />
<linearGradient
gradientTransform="translate(127.27273,-51.272729)"
gradientUnits="userSpaceOnUse"
y2="43.558987"
x2="59.811455"
y1="40.484772"
x1="37.894287"
id="linearGradient3695"
xlink:href="#linearGradient3681"
inkscape:collect="always" />
<linearGradient
id="linearGradient3681-3">
<stop
style="stop-color:#fff110;stop-opacity:1;"
offset="0"
id="stop3697-3" />
<stop
id="stop3685-4"
offset="1"
style="stop-color:#cf7008;stop-opacity:1;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3681-3"
id="linearGradient3608"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-37.00068,-20.487365)"
x1="37.894287"
y1="40.484772"
x2="59.811455"
y2="43.558987" />
<linearGradient
id="linearGradient4513-2">
<stop
id="stop4515-2"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop4517-4"
offset="1"
style="stop-color:#999999;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4513-2"
id="radialGradient4538"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,1.1841158,-8.5173246,-3.4097568)"
cx="32.151962"
cy="7.9319997"
fx="32.151962"
fy="7.9319997"
r="23.634638" />
<linearGradient
id="linearGradient4513-1">
<stop
id="stop4515-8"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop4517-6"
offset="1"
style="stop-color:#999999;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4513-1"
id="radialGradient4538-6"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,1.1841158,-8.5173246,-3.4097568)"
cx="32.151962"
cy="7.9319997"
fx="32.151962"
fy="7.9319997"
r="23.634638" />
<linearGradient
id="linearGradient4513-1-3">
<stop
id="stop4515-8-7"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop4517-6-5"
offset="1"
style="stop-color:#999999;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4513-1-3"
id="radialGradient3069"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.39497909,0,0,1.1841158,-2.716491,-26.067007)"
cx="32.151962"
cy="35.869175"
fx="32.151962"
fy="35.869175"
r="23.634638" />
<linearGradient
id="linearGradient4513-1-2">
<stop
id="stop4515-8-6"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop4517-6-6"
offset="1"
style="stop-color:#999999;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4513-1-2"
id="radialGradient3102"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.39497909,0,0,1.1841158,-2.716491,-26.067007)"
cx="32.151962"
cy="35.869175"
fx="32.151962"
fy="35.869175"
r="23.634638" />
<linearGradient
y2="54.227272"
x2="36"
y1="7.9999995"
x1="30.000002"
gradientTransform="translate(71.494719,-3.1982556)"
gradientUnits="userSpaceOnUse"
id="linearGradient4055"
xlink:href="#linearGradient4031"
inkscape:collect="always" />
<linearGradient
id="linearGradient4031">
<stop
style="stop-color:#d3d7cf;stop-opacity:1"
offset="0"
id="stop4033" />
<stop
style="stop-color:#888a85;stop-opacity:1"
offset="1"
id="stop4035" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1802"
id="linearGradient1782"
gradientUnits="userSpaceOnUse"
x1="-11.999959"
y1="49.999989"
x2="22"
y2="49.999989" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1796"
id="linearGradient1790"
x1="0"
y1="32"
x2="54.999825"
y2="32.499985"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1816"
id="linearGradient1810"
x1="43"
y1="15"
x2="44"
y2="63"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1830"
id="linearGradient1824"
x1="24"
y1="-4"
x2="26"
y2="42"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
inkscape:document-rotation="0"
inkscape:window-maximized="1"
inkscape:window-y="-8"
inkscape:window-x="54"
inkscape:window-height="745"
inkscape:window-width="1304"
inkscape:object-nodes="true"
inkscape:object-paths="true"
inkscape:snap-bbox-midpoints="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:bbox-nodes="true"
inkscape:bbox-paths="true"
inkscape:snap-bbox="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
showgrid="true"
inkscape:current-layer="layer1"
inkscape:cy="32.924615"
inkscape:cx="49.939903"
inkscape:zoom="5.6568543"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base">
<inkscape:grid
snapvisiblegridlinesonly="true"
enabled="true"
visible="true"
empspacing="2"
id="grid3206"
type="xygrid" />
</sodipodi:namedview>
<metadata
id="metadata2821">
<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>
<dc:title>Path-Drilling</dc:title>
<dc:date>2015-07-04</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/Path/Gui/Resources/icons/Path-Drilling.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
inkscape:label="Layer 1"
id="layer1">
<path
style="fill:url(#linearGradient1810);fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 21,63 62,45 V 16 l -8,3.5 V 41 l -19,8 v -6 l -14,6 z"
id="path1065"
sodipodi:nodetypes="ccccccccc" />
<path
style="fill:url(#linearGradient1782);fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 21,63 2,54 V 40 l 19,9 z"
id="path1067"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#729fcf;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 54,20 16,2 h 17 l 29,14 z"
id="path1071"
sodipodi:nodetypes="ccccc" />
<path
style="fill:url(#linearGradient1824);fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 54,41 2,18 V 2 h 14 l 38,18 z"
id="path1073"
sodipodi:nodetypes="cccccc" />
<path
style="fill:url(#linearGradient1790);fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 34,44 2,28 V 16 l 52,25 -20,8 z"
id="path1075"
sodipodi:nodetypes="cccccc" />
<path
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 23,50 v 9.9 L 60,44 V 19.2 l -4,2 0,20.8 -24,10 v -5.6 z"
id="path1954"
sodipodi:nodetypes="ccccccccc" />
<path
sodipodi:nodetypes="cccccc"
id="path951"
d="M 4,14.7 4,4 H 15.6 L 52,21.2 52,38 Z"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccccc"
id="path953"
d="M 35.5,46.8 V 43 L 3.5,27 v -8.7 l 46.8,22.6 z"
style="fill:none;stroke:#729fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:#73d216;stroke:#73d216;stroke-width:2.40001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 4.2000048,21.199992 48.4,42.8 43.4,44.9 4.2000048,25.2 Z"
id="path1832"
sodipodi:nodetypes="ccccc" />
<g
transform="matrix(1.3102844,0,0,1.0580737,-92.493731,-16.026037)"
id="g3908-1-4">
<g
id="g3135">
<g
id="g1950"
transform="translate(45.11237,6.084045)">
<path
sodipodi:nodetypes="ccccc"
id="path1908"
d="m 47.276881,18.999999 h 12.112717 l -8.88266,28 h -3.230057 z"
style="fill:#d3d7cf;stroke:#2e3436;stroke-width:1.79724;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccc"
id="path1910"
d="m 59.389597,18.999999 -8.882659,28 h 8.88266 z"
style="fill:#d3d7cf;stroke:#2e3436;stroke-width:1.79724;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:#888a85;stroke:#d3d7cf;stroke-width:1.79724;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 49.053412,20.898619 v 23.10138 h 0.484509 l 7.429133,-23.2 z"
id="path3906-7-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="path3906-7-4-1"
d="m 52.929482,45.199999 h 4.683584 l -0.08075,-14.4 z"
style="fill:#555753;stroke:#d3d7cf;stroke-width:1.79724;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccc"
id="path1927"
d="m 47.276881,18.999999 v -8 h 12.112716 l 10e-7,8 z"
style="fill:#888a85;stroke:#2e3436;stroke-width:1.79724;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="path3906-7-4-0"
d="m 49.00035,12.915954 v 4.168092 h 8.665778 v -4.168092 z"
style="fill:none;stroke:#d3d7cf;stroke-width:1.83191;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g>
</g>
<path
style="fill:#729fcf;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 34,44 2,28 v 12 l 19,9 z"
id="path1069"
sodipodi:nodetypes="ccccc" />
<path
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 4,43 v 9.7 L 19,60 v -9.8 z"
id="path1952"
sodipodi:nodetypes="ccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -0,0 +1,440 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>350</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="toolOptions">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="bottomMargin">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="toolController_label">
<property name="text">
<string>ToolController</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="toolController">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The tool and its settings to be used for this operation.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="coolantController"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="coolantController_label">
<property name="text">
<string>Coolant Mode</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="featureReferences">
<layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item row="0" column="1">
<widget class="QComboBox" name="geo1Reference">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose what point to use on the first selected feature.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Center of Mass</string>
</property>
</item>
<item>
<property name="text">
<string>Center of BoundBox</string>
</property>
</item>
<item>
<property name="text">
<string>Lowest Point</string>
</property>
</item>
<item>
<property name="text">
<string>Highest Point</string>
</property>
</item>
<item>
<property name="text">
<string>Long Edge</string>
</property>
</item>
<item>
<property name="text">
<string>Short Edge</string>
</property>
</item>
<item>
<property name="text">
<string>Vertex</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="geo1Reference_label">
<property name="text">
<string>Start Feature Reference</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="geo2Reference_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>End Feature Reference</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="geo2Reference">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose what point to use on the second selected feature.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Center of Mass</string>
</property>
</item>
<item>
<property name="text">
<string>Center of BoundBox</string>
</property>
</item>
<item>
<property name="text">
<string>Lowest Point</string>
</property>
</item>
<item>
<property name="text">
<string>Highest Point</string>
</property>
</item>
<item>
<property name="text">
<string>Vertex</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="customPoints">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="topMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QLabel" name="noBaseGeometry">
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No Base Geometry selected.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true">color:blue</string>
</property>
<property name="text">
<string>No Base Geometry selected.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="usingCustomPoints">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Currently using custom point inputs in the Property View of the Data tab.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Currently using custom point inputs available in the Property View of the Data tab.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="extendPath">
<layout class="QGridLayout" name="gridLayout_2">
<property name="topMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item row="3" column="0">
<widget class="QLabel" name="geo2Extensionlabel">
<property name="text">
<string>Extend Path End</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::InputField" name="geo2Extension">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Positive extends the end of the path, negative shortens.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::InputField" name="geo1Extension">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Positive extends the beginning of the path, negative shortens.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="geo1Extension_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Extend Path Start</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="pathOptions">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="topMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="layerMode_label">
<property name="text">
<string>Layer Mode</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="pathOrientation">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose the path orientation with regard to the feature(s) selected.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Start to End</string>
</property>
</item>
<item>
<property name="text">
<string>Perpendicular</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="pathOrientation_label">
<property name="text">
<string>Path Orientation</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="layerMode">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Complete the operation in a single pass at depth, or mulitiple passes to final depth.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Single-pass</string>
</property>
</item>
<item>
<property name="text">
<string>Multi-pass</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="reverseDirection">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable to reverse the cut direction of the slot path.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Reverse cut direction</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::InputField</class>
<extends>QLineEdit</extends>
<header>Gui/InputField.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>toolController</tabstop>
<tabstop>coolantController</tabstop>
<tabstop>geo1Reference</tabstop>
<tabstop>geo2Reference</tabstop>
<tabstop>geo1Extension</tabstop>
<tabstop>geo2Extension</tabstop>
<tabstop>layerMode</tabstop>
<tabstop>pathOrientation</tabstop>
<tabstop>reverseDirection</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@@ -88,14 +88,21 @@ class PathWorkbench (Workbench):
# build commands list
projcmdlist = ["Path_Job", "Path_Post"]
toolcmdlist = ["Path_Inspect", "Path_Simulator", "Path_ToolLibraryEdit", "Path_SelectLoop", "Path_OpActiveToggle"]
prepcmdlist = ["Path_Fixture", "Path_Comment", "Path_Stop", "Path_Custom", "Path_Probe"]
# twodopcmdlist = ["Path_Profile", "Path_Contour", "Path_Profile_Faces", "Path_Profile_Edges", "Path_Pocket_Shape", "Path_Drilling", "Path_MillFace", "Path_Helix", "Path_Adaptive"]
twodopcmdlist = ["Path_Profile", "Path_Pocket_Shape", "Path_Drilling", "Path_MillFace", "Path_Helix", "Path_Adaptive"]
toolcmdlist = ["Path_Inspect", "Path_Simulator",
"Path_ToolLibraryEdit", "Path_SelectLoop",
"Path_OpActiveToggle"]
prepcmdlist = ["Path_Fixture", "Path_Comment", "Path_Stop",
"Path_Custom", "Path_Probe"]
twodopcmdlist = ["Path_Profile", "Path_Pocket_Shape", "Path_Drilling",
"Path_MillFace", "Path_Helix", "Path_Adaptive",
"Path_Slot"]
threedopcmdlist = ["Path_Pocket_3D"]
engravecmdlist = ["Path_Engrave", "Path_Deburr"]
modcmdlist = ["Path_OperationCopy", "Path_Array", "Path_SimpleCopy"]
dressupcmdlist = ["Path_DressupAxisMap", "Path_DressupPathBoundary", "Path_DressupDogbone", "Path_DressupDragKnife", "Path_DressupLeadInOut", "Path_DressupRampEntry", "Path_DressupTag", "Path_DressupZCorrect"]
dressupcmdlist = ["Path_DressupAxisMap", "Path_DressupPathBoundary",
"Path_DressupDogbone", "Path_DressupDragKnife",
"Path_DressupLeadInOut", "Path_DressupRampEntry",
"Path_DressupTag", "Path_DressupZCorrect"]
extracmdlist = []
# modcmdmore = ["Path_Hop",]
# remotecmdlist = ["Path_Remote"]

View File

@@ -73,6 +73,7 @@ def Startup():
from PathScripts import PathSetupSheetGui
from PathScripts import PathSimpleCopy
from PathScripts import PathSimulatorGui
from PathScripts import PathSlotGui
from PathScripts import PathStop
# from PathScripts import PathSurfaceGui # Added in initGui.py due to OCL dependency
from PathScripts import PathToolController

View File

@@ -546,10 +546,8 @@ class TaskPanelBaseGeometryPage(TaskPanelPage):
for item in selected:
self.form.baseList.takeItem(self.form.baseList.row(item))
self.setDirty()
self.updatePanelVisibility('Operation', self.obj)
self.updateBase()
# self.obj.Proxy.execute(self.obj)
# FreeCAD.ActiveDocument.recompute()
self.updatePanelVisibility('Operation', self.obj)
def updateBase(self):
newlist = []

View File

@@ -233,6 +233,17 @@ class PROBEGate:
pass
class ALLGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
if sub and sub[0:6] == 'Vertex':
return True
if sub and sub[0:4] == 'Edge':
return True
if sub and sub[0:4] == 'Face':
return True
return False
def contourselect():
FreeCADGui.Selection.addSelectionGate(CONTOURGate())
FreeCAD.Console.PrintWarning("Contour Select Mode\n")
@@ -278,6 +289,10 @@ def adaptiveselect():
FreeCAD.Console.PrintWarning("Adaptive Select Mode\n")
def slotselect():
FreeCADGui.Selection.addSelectionGate(ALLGate())
FreeCAD.Console.PrintWarning("Slot Cutter Select Mode\n")
def surfaceselect():
gate = False
if(MESHGate() or FACEGate()):
@@ -309,6 +324,7 @@ def select(op):
opsel['Profile Edges'] = eselect # (depreciated)
opsel['Profile Faces'] = fselect # (depreciated)
opsel['Profile'] = profileselect
opsel['Slot'] = slotselect
opsel['Surface'] = surfaceselect
opsel['Waterline'] = surfaceselect
opsel['Adaptive'] = adaptiveselect

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,241 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2020 Russell Johnson (russ4262) <russ4262@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
# * as published by the Free Software Foundation; either version 2 of *
# * the License, or (at your option) any later version. *
# * for detail see the LICENCE text file. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU Library General Public License for more details. *
# * *
# * You should have received a copy of the GNU Library General Public *
# * License along with this program; if not, write to the Free Software *
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************
import FreeCAD
import FreeCADGui
import PathScripts.PathSlot as PathSlot
import PathScripts.PathGui as PathGui
import PathScripts.PathOpGui as PathOpGui
from PySide import QtCore
__title__ = "Path Slot Operation UI"
__author__ = "russ4262 (Russell Johnson)"
__url__ = "http://www.freecadweb.org"
__doc__ = "Slot operation page controller and command implementation."
__contributors__ = ""
class TaskPanelOpPage(PathOpGui.TaskPanelPage):
'''Page controller class for the Slot operation.'''
def initPage(self, obj):
# pylint: disable=attribute-defined-outside-init
self.CATS = [None, None]
self.setTitle("Slot - " + obj.Label)
# retrieve property enumerations
self.propEnums = PathSlot.ObjectSlot.opPropertyEnumerations(False)
# Requirements due to Gui::QuantitySpinBox class use in UI panel
self.geo1Extension = PathGui.QuantitySpinBox(self.form.geo1Extension, obj, 'ExtendPathStart')
self.geo2Extension = PathGui.QuantitySpinBox(self.form.geo2Extension, obj, 'ExtendPathEnd')
# self.updateVisibility()
def getForm(self):
'''getForm() ... returns UI'''
# FreeCAD.Console.PrintMessage('getForm()\n')
return FreeCADGui.PySideUic.loadUi(":/panels/PageOpSlotEdit.ui")
def updateQuantitySpinBoxes(self):
# FreeCAD.Console.PrintMessage('updateQuantitySpinBoxes()\n')
self.geo1Extension.updateSpinBox()
self.geo2Extension.updateSpinBox()
def getFields(self, obj):
'''getFields(obj) ... transfers values from UI to obj's proprties'''
# FreeCAD.Console.PrintMessage('getFields()\n')
self.updateToolController(obj, self.form.toolController)
self.updateCoolant(obj, self.form.coolantController)
obj.Reference1 = str(self.form.geo1Reference.currentText())
self.geo1Extension.updateProperty()
obj.Reference2 = str(self.form.geo2Reference.currentText())
self.geo2Extension.updateProperty()
val = self.propEnums['LayerMode'][self.form.layerMode.currentIndex()]
obj.LayerMode = val
val = self.propEnums['PathOrientation'][self.form.pathOrientation.currentIndex()]
obj.PathOrientation = val
if hasattr(self.form, 'reverseDirection'):
obj.ReverseDirection = self.form.reverseDirection.isChecked()
def setFields(self, obj):
'''setFields(obj) ... transfers obj's property values to UI'''
# FreeCAD.Console.PrintMessage('setFields()\n')
self.updateQuantitySpinBoxes()
self.setupToolController(obj, self.form.toolController)
self.setupCoolant(obj, self.form.coolantController)
idx = self.propEnums['Reference1'].index(obj.Reference1)
self.form.geo1Reference.setCurrentIndex(idx)
idx = self.propEnums['Reference2'].index(obj.Reference2)
self.form.geo2Reference.setCurrentIndex(idx)
self.selectInComboBox(obj.LayerMode, self.form.layerMode)
self.selectInComboBox(obj.PathOrientation, self.form.pathOrientation)
if obj.ReverseDirection:
self.form.reverseDirection.setCheckState(QtCore.Qt.Checked)
else:
self.form.reverseDirection.setCheckState(QtCore.Qt.Unchecked)
# FreeCAD.Console.PrintMessage('... calling updateVisibility()\n')
self.updateVisibility()
def getSignalsForUpdate(self, obj):
'''getSignalsForUpdate(obj) ... return list of signals for updating obj'''
# FreeCAD.Console.PrintMessage('getSignalsForUpdate()\n')
signals = []
signals.append(self.form.toolController.currentIndexChanged)
signals.append(self.form.coolantController.currentIndexChanged)
signals.append(self.form.geo1Extension.editingFinished)
signals.append(self.form.geo1Reference.currentIndexChanged)
signals.append(self.form.geo2Extension.editingFinished)
signals.append(self.form.geo2Reference.currentIndexChanged)
signals.append(self.form.layerMode.currentIndexChanged)
signals.append(self.form.pathOrientation.currentIndexChanged)
signals.append(self.form.reverseDirection.stateChanged)
return signals
def updateVisibility(self, sentObj=None):
'''updateVisibility(sentObj=None)... Updates visibility of Tasks panel objects.'''
# FreeCAD.Console.PrintMessage('updateVisibility()\n')
hideFeatures = True
if hasattr(self.obj, 'Base'):
if self.obj.Base:
self.form.customPoints.hide()
self.form.featureReferences.show()
self.form.pathOrientation_label.show()
self.form.pathOrientation.show()
hideFeatures = False
base, sublist = self.obj.Base[0]
subCnt = len(sublist)
if subCnt == 1:
# Save value, then reset choices
self.resetRef1Choices()
n1 = sublist[0]
s1 = getattr(base.Shape, n1)
# Show Reference1 and cusomize options within
self.form.geo1Reference.show()
self.form.geo1Reference_label.show()
self.form.geo1Reference_label.setText('Reference: {}'.format(n1))
self.customizeReference_1(n1, single=True)
# Hide Reference2
self.form.geo2Reference.hide()
self.form.geo2Reference_label.hide()
self.form.geo2Reference_label.setText('End Reference')
if self.CATS[1]:
self.CATS[1] = None
elif subCnt == 2:
self.resetRef1Choices()
self.resetRef2Choices()
n1 = sublist[0]
n2 = sublist[1]
s1 = getattr(base.Shape, n1)
s2 = getattr(base.Shape, n2)
# Show Reference1 and cusomize options within
self.form.geo1Reference.show()
self.form.geo1Reference_label.show()
self.form.geo1Reference_label.setText('Start Reference: {}'.format(n1))
self.customizeReference_1(n1)
# Show Reference2 and cusomize options within
self.form.geo2Reference.show()
self.form.geo2Reference_label.show()
self.form.geo2Reference_label.setText('End Reference: {}'.format(n2))
self.customizeReference_2(n2)
else:
self.form.pathOrientation_label.hide()
self.form.pathOrientation.hide()
if hideFeatures:
self.form.featureReferences.hide()
self.form.customPoints.show()
"""
'Reference1': ['Center of Mass', 'Center of BoundBox',
'Lowest Point', 'Highest Point', 'Long Edge',
'Short Edge', 'Vertex'],
'Reference2': ['Center of Mass', 'Center of BoundBox',
'Lowest Point', 'Highest Point', 'Vertex']
"""
def customizeReference_1(self, sub, single=False):
# Customize Reference1 combobox options
# by removing unavailable choices
cat = sub[:4]
if cat != self.CATS[0]:
self.CATS[0] = cat
cBox = self.form.geo1Reference
cBox.blockSignals(True)
for ri in PathSlot.removeIndexesFromReference_1(sub, single):
cBox.removeItem(ri)
cBox.blockSignals(False)
def customizeReference_2(self, sub):
# Customize Reference2 combobox options
# by removing unavailable choices
cat = sub[:4]
if cat != self.CATS[1]:
self.CATS[1] = cat
cBox = self.form.geo2Reference
cBox.blockSignals(True)
for ri in PathSlot.removeIndexesFromReference_2(sub):
cBox.removeItem(ri)
cBox.blockSignals(False)
cBox.setCurrentIndex(0)
def resetRef1Choices(self):
# Reset Reference1 choices
ref1 = self.form.geo1Reference
ref1.blockSignals(True)
ref1.clear() # Empty the combobox
ref1.addItems(self.propEnums['Reference1'])
ref1.blockSignals(False)
def resetRef2Choices(self):
# Reset Reference2 choices
ref2 = self.form.geo2Reference
ref2.blockSignals(True)
ref2.clear() # Empty the combobox
ref2.addItems(self.propEnums['Reference2'])
ref2.blockSignals(False)
def registerSignalHandlers(self, obj):
# FreeCAD.Console.PrintMessage('registerSignalHandlers()\n')
# self.form.pathOrientation.currentIndexChanged.connect(self.updateVisibility)
pass
Command = PathOpGui.SetupOperation('Slot',
PathSlot.Create,
TaskPanelOpPage,
'Path-Slot',
QtCore.QT_TRANSLATE_NOOP("Slot", "Slot"),
QtCore.QT_TRANSLATE_NOOP("Slot", "Create a Slot operation from selected geometry or custom points."),
PathSlot.SetupProperties)
FreeCAD.Console.PrintLog("Loading PathSlotGui... done\n")