Merge pull request #21108 from tarman3/pathshape2

CAM: PathShape with Tool Controller
This commit is contained in:
sliptonic
2025-05-19 09:12:58 -05:00
committed by GitHub
6 changed files with 964 additions and 1 deletions

View File

@@ -222,6 +222,7 @@ SET(PathPythonOpGui_SRCS
Path/Op/Gui/FeatureExtension.py
Path/Op/Gui/Helix.py
Path/Op/Gui/MillFace.py
Path/Op/Gui/PathShapeTC.py
Path/Op/Gui/Pocket.py
Path/Op/Gui/PocketBase.py
Path/Op/Gui/PocketShape.py

View File

@@ -47,6 +47,7 @@
<file>icons/CAM_SelectLoop.svg</file>
<file>icons/CAM_SetupSheet.svg</file>
<file>icons/CAM_Shape.svg</file>
<file>icons/CAM_ShapeTC.svg</file>
<file>icons/CAM_SimpleCopy.svg</file>
<file>icons/CAM_Simulator.svg</file>
<file>icons/CAM_SimulatorGL.svg</file>

View File

@@ -0,0 +1,721 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="64px"
height="64px"
id="svg2816"
version="1.1"
inkscape:version="1.4.1 (93de688d07, 2025-03-30)"
sodipodi:docname="CAM_ShapeTC.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs2818">
<linearGradient
inkscape:collect="always"
id="linearGradient3862">
<stop
style="stop-color:#73d216;stop-opacity:1"
offset="0"
id="stop3864" />
<stop
style="stop-color:#8ae234;stop-opacity:1"
offset="1"
id="stop3866" />
</linearGradient>
<linearGradient
id="linearGradient4513">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4515" />
<stop
style="stop-color:#999999;stop-opacity:1;"
offset="1"
id="stop4517" />
</linearGradient>
<linearGradient
id="linearGradient3681">
<stop
id="stop3697"
offset="0"
style="stop-color:#fff110;stop-opacity:1;" />
<stop
style="stop-color:#cf7008;stop-opacity:1;"
offset="1"
id="stop3685" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 32 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="64 : 32 : 1"
inkscape:persp3d-origin="32 : 21.333333 : 1"
id="perspective2824" />
<inkscape:perspective
id="perspective3622"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3622-9"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3653"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3675"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3697"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3720"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3742"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3764"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3785"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3806"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3806-3"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3835"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3614"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3614-8"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3643"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3643-3"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3672"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3672-5"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3701"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3701-8"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3746"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<pattern
patternTransform="matrix(0.67643728,-0.81829155,2.4578314,1.8844554,-26.450606,18.294947)"
id="pattern5231"
xlink:href="#Strips1_1-4"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5224"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<pattern
inkscape:stockid="Stripes 1:1"
id="Strips1_1-4"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
height="1"
width="2"
patternUnits="userSpaceOnUse"
inkscape:collect="always">
<rect
id="rect4483-4"
height="2"
width="1"
y="-0.5"
x="0"
style="fill:black;stroke:none" />
</pattern>
<inkscape:perspective
id="perspective5224-9"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<pattern
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,39.618381,8.9692804)"
id="pattern5231-4"
xlink:href="#Strips1_1-6"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5224-3"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<pattern
inkscape:stockid="Stripes 1:1"
id="Strips1_1-6"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
height="1"
width="2"
patternUnits="userSpaceOnUse"
inkscape:collect="always">
<rect
id="rect4483-0"
height="2"
width="1"
y="-0.5"
x="0"
style="fill:black;stroke:none" />
</pattern>
<pattern
patternTransform="matrix(0.66513382,-1.0631299,2.4167603,2.4482973,-49.762569,2.9546807)"
id="pattern5296"
xlink:href="#pattern5231-3"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5288"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<pattern
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,-26.336284,10.887197)"
id="pattern5231-3"
xlink:href="#Strips1_1-4-3"
inkscape:collect="always" />
<pattern
inkscape:stockid="Stripes 1:1"
id="Strips1_1-4-3"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
height="1"
width="2"
patternUnits="userSpaceOnUse"
inkscape:collect="always">
<rect
id="rect4483-4-6"
height="2"
width="1"
y="-0.5"
x="0"
style="fill:black;stroke:none" />
</pattern>
<pattern
patternTransform="matrix(0.42844886,-0.62155849,1.5567667,1.431396,27.948414,13.306456)"
id="pattern5330"
xlink:href="#Strips1_1-9"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5323"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<pattern
inkscape:stockid="Stripes 1:1"
id="Strips1_1-9"
patternTransform="matrix(0.66772843,-1.0037085,2.4261878,2.3114548,3.4760987,3.534923)"
height="1"
width="2"
patternUnits="userSpaceOnUse"
inkscape:collect="always">
<rect
id="rect4483-3"
height="2"
width="1"
y="-0.5"
x="0"
style="fill:black;stroke:none" />
</pattern>
<inkscape:perspective
id="perspective5361"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective5383"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective5411"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3681"
id="linearGradient3687"
x1="37.89756"
y1="41.087898"
x2="4.0605712"
y2="40.168594"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(127.27273,-51.272729)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3681"
id="linearGradient3695"
x1="37.894287"
y1="40.484772"
x2="59.811455"
y2="43.558987"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(127.27273,-51.272729)" />
<linearGradient
id="linearGradient3681-3">
<stop
id="stop3697-3"
offset="0"
style="stop-color:#fff110;stop-opacity:1;" />
<stop
style="stop-color:#cf7008;stop-opacity:1;"
offset="1"
id="stop3685-4" />
</linearGradient>
<linearGradient
y2="43.558987"
x2="59.811455"
y1="40.484772"
x1="37.894287"
gradientTransform="translate(-37.00068,-20.487365)"
gradientUnits="userSpaceOnUse"
id="linearGradient3608"
xlink:href="#linearGradient3681-3"
inkscape:collect="always" />
<linearGradient
id="linearGradient4513-2">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4515-2" />
<stop
style="stop-color:#999999;stop-opacity:1;"
offset="1"
id="stop4517-4" />
</linearGradient>
<radialGradient
r="23.634638"
fy="7.9319997"
fx="32.151962"
cy="7.9319997"
cx="32.151962"
gradientTransform="matrix(1,0,0,1.1841158,-8.5173246,-3.4097568)"
gradientUnits="userSpaceOnUse"
id="radialGradient4538"
xlink:href="#linearGradient4513-2"
inkscape:collect="always" />
<linearGradient
id="linearGradient4513-1">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4515-8" />
<stop
style="stop-color:#999999;stop-opacity:1;"
offset="1"
id="stop4517-6" />
</linearGradient>
<radialGradient
r="23.634638"
fy="7.9319997"
fx="32.151962"
cy="7.9319997"
cx="32.151962"
gradientTransform="matrix(1,0,0,1.1841158,-8.5173246,-3.4097568)"
gradientUnits="userSpaceOnUse"
id="radialGradient4538-6"
xlink:href="#linearGradient4513-1"
inkscape:collect="always" />
<linearGradient
id="linearGradient4513-1-3">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4515-8-7" />
<stop
style="stop-color:#999999;stop-opacity:1;"
offset="1"
id="stop4517-6-5" />
</linearGradient>
<radialGradient
r="23.634638"
fy="35.869175"
fx="32.151962"
cy="35.869175"
cx="32.151962"
gradientTransform="matrix(0.39497909,0,0,1.1841158,-2.716491,-26.067007)"
gradientUnits="userSpaceOnUse"
id="radialGradient3069"
xlink:href="#linearGradient4513-1-3"
inkscape:collect="always" />
<linearGradient
id="linearGradient4513-1-2">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4515-8-6" />
<stop
style="stop-color:#999999;stop-opacity:1;"
offset="1"
id="stop4517-6-6" />
</linearGradient>
<radialGradient
r="23.634638"
fy="35.869175"
fx="32.151962"
cy="35.869175"
cx="32.151962"
gradientTransform="matrix(0.39497909,0,0,1.1841158,-2.716491,-26.067007)"
gradientUnits="userSpaceOnUse"
id="radialGradient3102"
xlink:href="#linearGradient4513-1-2"
inkscape:collect="always" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4513-1"
id="radialGradient3132"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.39497909,0,0,1.1841158,38.088973,2.175957)"
cx="32.151962"
cy="27.950663"
fx="32.151962"
fy="27.950663"
r="23.634638" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3862"
id="radialGradient3870"
cx="19.429405"
cy="35.423492"
fx="19.429405"
fy="35.423492"
r="22.54497"
gradientTransform="matrix(0.53170375,0.63866798,-0.67374661,0.56090741,50.965176,3.932061)"
gradientUnits="userSpaceOnUse" />
<linearGradient
gradientTransform="translate(13.999998,-1)"
y2="54.227272"
x2="36"
y1="10"
x1="30.000002"
gradientUnits="userSpaceOnUse"
id="linearGradient4177"
xlink:href="#linearGradient4031"
inkscape:collect="always" />
<linearGradient
id="linearGradient4031">
<stop
id="stop4033"
offset="0"
style="stop-color:#d3d7cf;stop-opacity:1" />
<stop
id="stop4035"
offset="1"
style="stop-color:#888a85;stop-opacity:1" />
</linearGradient>
<linearGradient
y2="54.227272"
x2="36"
y1="10"
x1="30.000002"
gradientTransform="translate(20.004489,-1.0696912)"
gradientUnits="userSpaceOnUse"
id="linearGradient3158"
xlink:href="#linearGradient4031"
inkscape:collect="always" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3862-5"
id="radialGradient3870-7"
cx="19.429405"
cy="35.423492"
fx="19.429405"
fy="35.423492"
r="22.54497"
gradientTransform="matrix(0.53170375,0.63866798,-0.67374661,0.56090741,32.965176,3.932061)"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
id="linearGradient3862-5">
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="0"
id="stop3864-3" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3866-5" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3898-8-9">
<stop
style="stop-color:#888a85;stop-opacity:1"
offset="0"
id="stop3900-2-2" />
<stop
style="stop-color:#d3d7cf;stop-opacity:1"
offset="1"
id="stop3902-4-7" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3898-8-9"
id="linearGradient3143"
gradientUnits="userSpaceOnUse"
x1="35.05999"
y1="53.008698"
x2="27.286415"
y2="7.311924"
gradientTransform="matrix(0.97351465,0,0,1,20.847529,-1)" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.8890873"
inkscape:cx="10.670884"
inkscape:cy="28.412836"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:snap-bbox="false"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="false"
inkscape:object-nodes="true"
inkscape:window-width="1600"
inkscape:window-height="872"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="true"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid3824"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="0"
originy="0"
spacingy="1"
spacingx="1"
units="px" />
</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>CAM_Shape</dc:title>
<dc:date>2015-07-04</dc:date>
<dc:relation>https://www.freecad.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/CAM/Gui/Resources/icons/CAM_Shape.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
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
style="fill:none;stroke:#0b1521;stroke-width:8;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 40,56 C 40,56 28,56 18,56 8.452813,56 3.545454,46.454546 10,40 15.396463,35.098502 34.02682,33.659424 26.10517,21.16761 18.183521,8.675797 16,6 16,6"
id="path3923-6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csczc" />
<path
style="fill:none;stroke:#3465a4;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 40,56 c 0,0 -12,4e-6 -22,4e-6 C 8.452813,56 3.545454,46.454546 10,40 15.396463,35.098502 34.026819,33.659424 26.10517,21.16761 18.183521,8.675797 16,6 16,6"
id="path3923-3-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csczc" />
<path
style="fill:none;stroke:url(#radialGradient3870-7);stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 40,55 C 40,55 27.921502,55.05203 17.921653,54.9971 9.647193,54.951639 4.781193,46.798299 10.64483,40.775572 16.041293,35.874074 35.262558,34.434996 26.75,20.397727 18.237442,6.360458 16.64483,5.230117 16.64483,5.230117"
id="path3923-3-6-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csczc" />
<path
style="fill:none;stroke:#172a04;stroke-width:8;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 50,56 c 0,0 -4,0 -14,0 C 26.452813,56 21.545454,46.454546 28,40 33.396463,35.098502 52.02682,33.659424 44.10517,21.16761 36.183521,8.6757967 34,6 34,6"
id="path3923"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csczc" />
<path
style="fill:none;stroke:#73d216;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 50,56 c 0,0 -4,4e-6 -14,4e-6 C 26.452813,56 21.545454,46.454546 28,40 33.396463,35.098502 52.026819,33.659424 44.10517,21.16761 36.183521,8.675797 34,6 34,6"
id="path3923-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csczc" />
<path
style="fill:none;stroke:url(#radialGradient3870);stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 50,55 C 50,55 45.921502,55.05203 35.921653,54.9971 27.647193,54.951639 22.781193,46.798299 28.64483,40.775572 34.041293,35.874074 53.262558,34.434996 44.75,20.397727 36.237442,6.3604584 34.64483,5.2301173 34.64483,5.2301173"
id="path3923-3-6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csczc" />
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:url(#linearGradient3143);fill-opacity:1;fill-rule:nonzero;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
d="m 43,27 v 9 l 18,-8 v -9 z m 18,3 -18,8 v 9 l 18,-8 z m 0,11 -18,8 8.999998,6 L 61,49 Z"
id="rect4417-1-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccc" />
<path
style="fill:#ff0000;fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
d="M 43,25 V 5 h 18 v 12 z"
id="path3085-5-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
sodipodi:nodetypes="ccccccccccccccc"
inkscape:connector-curvature="0"
id="rect4417-1-4-2-3"
d="m 45.016684,28.299103 0.02764,4.492034 13.94112,-6.092914 0.02262,-4.645526 z m 13.981176,4.789285 -13.993538,6.229006 0.01473,4.5902 14.008758,-6.224988 z m -0.01897,10.999765 -11.836348,5.23507 4.842291,3.277297 6.984636,-4.659288 z"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#d3d7cf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<path
style="fill:none;stroke:#ff9955;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 45,7 45.01734,21.948166 58.99852,15.762958 59.00002,7 Z"
id="path3906-7-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -164,7 +164,7 @@ class CAMWorkbench(Workbench):
)
threedcmdgroup = threedopcmdlist
if Path.Preferences.experimentalFeaturesEnabled():
prepcmdlist.append("CAM_Shape")
prepcmdlist.append("CAM_PathShapeTC")
extracmdlist.extend(["CAM_Area", "CAM_Area_Workplane"])
specialcmdlist.append("CAM_ThreadMilling")
twodopcmdlist.append("CAM_Slot")

