Merge pull request #4672 from sliptonic/feature/camotics2
[PATH] CAMotics simulation. First Draft
This commit is contained in:
@@ -33,6 +33,7 @@ SET(PathScripts_SRCS
|
||||
PathScripts/PathCircularHoleBaseGui.py
|
||||
PathScripts/PathComment.py
|
||||
PathScripts/PathCopy.py
|
||||
PathScripts/PathCamoticsGui.py
|
||||
PathScripts/PathCustom.py
|
||||
PathScripts/PathCustomGui.py
|
||||
PathScripts/PathDeburr.py
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<file>icons/Path_BStep.svg</file>
|
||||
<file>icons/Path_BStop.svg</file>
|
||||
<file>icons/Path_BaseGeometry.svg</file>
|
||||
<file>icons/Path_Camotics.svg</file>
|
||||
<file>icons/Path_Comment.svg</file>
|
||||
<file>icons/Path_Compound.svg</file>
|
||||
<file>icons/Path_Contour.svg</file>
|
||||
@@ -130,6 +131,7 @@
|
||||
<file>panels/ToolBitSelector.ui</file>
|
||||
<file>panels/ToolEditor.ui</file>
|
||||
<file>panels/ToolLibraryEditor.ui</file>
|
||||
<file>panels/TaskPathCamoticsSim.ui</file>
|
||||
<file>panels/TaskPathSimulator.ui</file>
|
||||
<file>panels/ZCorrectEdit.ui</file>
|
||||
<file>preferences/Advanced.ui</file>
|
||||
|
||||
@@ -0,0 +1,644 @@
|
||||
<?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_Camotics.svg"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||
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
|
||||
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="-8 : 72 : 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>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
inkscape:document-rotation="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-x="1979"
|
||||
inkscape:window-height="1028"
|
||||
inkscape:window-width="1017"
|
||||
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="26.668103"
|
||||
inkscape:cx="29.975738"
|
||||
inkscape:zoom="4.64"
|
||||
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">
|
||||
<rect
|
||||
style="fill:#205693;fill-opacity:1;stroke:none;stroke-opacity:1"
|
||||
id="rect2127"
|
||||
width="60"
|
||||
height="60"
|
||||
x="2"
|
||||
y="2"
|
||||
ry="0" />
|
||||
<rect
|
||||
style="fill:#205693;fill-opacity:0;stroke:none;stroke-opacity:1"
|
||||
id="rect2143"
|
||||
width="56"
|
||||
height="56"
|
||||
x="4"
|
||||
y="4" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:900;font-stretch:normal;font-size:58.82933426px;line-height:1.25;font-family:'Montserrat Alternates';-inkscape-font-specification:'Montserrat Alternates, Heavy';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.11590576;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
x="8.5308275"
|
||||
y="53.681446"
|
||||
id="text2147"
|
||||
transform="scale(1.0340993,0.96702511)"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan2145"
|
||||
x="8.5308275"
|
||||
y="53.681446"
|
||||
style="font-style:normal;font-variant:normal;font-weight:900;font-stretch:normal;font-size:58.82933426px;font-family:'Montserrat Alternates';-inkscape-font-specification:'Montserrat Alternates, Heavy';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:none;stroke:#000000;stroke-width:4.11590576;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">C</tspan></text>
|
||||
<path
|
||||
style="fill:none;stroke:#00ff00;stroke-width:1.92485321;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 8,36 V 62"
|
||||
id="path2151"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ee5693;fill-opacity:1;stroke:#ff0000;stroke-width:1.93787384;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 2,54.932284 H 30"
|
||||
id="path2153"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TaskPathSimulator</class>
|
||||
<widget class="QDialog" name="TaskPathSimulator">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>404</width>
|
||||
<height>364</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Path Simulator</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QListView" name="lstPathObjects">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ContiguousSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="txtStatus">
|
||||
<property name="toolTip">
|
||||
<string>Estimated time to run to the selected point in the job</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Estimated run time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="txtRunEstimate">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="value">
|
||||
<number>23</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnRun">
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnLaunchCamotics">
|
||||
<property name="text">
|
||||
<string>Launch Camotics</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../Path.qrc">
|
||||
<normaloff>:/icons/Path_Camotics.svg</normaloff>:/icons/Path_Camotics.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../Path.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
<slots>
|
||||
<slot>SimStop()</slot>
|
||||
<slot>SimPlay()</slot>
|
||||
<slot>SimPause()</slot>
|
||||
<slot>SimStep()</slot>
|
||||
<slot>SimFF()</slot>
|
||||
</slots>
|
||||
</ui>
|
||||
@@ -78,6 +78,7 @@ class PathWorkbench (Workbench):
|
||||
from PathScripts import PathToolBitLibraryCmd
|
||||
|
||||
import PathCommands
|
||||
|
||||
PathGuiInit.Startup()
|
||||
|
||||
# build commands list
|
||||
@@ -96,8 +97,6 @@ class PathWorkbench (Workbench):
|
||||
"Path_DressupLeadInOut", "Path_DressupRampEntry",
|
||||
"Path_DressupTag", "Path_DressupZCorrect"]
|
||||
extracmdlist = []
|
||||
# modcmdmore = ["Path_Hop",]
|
||||
# remotecmdlist = ["Path_Remote"]
|
||||
specialcmdlist = []
|
||||
|
||||
|
||||
@@ -122,6 +121,12 @@ class PathWorkbench (Workbench):
|
||||
twodopcmdlist.append("Path_Slot")
|
||||
|
||||
if PathPreferences.advancedOCLFeaturesEnabled():
|
||||
try:
|
||||
import camotics
|
||||
toolcmdlist.append("Path_Camotics")
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
import ocl # pylint: disable=unused-variable
|
||||
from PathScripts import PathSurfaceGui
|
||||
|
||||
@@ -0,0 +1,400 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ***************************************************************************
|
||||
# * Copyright (c) 2020 sliptonic <[email protected]> *
|
||||
# * *
|
||||
# * 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.PathLog as PathLog
|
||||
# from pivy import coin
|
||||
# from itertools import cycle
|
||||
import json
|
||||
import Mesh
|
||||
import time
|
||||
import camotics
|
||||
import PathScripts.PathPost as PathPost
|
||||
import io
|
||||
import PathScripts
|
||||
import queue
|
||||
from threading import Thread, Lock
|
||||
import subprocess
|
||||
import PySide
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
|
||||
__title__ = "Camotics Simulator"
|
||||
__author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "https://www.freecadweb.org"
|
||||
__doc__ = "Task panel for Camotics Simulation"
|
||||
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
|
||||
# Qt translation handling
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
|
||||
class CAMoticsUI:
|
||||
def __init__(self, simulation):
|
||||
# this will create a Qt widget from our ui file
|
||||
self.form = FreeCADGui.PySideUic.loadUi(":/panels/TaskPathCamoticsSim.ui")
|
||||
self.simulation = simulation
|
||||
self.opModel = PySide.QtGui.QStandardItemModel(0, 0)#len(self.columnNames()))
|
||||
self.initializeUI()
|
||||
self.lock = False
|
||||
|
||||
def columnNames(self):
|
||||
return ['Operation']
|
||||
|
||||
def loadData(self):
|
||||
self.opModel.clear()
|
||||
self.opModel.setHorizontalHeaderLabels(self.columnNames())
|
||||
ops = self.simulation.finalpostlist
|
||||
for i, op in enumerate(ops):
|
||||
libItem = PySide.QtGui.QStandardItem(op.Label)
|
||||
libItem.setToolTip('op')
|
||||
libItem.setData(op)
|
||||
#libItem.setIcon(PySide.QtGui.QPixmap(':/icons/Path_ToolTable.svg'))
|
||||
self.opModel.appendRow(libItem)
|
||||
|
||||
|
||||
def initializeUI(self):
|
||||
self.form.progressBar.reset()
|
||||
self.updateEstimate("00:00:00")
|
||||
self.form.btnRun.setText("Run")
|
||||
self.form.btnLaunchCamotics.clicked.connect(self.launchCamotics)
|
||||
self.simulation.progressUpdate.connect(self.calculating)
|
||||
self.simulation.estimateChanged.connect(self.updateEstimate)
|
||||
self.form.btnRun.clicked.connect(self.runButton)
|
||||
self.form.lstPathObjects.setModel(self.opModel)
|
||||
self.form.lstPathObjects.selectionModel().selectionChanged.connect(self.reSelect)
|
||||
self.loadData()
|
||||
self.selectAll()
|
||||
|
||||
def selectAll(self):
|
||||
selmodel = self.form.lstPathObjects.selectionModel()
|
||||
index0 = self.opModel.index(0, 0)
|
||||
index1 = self.opModel.index(self.opModel.rowCount()-1,0)
|
||||
itemSelection = QtCore.QItemSelection(index0, index1)
|
||||
selmodel.blockSignals(True)
|
||||
selmodel.select(itemSelection, QtCore.QItemSelectionModel.Rows | QtCore.QItemSelectionModel.Select)
|
||||
selmodel.blockSignals(False)
|
||||
|
||||
|
||||
def reSelect(self):
|
||||
selmodel = self.form.lstPathObjects.selectionModel()
|
||||
item = selmodel.selection().indexes()[0]
|
||||
|
||||
index0 = self.opModel.index(0, 0)
|
||||
itemSelection = QtCore.QItemSelection(index0, item)
|
||||
|
||||
selmodel.blockSignals(True)
|
||||
selmodel.select(itemSelection,
|
||||
QtCore.QItemSelectionModel.Rows | QtCore.QItemSelectionModel.Select)
|
||||
selmodel.blockSignals(False)
|
||||
|
||||
selectedObjs = [self.opModel.itemFromIndex(i).data() for i in selmodel.selection().indexes()]
|
||||
|
||||
self.simulation.setSimulationPath(selectedObjs)
|
||||
|
||||
def runButton(self):
|
||||
if self.form.btnRun.text() == 'Run':
|
||||
self.simulation.run()
|
||||
else:
|
||||
self.simulation.stopSim()
|
||||
|
||||
|
||||
def updateEstimate(self, timestring):
|
||||
self.form.txtRunEstimate.setText(timestring)
|
||||
|
||||
def launchCamotics(self):
|
||||
projfile = self.simulation.buildproject()
|
||||
subprocess.Popen(["camotics", projfile])
|
||||
|
||||
def accept(self):
|
||||
self.simulation.accept()
|
||||
FreeCADGui.Control.closeDialog()
|
||||
|
||||
def reject(self):
|
||||
self.simulation.cancel()
|
||||
FreeCADGui.Control.closeDialog()
|
||||
|
||||
def calculating(self, progress=0.0):
|
||||
if progress < 1.0:
|
||||
self.form.btnRun.setText('Stop')
|
||||
else:
|
||||
self.form.btnRun.setText('Run')
|
||||
self.form.progressBar.setValue(int(progress*100))
|
||||
|
||||
|
||||
class CamoticsSimulation(QtCore.QObject):
|
||||
|
||||
SIM = camotics.Simulation()
|
||||
q = queue.Queue()
|
||||
progressUpdate = QtCore.Signal(object)
|
||||
estimateChanged = QtCore.Signal(str)
|
||||
|
||||
SHAPEMAP = {'ballend': 'Ballnose',
|
||||
'endmill': 'Cylindrical',
|
||||
'v-bit' : 'Conical',
|
||||
'chamfer': 'Snubnose'}
|
||||
|
||||
cutMaterial = None
|
||||
|
||||
def worker(self, lock):
|
||||
while True:
|
||||
item = self.q.get()
|
||||
with lock:
|
||||
if item['TYPE'] == 'STATUS':
|
||||
if item['VALUE'] == 'DONE':
|
||||
self.SIM.wait()
|
||||
surface = self.SIM.get_surface('binary')
|
||||
#surface = self.SIM.get_surface('python')
|
||||
self.SIM.wait()
|
||||
self.addMesh(surface)
|
||||
#self.makeCoinMesh(surface)
|
||||
elif item['TYPE'] == 'PROGRESS':
|
||||
#self.taskForm.calculating(item['VALUE'])
|
||||
msg = item['VALUE']
|
||||
self.progressUpdate.emit(msg)
|
||||
self.q.task_done()
|
||||
|
||||
|
||||
|
||||
def __init__(self):
|
||||
super().__init__() # needed for QT signals
|
||||
lock = Lock()
|
||||
Thread(target=self.worker, daemon=True, args=(lock,)).start()
|
||||
|
||||
def callback(self, status, progress):
|
||||
self.q.put({'TYPE': 'PROGRESS', 'VALUE': progress})
|
||||
self.q.put({'TYPE': 'STATUS' , 'VALUE': status })
|
||||
|
||||
def isDone(self, success):
|
||||
self.q.put({'TYPE': 'STATUS' , 'VALUE': 'DONE'})
|
||||
|
||||
def stopSim(self):
|
||||
if self.SIM.is_running():
|
||||
self.SIM.interrupt()
|
||||
self.SIM.wait()
|
||||
return True
|
||||
|
||||
|
||||
def addMesh(self, surface):
|
||||
'''takes a binary stl and adds a Mesh to the current docuemnt'''
|
||||
|
||||
if self.cutMaterial is None:
|
||||
self.cutMaterial = FreeCAD.ActiveDocument.addObject("Mesh::Feature", "SimulationOutput")
|
||||
buffer=io.BytesIO()
|
||||
buffer.write(surface)
|
||||
buffer.seek(0)
|
||||
mesh=Mesh.Mesh()
|
||||
mesh.read(buffer, "STL")
|
||||
self.cutMaterial.Mesh = mesh
|
||||
# Mesh.show(mesh)
|
||||
|
||||
def setSimulationPath(self, postlist):
|
||||
gcode, fname = PathPost.CommandPathPost().getGcodeSilently(postlist, self.job)
|
||||
self.SIM.compute_path(gcode)
|
||||
self.SIM.wait()
|
||||
|
||||
tot = sum([step['time'] for step in self.SIM.get_path()])
|
||||
self.estimateChanged.emit(time.strftime("%H:%M:%S", time.gmtime(tot)))
|
||||
|
||||
def Activate(self):
|
||||
self.job = FreeCADGui.Selection.getSelectionEx()[0].Object
|
||||
postlist = PathPost.buildPostList(self.job)
|
||||
self.finalpostlist = [item for slist in postlist for item in slist]
|
||||
|
||||
self.taskForm = CAMoticsUI(self)
|
||||
FreeCADGui.Control.showDialog(self.taskForm)
|
||||
|
||||
self.SIM.set_metric()
|
||||
self.SIM.set_resolution('high')
|
||||
|
||||
bb = self.job.Stock.Shape.BoundBox
|
||||
self.SIM.set_workpiece(min = (bb.XMin, bb.YMin, bb.ZMin), max = (bb.XMax, bb.YMax, bb.ZMax))
|
||||
|
||||
for t in self.job.Tools.Group:
|
||||
self.SIM.set_tool(t.ToolNumber,
|
||||
metric = True,
|
||||
shape = self.SHAPEMAP.get(t.Tool.ShapeName, 'Cylindrical'),
|
||||
length = t.Tool.Length.Value,
|
||||
diameter = t.Tool.Diameter.Value)
|
||||
|
||||
|
||||
self.setSimulationPath(self.finalpostlist)
|
||||
|
||||
def run(self):
|
||||
self.SIM.start(self.callback, done=self.isDone)
|
||||
|
||||
#def makeCoinMesh(self, surface):
|
||||
# # this doesn't work yet
|
||||
# #sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph();
|
||||
# color = coin.SoBaseColor()
|
||||
# color.rgb = (1, 0, 1)
|
||||
# coords = coin.SoTransform()
|
||||
# node = coin.SoSeparator()
|
||||
# node.addChild(color)
|
||||
# node.addChild(coords)
|
||||
|
||||
# end = [-1]
|
||||
# vertices = list(zip(*[iter(surface['vertices'])] * 3))
|
||||
# #polygons = list(zip(*[iter(vertices)] * 3, cycle(end)))
|
||||
# polygons = list(zip(*[iter(range(len(vertices)))] * 3, cycle(end)))
|
||||
|
||||
# print('verts {}'.format(len(vertices)))
|
||||
# print('polygons {}'.format(len(polygons)))
|
||||
|
||||
# data=coin.SoCoordinate3()
|
||||
# face=coin.SoIndexedFaceSet()
|
||||
# node.addChild(data)
|
||||
# node.addChild(face)
|
||||
|
||||
# # i = 0
|
||||
# # for i, v in enumerate(vertices):
|
||||
# # print('i: {} v: {}'.format(i, v))
|
||||
# #data.point.set1Value(i, v[0], v[1], v[2])
|
||||
# # i += 1
|
||||
# # i = 0
|
||||
# # for p in polygons:
|
||||
# # try:
|
||||
# # face.coordIndex.set1Value(i, p)
|
||||
# # i += 1
|
||||
# # except Exception as e:
|
||||
# # print(e)
|
||||
# # print(i)
|
||||
# # print(p)
|
||||
|
||||
# # sg.addChild(node)
|
||||
|
||||
|
||||
def RemoveMaterial(self):
|
||||
if self.cutMaterial is not None:
|
||||
FreeCAD.ActiveDocument.removeObject(self.cutMaterial.Name)
|
||||
self.cutMaterial = None
|
||||
|
||||
def accept(self):
|
||||
pass
|
||||
|
||||
def cancel(self):
|
||||
self.RemoveMaterial()
|
||||
|
||||
def buildproject(self):
|
||||
|
||||
job = self.job
|
||||
gcode, fname = PathPost.CommandPathPost().getGcodeSilently(self.finalpostlist, self.job, temp=False)
|
||||
|
||||
tooltemplate = {
|
||||
"units": "metric",
|
||||
"shape": "cylindrical",
|
||||
"length": 10,
|
||||
"diameter": 3.125,
|
||||
"description": ""
|
||||
}
|
||||
|
||||
workpiecetemplate = {
|
||||
"automatic": False,
|
||||
"margin": 0,
|
||||
"bounds": {
|
||||
"min": [0, 0, 0],
|
||||
"max": [0, 0, 0]}
|
||||
}
|
||||
|
||||
camoticstemplate = {
|
||||
"units": "metric",
|
||||
"resolution-mode": "high",
|
||||
"resolution": 1,
|
||||
"tools": {},
|
||||
"workpiece": {},
|
||||
"files": []
|
||||
}
|
||||
|
||||
unitstring = "imperial" if FreeCAD.Units.getSchema() in [2,3,5,7] else "metric"
|
||||
|
||||
camoticstemplate["units"] = unitstring
|
||||
camoticstemplate["resolution-mode"] = "medium"
|
||||
camoticstemplate["resolution"] = 1
|
||||
|
||||
toollist = {}
|
||||
for t in job.Tools.Group:
|
||||
tooltemplate["units"] = unitstring
|
||||
if hasattr(t.Tool, 'Camotics'):
|
||||
tooltemplate["shape"] = t.Tool.Camotics
|
||||
else:
|
||||
tooltemplate["shape"] = self.SHAPEMAP.get(t.Tool.ShapeName, 'Cylindrical')
|
||||
|
||||
tooltemplate["length"] = t.Tool.Length.Value
|
||||
tooltemplate["diameter"] = t.Tool.Diameter.Value
|
||||
tooltemplate["description"] = t.Label
|
||||
toollist[t.ToolNumber] = tooltemplate
|
||||
|
||||
camoticstemplate['tools'] = toollist
|
||||
|
||||
bb = job.Stock.Shape.BoundBox
|
||||
|
||||
workpiecetemplate['bounds']['min'] = [bb.XMin, bb.YMin, bb.ZMin]
|
||||
workpiecetemplate['bounds']['max'] = [bb.XMax, bb.YMax, bb.ZMax]
|
||||
camoticstemplate['workpiece'] = workpiecetemplate
|
||||
|
||||
camoticstemplate['files'] = [fname]
|
||||
|
||||
foo = QtGui.QFileDialog.getSaveFileName(QtGui.QApplication.activeWindow(), "Camotics Project File")
|
||||
if foo:
|
||||
tfile = foo[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
with open(tfile, 'w') as t:
|
||||
proj=json.dumps(camoticstemplate, indent=2)
|
||||
t.write(proj)
|
||||
|
||||
return tfile #json.dumps(camoticstemplate, indent=2)
|
||||
|
||||
|
||||
class CommandCamoticsSimulate:
|
||||
def GetResources(self):
|
||||
return {'Pixmap': 'Path_Camotics',
|
||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Path_Camotics", "Camotics"),
|
||||
'Accel': "P, C",
|
||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Path_Camotics", "Simulate using Camotics"),
|
||||
'CmdType': "ForEdit"}
|
||||
|
||||
def IsActive(self):
|
||||
if bool(FreeCADGui.Selection.getSelection()) is False:
|
||||
return False
|
||||
try:
|
||||
job = FreeCADGui.Selection.getSelectionEx()[0].Object
|
||||
return isinstance(job.Proxy, PathScripts.PathJob.ObjectJob)
|
||||
except:
|
||||
return False
|
||||
|
||||
def Activated(self):
|
||||
pathSimulation.Activate()
|
||||
|
||||
|
||||
pathSimulation = CamoticsSimulation()
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
FreeCADGui.addCommand('Path_Camotics', CommandCamoticsSimulate())
|
||||
|
||||
|
||||
FreeCAD.Console.PrintLog("Loading PathCamoticsSimulateGui ... done\n")
|
||||
@@ -71,6 +71,7 @@ def Startup():
|
||||
from PathScripts import PathSetupSheetGui
|
||||
from PathScripts import PathSimpleCopy
|
||||
from PathScripts import PathSimulatorGui
|
||||
from PathScripts import PathCamoticsGui
|
||||
from PathScripts import PathSlotGui
|
||||
from PathScripts import PathStop
|
||||
# from PathScripts import PathSurfaceGui # Added in initGui.py due to OCL dependency
|
||||
|
||||
@@ -33,6 +33,7 @@ import PathScripts.PathPreferences as PathPreferences
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
from PathScripts.PathPostProcessor import PostProcessor
|
||||
from PySide import QtCore, QtGui
|
||||
@@ -56,6 +57,187 @@ class _TempObject:
|
||||
Label = "Fixture"
|
||||
|
||||
|
||||
def resolveFileName(job):
|
||||
|
||||
path = PathPreferences.defaultOutputFile()
|
||||
if job.PostProcessorOutputFile:
|
||||
path = job.PostProcessorOutputFile
|
||||
filename = path
|
||||
|
||||
if '%D' in filename:
|
||||
D = FreeCAD.ActiveDocument.FileName
|
||||
if D:
|
||||
D = os.path.dirname(D)
|
||||
# in case the document is in the current working directory
|
||||
if not D:
|
||||
D = '.'
|
||||
else:
|
||||
FreeCAD.Console.PrintError("Please save document in order to resolve output path!\n")
|
||||
return None
|
||||
filename = filename.replace('%D', D)
|
||||
|
||||
if '%d' in filename:
|
||||
d = FreeCAD.ActiveDocument.Label
|
||||
filename = filename.replace('%d', d)
|
||||
|
||||
if '%j' in filename:
|
||||
j = job.Label
|
||||
filename = filename.replace('%j', j)
|
||||
|
||||
if '%M' in filename:
|
||||
pref = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro")
|
||||
M = pref.GetString("MacroPath", FreeCAD.getUserAppDataDir())
|
||||
filename = filename.replace('%M', M)
|
||||
|
||||
|
||||
policy = PathPreferences.defaultOutputPolicy()
|
||||
|
||||
openDialog = policy == 'Open File Dialog'
|
||||
if os.path.isdir(filename) or not os.path.isdir(os.path.dirname(filename)):
|
||||
# Either the entire filename resolves into a directory or the parent directory doesn't exist.
|
||||
# Either way I don't know what to do - ask for help
|
||||
openDialog = True
|
||||
|
||||
if os.path.isfile(filename) and not openDialog:
|
||||
if policy == 'Open File Dialog on conflict':
|
||||
openDialog = True
|
||||
elif policy == 'Append Unique ID on conflict':
|
||||
fn, ext = os.path.splitext(filename)
|
||||
nr = fn[-3:]
|
||||
n = 1
|
||||
if nr.isdigit():
|
||||
n = int(nr)
|
||||
while os.path.isfile("%s%03d%s" % (fn, n, ext)):
|
||||
n = n + 1
|
||||
filename = "%s%03d%s" % (fn, n, ext)
|
||||
|
||||
if openDialog:
|
||||
foo = QtGui.QFileDialog.getSaveFileName(QtGui.QApplication.activeWindow(), "Output File", filename)
|
||||
if foo:
|
||||
filename = foo[0]
|
||||
else:
|
||||
filename = None
|
||||
|
||||
return filename
|
||||
|
||||
def buildPostList(job):
|
||||
''' Takes the job and determines the specific objects and order to
|
||||
postprocess Returns a list of objects which can be passed to
|
||||
exportObjectsWith() for final posting'''
|
||||
wcslist = job.Fixtures
|
||||
orderby = job.OrderOutputBy
|
||||
|
||||
postlist = []
|
||||
|
||||
if orderby == 'Fixture':
|
||||
PathLog.debug("Ordering by Fixture")
|
||||
# Order by fixture means all operations and tool changes will be completed in one
|
||||
# fixture before moving to the next.
|
||||
|
||||
currTool = None
|
||||
for index, f in enumerate(wcslist):
|
||||
# create an object to serve as the fixture path
|
||||
fobj = _TempObject()
|
||||
c1 = Path.Command(f)
|
||||
fobj.Path = Path.Path([c1])
|
||||
if index != 0:
|
||||
c2 = Path.Command("G0 Z" + str(job.Stock.Shape.BoundBox.ZMax + job.SetupSheet.ClearanceHeightOffset.Value))
|
||||
fobj.Path.addCommands(c2)
|
||||
fobj.InList.append(job)
|
||||
sublist = [fobj]
|
||||
|
||||
# Now generate the gcode
|
||||
for obj in job.Operations.Group:
|
||||
tc = PathUtil.toolControllerForOp(obj)
|
||||
if tc is not None and PathUtil.opProperty(obj, 'Active'):
|
||||
if tc.ToolNumber != currTool:
|
||||
sublist.append(tc)
|
||||
PathLog.debug("Appending TC: {}".format(tc.Name))
|
||||
currTool = tc.ToolNumber
|
||||
sublist.append(obj)
|
||||
postlist.append(sublist)
|
||||
|
||||
elif orderby == 'Tool':
|
||||
PathLog.debug("Ordering by Tool")
|
||||
# Order by tool means tool changes are minimized.
|
||||
# all operations with the current tool are processed in the current
|
||||
# fixture before moving to the next fixture.
|
||||
|
||||
currTool = None
|
||||
fixturelist = []
|
||||
for f in wcslist:
|
||||
# create an object to serve as the fixture path
|
||||
fobj = _TempObject()
|
||||
c1 = Path.Command(f)
|
||||
c2 = Path.Command("G0 Z" + str(job.Stock.Shape.BoundBox.ZMax + job.SetupSheet.ClearanceHeightOffset.Value))
|
||||
fobj.Path = Path.Path([c1, c2])
|
||||
fobj.InList.append(job)
|
||||
fixturelist.append(fobj)
|
||||
|
||||
# Now generate the gcode
|
||||
curlist = [] # list of ops for tool, will repeat for each fixture
|
||||
sublist = [] # list of ops for output splitting
|
||||
|
||||
for idx, obj in enumerate(job.Operations.Group):
|
||||
|
||||
# check if the operation is active
|
||||
active = PathUtil.opProperty(obj, 'Active')
|
||||
|
||||
tc = PathUtil.toolControllerForOp(obj)
|
||||
if tc is None or tc.ToolNumber == currTool and active:
|
||||
curlist.append(obj)
|
||||
elif tc.ToolNumber != currTool and currTool is None and active: # first TC
|
||||
sublist.append(tc)
|
||||
curlist.append(obj)
|
||||
currTool = tc.ToolNumber
|
||||
elif tc.ToolNumber != currTool and currTool is not None and active: # TC
|
||||
for fixture in fixturelist:
|
||||
sublist.append(fixture)
|
||||
sublist.extend(curlist)
|
||||
postlist.append(sublist)
|
||||
sublist = [tc]
|
||||
curlist = [obj]
|
||||
currTool = tc.ToolNumber
|
||||
|
||||
if idx == len(job.Operations.Group) - 1: # Last operation.
|
||||
for fixture in fixturelist:
|
||||
sublist.append(fixture)
|
||||
sublist.extend(curlist)
|
||||
postlist.append(sublist)
|
||||
|
||||
elif orderby == 'Operation':
|
||||
PathLog.debug("Ordering by Operation")
|
||||
# Order by operation means ops are done in each fixture in
|
||||
# sequence.
|
||||
currTool = None
|
||||
firstFixture = True
|
||||
|
||||
# Now generate the gcode
|
||||
for obj in job.Operations.Group:
|
||||
if PathUtil.opProperty(obj, 'Active'):
|
||||
sublist = []
|
||||
PathLog.debug("obj: {}".format(obj.Name))
|
||||
for f in wcslist:
|
||||
fobj = _TempObject()
|
||||
c1 = Path.Command(f)
|
||||
fobj.Path = Path.Path([c1])
|
||||
if not firstFixture:
|
||||
c2 = Path.Command("G0 Z" + str(job.Stock.Shape.BoundBox.ZMax + job.SetupSheet.ClearanceHeightOffset.Value))
|
||||
fobj.Path.addCommands(c2)
|
||||
fobj.InList.append(job)
|
||||
sublist.append(fobj)
|
||||
firstFixture = False
|
||||
tc = PathUtil.toolControllerForOp(obj)
|
||||
if tc is not None:
|
||||
if job.SplitOutput or (tc.ToolNumber != currTool):
|
||||
sublist.append(tc)
|
||||
currTool = tc.ToolNumber
|
||||
sublist.append(obj)
|
||||
postlist.append(sublist)
|
||||
|
||||
return postlist
|
||||
|
||||
|
||||
class DlgSelectPostProcessor:
|
||||
|
||||
def __init__(self, parent=None):
|
||||
@@ -97,73 +279,6 @@ class CommandPathPost:
|
||||
# pylint: disable=no-init
|
||||
subpart = 1
|
||||
|
||||
def resolveFileName(self, job):
|
||||
path = PathPreferences.defaultOutputFile()
|
||||
if job.PostProcessorOutputFile:
|
||||
path = job.PostProcessorOutputFile
|
||||
filename = path
|
||||
|
||||
if '%D' in filename:
|
||||
D = FreeCAD.ActiveDocument.FileName
|
||||
if D:
|
||||
D = os.path.dirname(D)
|
||||
# in case the document is in the current working directory
|
||||
if not D:
|
||||
D = '.'
|
||||
else:
|
||||
FreeCAD.Console.PrintError("Please save document in order to resolve output path!\n")
|
||||
return None
|
||||
filename = filename.replace('%D', D)
|
||||
|
||||
if '%d' in filename:
|
||||
d = FreeCAD.ActiveDocument.Label
|
||||
filename = filename.replace('%d', d)
|
||||
|
||||
if '%j' in filename:
|
||||
j = job.Label
|
||||
filename = filename.replace('%j', j)
|
||||
|
||||
if '%M' in filename:
|
||||
pref = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro")
|
||||
M = pref.GetString("MacroPath", FreeCAD.getUserAppDataDir())
|
||||
filename = filename.replace('%M', M)
|
||||
|
||||
if '%s' in filename:
|
||||
if job.SplitOutput:
|
||||
filename = filename.replace('%s', '_'+str(self.subpart))
|
||||
self.subpart += 1
|
||||
else:
|
||||
filename = filename.replace('%s', '')
|
||||
|
||||
policy = PathPreferences.defaultOutputPolicy()
|
||||
|
||||
openDialog = policy == 'Open File Dialog'
|
||||
if os.path.isdir(filename) or not os.path.isdir(os.path.dirname(filename)):
|
||||
# Either the entire filename resolves into a directory or the parent directory doesn't exist.
|
||||
# Either way I don't know what to do - ask for help
|
||||
openDialog = True
|
||||
|
||||
if os.path.isfile(filename) and not openDialog:
|
||||
if policy == 'Open File Dialog on conflict':
|
||||
openDialog = True
|
||||
elif policy == 'Append Unique ID on conflict':
|
||||
fn, ext = os.path.splitext(filename)
|
||||
nr = fn[-3:]
|
||||
n = 1
|
||||
if nr.isdigit():
|
||||
n = int(nr)
|
||||
while os.path.isfile("%s%03d%s" % (fn, n, ext)):
|
||||
n = n + 1
|
||||
filename = "%s%03d%s" % (fn, n, ext)
|
||||
|
||||
if openDialog:
|
||||
foo = QtGui.QFileDialog.getSaveFileName(QtGui.QApplication.activeWindow(), "Output File", filename)
|
||||
if foo:
|
||||
filename = foo[0]
|
||||
else:
|
||||
filename = None
|
||||
|
||||
return filename
|
||||
|
||||
def resolvePostProcessor(self, job):
|
||||
if hasattr(job, "PostProcessor"):
|
||||
@@ -190,6 +305,37 @@ class CommandPathPost:
|
||||
|
||||
return False
|
||||
|
||||
def getGcodeSilently(self, objs, job, temp=True):
|
||||
'''This method will postprocess the given objects without opening dialogs
|
||||
or prompting the user for any input. gcode is returned as a list of lists
|
||||
suitable for splitting'''
|
||||
PathLog.track('objs: {}'.format(objs))
|
||||
|
||||
postArgs = PathPreferences.defaultPostProcessorArgs()
|
||||
if hasattr(job, "PostProcessorArgs") and job.PostProcessorArgs:
|
||||
postArgs = job.PostProcessorArgs
|
||||
elif hasattr(job, "PostProcessor") and job.PostProcessor:
|
||||
postArgs = ''
|
||||
|
||||
if not '--no-show-editor' in postArgs:
|
||||
postArgs += ' --no-show-editor'
|
||||
|
||||
PathLog.track('postArgs: {}'.format(postArgs))
|
||||
|
||||
if temp:
|
||||
tfile = tempfile.NamedTemporaryFile()
|
||||
filename = tfile.name
|
||||
else:
|
||||
filename = resolveFileName(job)
|
||||
tfile = open(filename, "w")
|
||||
|
||||
with tfile:
|
||||
postname = self.resolvePostProcessor(job)
|
||||
processor = PostProcessor.load(postname)
|
||||
gcode = processor.export(objs, filename, postArgs)
|
||||
return gcode, filename
|
||||
|
||||
|
||||
def exportObjectsWith(self, objs, job, needFilename=True):
|
||||
PathLog.track()
|
||||
# check if the user has a project and has set the default post and
|
||||
@@ -203,7 +349,7 @@ class CommandPathPost:
|
||||
postname = self.resolvePostProcessor(job)
|
||||
filename = '-'
|
||||
if postname and needFilename:
|
||||
filename = self.resolveFileName(job)
|
||||
filename = resolveFileName(job)
|
||||
|
||||
if postname and filename:
|
||||
print("post: %s(%s, %s)" % (postname, filename, postArgs))
|
||||
@@ -261,117 +407,9 @@ class CommandPathPost:
|
||||
|
||||
PathLog.debug("about to postprocess job: {}".format(job.Name))
|
||||
|
||||
wcslist = job.Fixtures
|
||||
orderby = job.OrderOutputBy
|
||||
split = job.SplitOutput
|
||||
postlist = buildPostList(job)
|
||||
filename = resolveFileName(job)
|
||||
|
||||
postlist = []
|
||||
|
||||
if orderby == 'Fixture':
|
||||
PathLog.debug("Ordering by Fixture")
|
||||
# Order by fixture means all operations and tool changes will be completed in one
|
||||
# fixture before moving to the next.
|
||||
|
||||
currTool = None
|
||||
for index, f in enumerate(wcslist):
|
||||
# create an object to serve as the fixture path
|
||||
fobj = _TempObject()
|
||||
c1 = Path.Command(f)
|
||||
fobj.Path = Path.Path([c1])
|
||||
if index != 0:
|
||||
c2 = Path.Command("G0 Z" + str(job.Stock.Shape.BoundBox.ZMax + job.SetupSheet.ClearanceHeightOffset.Value))
|
||||
fobj.Path.addCommands(c2)
|
||||
fobj.InList.append(job)
|
||||
sublist = [fobj]
|
||||
|
||||
# Now generate the gcode
|
||||
for obj in job.Operations.Group:
|
||||
tc = PathUtil.toolControllerForOp(obj)
|
||||
if tc is not None and PathUtil.opProperty(obj, 'Active'):
|
||||
if tc.ToolNumber != currTool:
|
||||
sublist.append(tc)
|
||||
PathLog.debug("Appending TC: {}".format(tc.Name))
|
||||
currTool = tc.ToolNumber
|
||||
sublist.append(obj)
|
||||
postlist.append(sublist)
|
||||
|
||||
elif orderby == 'Tool':
|
||||
PathLog.debug("Ordering by Tool")
|
||||
# Order by tool means tool changes are minimized.
|
||||
# all operations with the current tool are processed in the current
|
||||
# fixture before moving to the next fixture.
|
||||
|
||||
currTool = None
|
||||
fixturelist = []
|
||||
for f in wcslist:
|
||||
# create an object to serve as the fixture path
|
||||
fobj = _TempObject()
|
||||
c1 = Path.Command(f)
|
||||
c2 = Path.Command("G0 Z" + str(job.Stock.Shape.BoundBox.ZMax + job.SetupSheet.ClearanceHeightOffset.Value))
|
||||
fobj.Path = Path.Path([c1, c2])
|
||||
fobj.InList.append(job)
|
||||
fixturelist.append(fobj)
|
||||
|
||||
# Now generate the gcode
|
||||
curlist = [] # list of ops for tool, will repeat for each fixture
|
||||
sublist = [] # list of ops for output splitting
|
||||
|
||||
for idx, obj in enumerate(job.Operations.Group):
|
||||
|
||||
# check if the operation is active
|
||||
active = PathUtil.opProperty(obj, 'Active')
|
||||
|
||||
tc = PathUtil.toolControllerForOp(obj)
|
||||
if tc is None or tc.ToolNumber == currTool and active:
|
||||
curlist.append(obj)
|
||||
elif tc.ToolNumber != currTool and currTool is None and active: # first TC
|
||||
sublist.append(tc)
|
||||
curlist.append(obj)
|
||||
currTool = tc.ToolNumber
|
||||
elif tc.ToolNumber != currTool and currTool is not None and active: # TC
|
||||
for fixture in fixturelist:
|
||||
sublist.append(fixture)
|
||||
sublist.extend(curlist)
|
||||
postlist.append(sublist)
|
||||
sublist = [tc]
|
||||
curlist = [obj]
|
||||
currTool = tc.ToolNumber
|
||||
|
||||
if idx == len(job.Operations.Group) - 1: # Last operation.
|
||||
for fixture in fixturelist:
|
||||
sublist.append(fixture)
|
||||
sublist.extend(curlist)
|
||||
postlist.append(sublist)
|
||||
|
||||
elif orderby == 'Operation':
|
||||
PathLog.debug("Ordering by Operation")
|
||||
# Order by operation means ops are done in each fixture in
|
||||
# sequence.
|
||||
currTool = None
|
||||
firstFixture = True
|
||||
|
||||
# Now generate the gcode
|
||||
for obj in job.Operations.Group:
|
||||
if PathUtil.opProperty(obj, 'Active'):
|
||||
sublist = []
|
||||
PathLog.debug("obj: {}".format(obj.Name))
|
||||
for f in wcslist:
|
||||
fobj = _TempObject()
|
||||
c1 = Path.Command(f)
|
||||
fobj.Path = Path.Path([c1])
|
||||
if not firstFixture:
|
||||
c2 = Path.Command("G0 Z" + str(job.Stock.Shape.BoundBox.ZMax + job.SetupSheet.ClearanceHeightOffset.Value))
|
||||
fobj.Path.addCommands(c2)
|
||||
fobj.InList.append(job)
|
||||
sublist.append(fobj)
|
||||
firstFixture = False
|
||||
tc = PathUtil.toolControllerForOp(obj)
|
||||
if tc is not None:
|
||||
if job.SplitOutput or (tc.ToolNumber != currTool):
|
||||
sublist.append(tc)
|
||||
currTool = tc.ToolNumber
|
||||
sublist.append(obj)
|
||||
postlist.append(sublist)
|
||||
|
||||
fail = True
|
||||
rc = ''
|
||||
|
||||
Reference in New Issue
Block a user