View File

@@ -67,6 +67,7 @@ def Startup():
from Path.Op.Gui import Engrave
from Path.Op.Gui import Helix
from Path.Op.Gui import MillFace
from Path.Op.Gui import PathShapeTC
from Path.Op.Gui import Pocket
from Path.Op.Gui import PocketShape
from Path.Op.Gui import Probe

View File

@@ -0,0 +1,239 @@
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022 FreeCAD Project Association *
# * *
# * This file is part of FreeCAD. *
# * *
# * FreeCAD is free software: you can redistribute it and/or modify it *
# * under the terms of the GNU Lesser General Public License as *
# * published by the Free Software Foundation, either version 2.1 of the *
# * License, or (at your option) any later version. *
# * *
# * FreeCAD 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 *
# * Lesser General Public License for more details. *
# * *
# * You should have received a copy of the GNU Lesser General Public *
# * License along with FreeCAD. If not, see *
# * <https://www.gnu.org/licenses/>. *
# * *
# ***************************************************************************
import Draft
import FreeCAD
import FreeCADGui
import Part
import Path
import Path.Op.Base as OpBase
import PathScripts.PathUtils as PathUtils
from PySide.QtCore import QT_TRANSLATE_NOOP
__title__ = "CAM Path from Shape with Tool Controller"
__author__ = ""
__inspirer__ = "Russ4262"
__url__ = "https://forum.freecad.org/viewtopic.php?t=93896"
__doc__ = ""
if False:
Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule())
Path.Log.trackModule(Path.Log.thisModule())
else:
Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule())
translate = FreeCAD.Qt.translate
# Add base set of operation properties
def _addBaseProperties(obj):
obj.addProperty(
"App::PropertyBool",
"Active",
"Path",
QT_TRANSLATE_NOOP("App::Property", "Make False, to prevent operation from generating code"),
locked=True,
)
obj.addProperty(
"App::PropertyString",
"Comment",
"Path",
QT_TRANSLATE_NOOP("App::Property", "An optional comment for this Operation"),
locked=True,
)
obj.addProperty(
"App::PropertyString",
"UserLabel",
"Path",
QT_TRANSLATE_NOOP("App::Property", "User Assigned Label"),
locked=True,
)
obj.addProperty(
"App::PropertyString",
"CycleTime",
"Path",
QT_TRANSLATE_NOOP("App::Property", "Operations Cycle Time Estimation"),
locked=True,
)
obj.setEditorMode("CycleTime", 1) # Set property read-only
obj.Active = True
# Add ToolController properties
def _addToolController(obj):
obj.addProperty(
"App::PropertyLink",
"ToolController",
"Path",
QT_TRANSLATE_NOOP(
"App::Property",
"The tool controller that will be used to calculate the path",
),
)
obj.addProperty(
"App::PropertyDistance",
"OpToolDiameter",
"Op Values",
QT_TRANSLATE_NOOP("App::Property", "Holds the diameter of the tool"),
)
obj.setEditorMode("OpToolDiameter", 1) # Set property read-only
obj.ToolController = PathUtils.findToolController(obj, None)
if not obj.ToolController:
raise OpBase.PathNoTCException()
obj.OpToolDiameter = obj.ToolController.Tool.Diameter
obj.FeedRate = obj.ToolController.HorizFeed.Value
obj.FeedRateVertical = obj.ToolController.VertFeed.Value
# Get list of tool controllers
def _getToolControllers(obj, proxy=None):
# Modified getToolControllers() from PathScripts.PathUtils
# for Path object without Proxy
job = PathUtils.findParentJob(obj)
if job:
return [tc for tc in job.Tools.Group]
else:
return []
# Set safety height parameters for Path operation
def _setSafetyZ(obj):
job = PathUtils.findParentJob(obj)
if job:
safetyZ = job.Stock.Shape.BoundBox.ZMax + 10
obj.RetractThreshold = safetyZ
obj.Retraction = safetyZ
obj.ResumeHeight = safetyZ
# Geometry for selected shapes
class ObjectPartShape:
def __init__(self, obj, base):
# Path.Log.info("ObjectPartShape.__init__()")
self.obj = obj
obj.addProperty(
"App::PropertyLinkSubListGlobal",
"Base",
"Path",
QT_TRANSLATE_NOOP("App::Property", "The base geometry for this operation"),
)
obj.Base = base
def __getstate__(self):
return None
def __setstate__(self, state):
return None
def onDelete(self, obj, args):
return True
def onDocumentRestored(self, obj):
self.obj = obj
def onChanged(self, obj, prop):
"""onChanged(obj, prop) ... method called when objECT is changed,
with source propERTY of the change."""
if "Restore" in obj.State:
pass
def execute(self, obj):
edges = []
if obj.Base:
(base, subNames) = obj.Base[0]
edges = [
base.Shape.getElement(sub).copy() for sub in subNames if sub.startswith("Edge")
]
if edges:
obj.Shape = Part.Wire(Part.__sortEdges__(edges))
else:
obj.Shape = Part.Shape()
class CommandPathShapeTC:
def GetResources(self):
return {
"Pixmap": "CAM_ShapeTC",
"MenuText": QT_TRANSLATE_NOOP("CAM_PathShapeTC", "Path from Shape TC"),
"ToolTip": QT_TRANSLATE_NOOP(
"CAM_PathShapeTC", "Creates path from selected shapes with tool controller"
),
}
def IsActive(self):
isJob = False
if FreeCAD.ActiveDocument is not None:
for o in FreeCAD.ActiveDocument.Objects:
if o.Name.startswith("Job"):
isJob = True
break
if isJob:
selection = FreeCADGui.Selection.getSelectionEx()
if selection:
base = selection[0].Object
subBase = selection[0].SubElementNames
if subBase and [edge for edge in subBase if "Edge" in edge]:
return True
elif base.Shape.ShapeType in ["Wire", "Edge"]:
return True
return False
def Activated(self):
print("Create PathShape object with Tool Controller")
doc = FreeCAD.ActiveDocument
selection = FreeCADGui.Selection.getSelectionEx()
shapeObj = None
if selection:
base = selection[0].Object
subBase = selection[0].SubElementNames
if subBase:
subEdges = [edge for edge in subBase if "Edge" in edge]
shapeObj = doc.addObject("Part::FeaturePython", "PartShape")
shapeObj.ViewObject.Proxy = 0
shapeObj.Visibility = False
shapeObj.Proxy = ObjectPartShape(shapeObj, [(base, subEdges)])
elif base.Shape.ShapeType in ["Wire", "Edge"]:
shapeObj = Draft.make_clone(base)
pathObj = doc.addObject("Path::FeatureShape", "PathShape")
pathObj.Sources = [shapeObj]
# Overwrite getToolControllers() function with modified version
PathUtils.getToolControllers = _getToolControllers
PathUtils.addToJob(pathObj)
_addBaseProperties(pathObj)
_addToolController(pathObj)
_setSafetyZ(pathObj)
doc.recompute()
if FreeCAD.GuiUp:
# Register the FreeCAD command
FreeCADGui.addCommand("CAM_PathShapeTC", CommandPathShapeTC())