Merge pull request #3268 from Russ4262/Surface_Waterline_Split

[Path] Split 3D Surface and Waterline into independent operations
This commit is contained in:
sliptonic
2020-03-31 08:16:32 -05:00
committed by GitHub
12 changed files with 4727 additions and 807 deletions

View File

@@ -25,6 +25,8 @@ INSTALL(
SET(PathScripts_SRCS
PathCommands.py
PathScripts/PathAdaptive.py
PathScripts/PathAdaptiveGui.py
PathScripts/PathAreaOp.py
PathScripts/PathArray.py
PathScripts/PathCircularHoleBase.py
@@ -100,6 +102,7 @@ SET(PathScripts_SRCS
PathScripts/PathSetupSheetOpPrototype.py
PathScripts/PathSetupSheetOpPrototypeGui.py
PathScripts/PathSimpleCopy.py
PathScripts/PathSimulatorGui.py
PathScripts/PathStock.py
PathScripts/PathStop.py
PathScripts/PathSurface.py
@@ -113,15 +116,14 @@ SET(PathScripts_SRCS
PathScripts/PathToolController.py
PathScripts/PathToolControllerGui.py
PathScripts/PathToolEdit.py
PathScripts/PathToolLibraryManager.py
PathScripts/PathToolLibraryEditor.py
PathScripts/PathToolLibraryManager.py
PathScripts/PathUtil.py
PathScripts/PathUtils.py
PathScripts/PathUtilsGui.py
PathScripts/PathSimulatorGui.py
PathScripts/PathWaterline.py
PathScripts/PathWaterlineGui.py
PathScripts/PostUtils.py
PathScripts/PathAdaptiveGui.py
PathScripts/PathAdaptive.py
PathScripts/__init__.py
)
@@ -192,8 +194,8 @@ SET(PathTests_SRCS
PathTests/boxtest.fcstd
PathTests/test_centroid_00.ngc
PathTests/test_geomop.fcstd
PathTests/test_linuxcnc_00.ngc
PathTests/test_holes00.fcstd
PathTests/test_linuxcnc_00.ngc
)
SET(PathImages_Ops

View File

@@ -1,9 +1,19 @@
<RCC>
<qresource>
<file>icons/Path-Adaptive.svg</file>
<file>icons/Path-ToolDuplicate.svg</file>
<file>icons/Path-3DPocket.svg</file>
<file>icons/Path-3DSurface.svg</file>
<file>icons/Path-Area-View.svg</file>
<file>icons/Path-Area-Workplane.svg</file>
<file>icons/Path-Area.svg</file>
<file>icons/Path-Array.svg</file>
<file>icons/Path-Axis.svg</file>
<file>icons/Path-BFastForward.svg</file>
<file>icons/Path-BPause.svg</file>
<file>icons/Path-BPlay.svg</file>
<file>icons/Path-BStep.svg</file>
<file>icons/Path-BStop.svg</file>
<file>icons/Path-BaseGeometry.svg</file>
<file>icons/Path-Comment.svg</file>
<file>icons/Path-Compound.svg</file>
@@ -17,9 +27,9 @@
<file>icons/Path-Drilling.svg</file>
<file>icons/Path-Engrave.svg</file>
<file>icons/Path-ExportTemplate.svg</file>
<file>icons/Path-Face.svg</file>
<file>icons/Path-FacePocket.svg</file>
<file>icons/Path-FaceProfile.svg</file>
<file>icons/Path-Face.svg</file>
<file>icons/Path-Heights.svg</file>
<file>icons/Path-Helix.svg</file>
<file>icons/Path-Hop.svg</file>
@@ -27,13 +37,13 @@
<file>icons/Path-Job.svg</file>
<file>icons/Path-Kurve.svg</file>
<file>icons/Path-LengthOffset.svg</file>
<file>icons/Path-Machine.svg</file>
<file>icons/Path-MachineLathe.svg</file>
<file>icons/Path-MachineMill.svg</file>
<file>icons/Path-Machine.svg</file>
<file>icons/Path-OpActive.svg</file>
<file>icons/Path-OpCopy.svg</file>
<file>icons/Path-OperationA.svg</file>
<file>icons/Path-OperationB.svg</file>
<file>icons/Path-OpCopy.svg</file>
<file>icons/Path-Plane.svg</file>
<file>icons/Path-Pocket.svg</file>
<file>icons/Path-Post.svg</file>
@@ -46,49 +56,40 @@
<file>icons/Path-SetupSheet.svg</file>
<file>icons/Path-Shape.svg</file>
<file>icons/Path-SimpleCopy.svg</file>
<file>icons/Path-Simulator.svg</file>
<file>icons/Path-Speed.svg</file>
<file>icons/Path-Stock.svg</file>
<file>icons/Path-Stop.svg</file>
<file>icons/Path-ToolBit.svg</file>
<file>icons/Path-ToolChange.svg</file>
<file>icons/Path-ToolController.svg</file>
<file>icons/Path-ToolDuplicate.svg</file>
<file>icons/Path-Toolpath.svg</file>
<file>icons/Path-ToolTable.svg</file>
<file>icons/Path-Area.svg</file>
<file>icons/Path-Area-View.svg</file>
<file>icons/Path-Area-Workplane.svg</file>
<file>icons/Path-Simulator.svg</file>
<file>icons/Path-BFastForward.svg</file>
<file>icons/Path-BPause.svg</file>
<file>icons/Path-BPlay.svg</file>
<file>icons/Path-BStep.svg</file>
<file>icons/Path-BStop.svg</file>
<file>icons/Path-Waterline.svg</file>
<file>icons/arrow-ccw.svg</file>
<file>icons/arrow-cw.svg</file>
<file>icons/arrow-down.svg</file>
<file>icons/arrow-left.svg</file>
<file>icons/arrow-left-down.svg</file>
<file>icons/arrow-left-up.svg</file>
<file>icons/arrow-right.svg</file>
<file>icons/arrow-left.svg</file>
<file>icons/arrow-right-down.svg</file>
<file>icons/arrow-right-up.svg</file>
<file>icons/arrow-right.svg</file>
<file>icons/arrow-up.svg</file>
<file>icons/edge-join-miter.svg</file>
<file>icons/edge-join-miter-not.svg</file>
<file>icons/edge-join-round.svg</file>
<file>icons/edge-join-miter.svg</file>
<file>icons/edge-join-round-not.svg</file>
<file>icons/edge-join-round.svg</file>
<file>icons/preferences-path.svg</file>
<file>icons/Path-Adaptive.svg</file>
<file>panels/DlgJobChooser.ui</file>
<file>panels/DlgJobCreate.ui</file>
<file>panels/DlgJobModelSelect.ui</file>
<file>panels/DlgJobTemplateExport.ui</file>
<file>panels/DlgSelectPostProcessor.ui</file>
<file>panels/DlgTCChooser.ui</file>
<file>panels/DlgToolControllerEdit.ui</file>
<file>panels/DlgToolCopy.ui</file>
<file>panels/DlgToolEdit.ui</file>
<file>panels/DlgTCChooser.ui</file>
<file>panels/DogboneEdit.ui</file>
<file>panels/DressupPathBoundary.ui</file>
<file>panels/HoldingTagsEdit.ui</file>
@@ -106,6 +107,7 @@
<file>panels/PageOpProbeEdit.ui</file>
<file>panels/PageOpProfileFullEdit.ui</file>
<file>panels/PageOpSurfaceEdit.ui</file>
<file>panels/PageOpWaterlineEdit.ui</file>
<file>panels/PathEdit.ui</file>
<file>panels/PointEdit.ui</file>
<file>panels/SetupGlobal.ui</file>
@@ -120,16 +122,25 @@
<file>preferences/PathDressupHoldingTags.ui</file>
<file>preferences/PathJob.ui</file>
<file>translations/Path_af.qm</file>
<file>translations/Path_ar.qm</file>
<file>translations/Path_ca.qm</file>
<file>translations/Path_cs.qm</file>
<file>translations/Path_de.qm</file>
<file>translations/Path_el.qm</file>
<file>translations/Path_es-ES.qm</file>
<file>translations/Path_eu.qm</file>
<file>translations/Path_fi.qm</file>
<file>translations/Path_fil.qm</file>
<file>translations/Path_fr.qm</file>
<file>translations/Path_gl.qm</file>
<file>translations/Path_hr.qm</file>
<file>translations/Path_hu.qm</file>
<file>translations/Path_id.qm</file>
<file>translations/Path_it.qm</file>
<file>translations/Path_ja.qm</file>
<file>translations/Path_kab.qm</file>
<file>translations/Path_ko.qm</file>
<file>translations/Path_lt.qm</file>
<file>translations/Path_nl.qm</file>
<file>translations/Path_no.qm</file>
<file>translations/Path_pl.qm</file>
@@ -143,18 +154,9 @@
<file>translations/Path_sv-SE.qm</file>
<file>translations/Path_tr.qm</file>
<file>translations/Path_uk.qm</file>
<file>translations/Path_val-ES.qm</file>
<file>translations/Path_vi.qm</file>
<file>translations/Path_zh-CN.qm</file>
<file>translations/Path_zh-TW.qm</file>
<file>translations/Path_eu.qm</file>
<file>translations/Path_ca.qm</file>
<file>translations/Path_gl.qm</file>
<file>translations/Path_kab.qm</file>
<file>translations/Path_ko.qm</file>
<file>translations/Path_fil.qm</file>
<file>translations/Path_id.qm</file>
<file>translations/Path_lt.qm</file>
<file>translations/Path_val-ES.qm</file>
<file>translations/Path_ar.qm</file>
<file>translations/Path_vi.qm</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,281 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
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"
width="64px"
height="64px"
id="svg2816"
version="1.1"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="Path-Waterline.svg">
<title
id="title165">Path_Waterline</title>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1304"
inkscape:window-height="745"
id="namedview32"
showgrid="true"
inkscape:snap-bbox="false"
inkscape:snap-nodes="true"
inkscape:snap-global="false"
inkscape:zoom="8.0000004"
inkscape:cx="17.234266"
inkscape:cy="29.588719"
inkscape:window-x="54"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:grid
type="xygrid"
id="grid3009"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<defs
id="defs2818">
<linearGradient
id="linearGradient6899"
osb:paint="solid">
<stop
style="stop-color:#074cff;stop-opacity:1;"
offset="0"
id="stop6901" />
</linearGradient>
<linearGradient
id="linearGradient6887"
osb:paint="solid">
<stop
style="stop-color:#074cff;stop-opacity:1;"
offset="0"
id="stop6889" />
</linearGradient>
<linearGradient
id="linearGradient4668"
osb:paint="gradient">
<stop
style="stop-color:#009b00;stop-opacity:1;"
offset="0"
id="stop4670" />
<stop
style="stop-color:#009b00;stop-opacity:0;"
offset="1"
id="stop4672" />
</linearGradient>
<linearGradient
id="linearGradient4662"
osb:paint="solid">
<stop
style="stop-color:#008000;stop-opacity:1;"
offset="0"
id="stop4664" />
</linearGradient>
<linearGradient
id="linearGradient4529"
osb:paint="solid">
<stop
style="stop-color:#0047ff;stop-opacity:1;"
offset="0"
id="stop4531" />
</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>
<radialGradient
xlink:href="#linearGradient4513"
id="radialGradient3132"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.39497909,0,0,1.1841158,-76.294432,-34.372515)"
cx="32.151962"
cy="27.950663"
fx="32.151962"
fy="27.950663"
r="23.634638" />
<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
id="linearGradient3797">
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="0"
id="stop3799" />
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="1"
id="stop3801" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient4513"
id="radialGradient3132-4"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.39497909,0,0,1.1841158,-76.294432,-34.372515)"
cx="32.151962"
cy="27.950663"
fx="32.151962"
fy="27.950663"
r="23.634638" />
<radialGradient
xlink:href="#linearGradient3797"
id="radialGradient3805"
cx="16.46319"
cy="23.895996"
fx="16.46319"
fy="23.895996"
r="18.501005"
gradientTransform="matrix(0.80330389,1.0328193,-1.4593803,1.1350735,42.108301,-16.627212)"
gradientUnits="userSpaceOnUse" />
<linearGradient
xlink:href="#linearGradient4031"
id="linearGradient4055"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(71.494719,-3.1982556)"
x1="30.000002"
y1="10"
x2="36"
y2="54.227272" />
</defs>
<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>Path_Waterline</dc:title>
<dc:title>Path-Waterline</dc:title>
<dc:date>2019-05-19</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-Waterline.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>[russ4262] Russell Johnson</dc:title>
</cc:Agent>
</dc:contributor>
<dc:creator>
<cc:Agent>
<dc:title>[russ4262] Russell Johnson</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
style="display:inline;opacity:1">
<g
style="display:inline;opacity:1"
id="g4358"
transform="matrix(0.58483815,0,0,0.51339436,78.144089,14.290628)" />
<circle
r="17.5"
cy="37.5"
cx="29.4599"
id="path4493"
style="display:inline;opacity:0.97000002;fill:url(#radialGradient3805);fill-opacity:1;stroke:#0b1521;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<circle
r="15.5"
cy="37.5"
cx="29.4599"
id="path4493-1"
style="display:inline;opacity:0.97000002;fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<g
transform="matrix(0.58483815,0,0,0.51339436,71.618929,23.569677)"
id="g4358-4"
style="display:inline;opacity:1" />
<circle
style="display:inline;opacity:0.97000002;fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="circle4822"
cx="29.4599"
cy="37.5"
r="15.5" />
<path
inkscape:connector-curvature="0"
id="circle4734"
d="m 43.012901,20.993607 a 17.5,17.5 0 0 1 -13.197266,6.03125 17.5,17.5 0 0 1 -13.048828,-5.900391 21.189749,21.189749 0 0 0 -4.238281,4.552735 23.697439,23.697439 0 0 0 17.46289,7.720703 23.697439,23.697439 0 0 0 17.435547,-7.720703 21.189749,21.189749 0 0 0 -4.414062,-4.683594 z"
style="display:inline;opacity:1;fill:#1a1a1a;fill-opacity:1;stroke:#1a1a1a;stroke-width:2.70827866;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path4737"
d="m 8.731651,34.735794 a 21.189749,21.189749 0 0 0 -0.283203,3.294922 21.189749,21.189749 0 0 0 0.628906,5.039063 25.091324,11.279887 0 0 0 20.228515,4.626953 25.091324,11.279887 0 0 0 21.011719,-5.123047 21.189749,21.189749 0 0 0 0.509766,-4.542969 21.189749,21.189749 0 0 0 -0.191406,-2.634765 24.954107,14.861135 0 0 1 -20.623047,6.498046 24.954107,14.861135 0 0 1 -21.28125,-7.158203 z"
style="opacity:1;fill:#1a1a1a;fill-opacity:1;stroke:#1a1a1a;stroke-width:1.89686728;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="circle4734-3"
d="M 14.698516,22.688476 A 21.189749,21.189749 0 0 0 12.72,25.067383 24.982393,24.982393 0 0 0 29.452422,31.606445 24.982393,24.982393 0 0 0 46.862578,24.489258 21.189749,21.189749 0 0 0 45.337188,22.696289 21.8059,21.8059 0 0 1 30.026641,29.05957 21.8059,21.8059 0 0 1 14.698516,22.688476 Z"
style="display:inline;opacity:1;fill:#73d216;fill-opacity:1;stroke:#1a1a1a;stroke-width:0;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path4835"
d="m 8.1302074,37.508398 a 21.189749,21.189749 0 0 0 -0.035156,0.962891 21.189749,21.189749 0 0 0 0.109374,2.058594 28.746413,17.1196 0 0 0 21.7109376,5.976562 28.746413,17.1196 0 0 0 20.310547,-5.021484 21.189749,21.189749 0 0 0 0.248047,-3.001953 28.904483,18.541831 0 0 1 -20.488282,5.484375 28.904483,18.541831 0 0 1 -21.8554676,-6.458985 z"
style="opacity:1;fill:#73d216;fill-opacity:1;stroke:#00ff00;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="circle4734-3-9"
d="m 15.509519,21.31383 a 21.189749,21.189749 0 0 0 -1.978516,2.378907 24.982393,24.982393 0 0 0 16.732422,6.539062 24.982393,24.982393 0 0 0 17.410156,-7.117187 21.189749,21.189749 0 0 0 -1.52539,-1.792969 21.8059,21.8059 0 0 1 -15.310547,6.363281 21.8059,21.8059 0 0 1 -15.328125,-6.371094 z"
style="display:inline;opacity:1;fill:#8ae234;fill-opacity:1;stroke:#1a1a1a;stroke-width:0;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path4835-0"
d="m 8.1959236,36.208398 a 21.189749,21.189749 0 0 0 -0.03516,0.962891 21.189749,21.189749 0 0 0 0.109374,2.058594 28.746413,17.1196 0 0 0 21.7109374,5.976562 28.746413,17.1196 0 0 0 20.310548,-5.021484 21.189749,21.189749 0 0 0 0.248047,-3.001953 28.904483,18.541831 0 0 1 -20.488283,5.484375 28.904483,18.541831 0 0 1 -21.8554674,-6.458985 z"
style="display:inline;opacity:1;fill:#8ae234;fill-opacity:1;stroke:#00ff00;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<g
transform="matrix(0.66585367,0,0,0.65271967,-19.339925,4.6218574)"
id="g4051">
<path
inkscape:connector-curvature="0"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:url(#linearGradient4055);fill-opacity:1;fill-rule:nonzero;stroke:#2e3436;stroke-width:3.03373241;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 94.494721,6.8017444 -0.01099,27.5961536 18.021979,-7.660256 -0.011,-19.9358976 z M 112.49472,29.801744 94.483731,37.462 l 0.01099,8.339744 17.999999,-8 z m 0.011,10.724359 -16.520148,7.660256 7.509158,4.615385 9,-5 z"
id="rect4417-3" />
<path
inkscape:connector-curvature="0"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#d3d7cf;stroke-width:3.03373241;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
d="M 97.487394,9.8850776 V 29.753867 l 11.991186,-5.098858 0.0235,-14.7699314 z m 12.014656,24.5647544 -11.989201,5.01406 v 1.711385 l 11.963741,-5.40113 z m 0.0452,10.829611 -7.19513,3.327881 1.20492,0.808046 5.9895,-3.408611 z"
id="rect4417-1" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>357</width>
<height>427</height>
<width>350</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
@@ -24,7 +24,7 @@
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="toolController_label">
<property name="text">
<string>ToolController</string>
</property>
@@ -38,7 +38,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="coolantController_label">
<property name="text">
<string>Coolant Mode</string>
</property>
@@ -57,126 +57,35 @@
<item row="1" column="0">
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Algorithm</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="algorithmSelect">
<item>
<property name="text">
<string>OCL Dropcutter</string>
</property>
</item>
<item>
<property name="text">
<string>OCL Waterline</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>BoundBox</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="boundBoxSelect">
<widget class="QComboBox" name="scanType">
<item>
<property name="text">
<string>Stock</string>
<string>Planar</string>
</property>
</item>
<item>
<property name="text">
<string>BaseBoundBox</string>
<string>Rotational</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>BoundBox extra offset X, Y</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::InputField" name="boundBoxExtraOffsetX" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="Gui::InputField" name="boundBoxExtraOffsetY" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Drop Cutter Direction</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QComboBox" name="dropCutterDirSelect">
<item row="2" column="1" colspan="2">
<widget class="QComboBox" name="layerMode">
<item>
<property name="text">
<string>X</string>
<string>Single-pass</string>
</property>
</item>
<item>
<property name="text">
<string>Y</string>
<string>Multi-pass</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Depth offset</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="Gui::InputField" name="depthOffset" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Sample interval</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="Gui::InputField" name="sampleInterval" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Step over</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<item row="8" column="1" colspan="2">
<widget class="QSpinBox" name="stepOver">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The amount by which the tool is laterally displaced on each cycle of the pattern, specified in percent of the tool diameter.&lt;/p&gt;&lt;p&gt;A step over of 100% results in no overlap between two different cycles.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@@ -195,20 +104,180 @@
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_7">
<item row="8" column="0">
<widget class="QLabel" name="stepOver_label">
<property name="text">
<string>Optimize output</string>
<string>Step over</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="sampleInterval_label">
<property name="text">
<string>Sample interval</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="layerMode_label">
<property name="text">
<string>Layer Mode</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="optimizeEnabled">
<property name="text">
<string>Optimize Linear Paths</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="dropCutterDirSelect_label">
<property name="text">
<string>Drop Cutter Direction</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="boundBoxExtraOffset_label">
<property name="text">
<string>BoundBox extra offset X, Y</string>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QCheckBox" name="useStartPoint">
<property name="text">
<string>Use Start Point</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="scanType_label">
<property name="text">
<string>Scan Type</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="boundBoxSelect_label">
<property name="text">
<string>BoundBox</string>
</property>
</widget>
</item>
<item row="7" column="1" colspan="2">
<widget class="QCheckBox" name="optimizeEnabled">
<property name="text">
<string>Enabled</string>
<widget class="Gui::InputField" name="depthOffset" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="Gui::InputField" name="boundBoxExtraOffsetX" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::InputField" name="boundBoxExtraOffsetY" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="10" column="1" colspan="2">
<widget class="Gui::InputField" name="sampleInterval" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="depthOffset_label">
<property name="text">
<string>Depth offset</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="QComboBox" name="dropCutterDirSelect">
<item>
<property name="text">
<string>X</string>
</property>
</item>
<item>
<property name="text">
<string>Y</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="boundBoxSelect">
<item>
<property name="text">
<string>Stock</string>
</property>
</item>
<item>
<property name="text">
<string>BaseBoundBox</string>
</property>
</item>
</widget>
</item>
<item row="13" column="1">
<widget class="QCheckBox" name="optimizeStepOverTransitions">
<property name="text">
<string>Optimize StepOver Transitions</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="cutPattern_label">
<property name="text">
<string>Cut Pattern</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QComboBox" name="cutPattern">
<item>
<property name="text">
<string>Line</string>
</property>
</item>
<item>
<property name="text">
<string>ZigZag</string>
</property>
</item>
<item>
<property name="text">
<string>Circular</string>
</property>
</item>
<item>
<property name="text">
<string>CircularZigZag</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>

View File

@@ -0,0 +1,269 @@
<?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>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>ToolController</string>
</property>
</widget>
</item>
<item>
<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>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="3">
<widget class="QComboBox" name="boundBoxSelect">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<item>
<property name="text">
<string>Stock</string>
</property>
</item>
<item>
<property name="text">
<string>BaseBoundBox</string>
</property>
</item>
</widget>
</item>
<item row="4" column="3">
<widget class="QLineEdit" name="boundaryAdjustment">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QComboBox" name="layerMode">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</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="0" column="3">
<widget class="QComboBox" name="algorithmSelect">
<item>
<property name="text">
<string>OCL Dropcutter</string>
</property>
</item>
<item>
<property name="text">
<string>Experimental</string>
</property>
</item>
</widget>
</item>
<item row="11" column="3">
<widget class="QCheckBox" name="optimizeEnabled">
<property name="text">
<string>Optimize Linear Paths</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="boundaryAdjustment_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Boundary Adjustment</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QComboBox" name="cutPattern">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Line</string>
</property>
</item>
<item>
<property name="text">
<string>ZigZag</string>
</property>
</item>
<item>
<property name="text">
<string>Circular</string>
</property>
</item>
<item>
<property name="text">
<string>CircularZigZag</string>
</property>
</item>
</widget>
</item>
<item row="8" column="3">
<widget class="QSpinBox" name="stepOver">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The amount by which the tool is laterally displaced on each cycle of the pattern, specified in percent of the tool diameter.&lt;/p&gt;&lt;p&gt;A step over of 100% results in no overlap between two different cycles.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="layerMode_label">
<property name="text">
<string>Layer Mode</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="boundBoxSelect_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>BoundBox</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="stepOver_label">
<property name="text">
<string>Step over</string>
</property>
</widget>
</item>
<item row="9" column="3">
<widget class="Gui::InputField" name="sampleInterval" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="cutPattern_label">
<property name="text">
<string>Cut Pattern</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="sampleInterval_label">
<property name="text">
<string>Sample interval</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="algorithmSelect_label">
<property name="text">
<string>Algorithm</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>QWidget</extends>
<header>gui::inputfield.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -21,8 +21,9 @@
# * *
# ***************************************************************************/
class PathCommandGroup:
def __init__(self, cmdlist, menu, tooltip = None):
def __init__(self, cmdlist, menu, tooltip=None):
self.cmdlist = cmdlist
self.menu = menu
if tooltip is None:
@@ -34,7 +35,7 @@ class PathCommandGroup:
return tuple(self.cmdlist)
def GetResources(self):
return { 'MenuText': self.menu, 'ToolTip': self.tooltip }
return {'MenuText': self.menu, 'ToolTip': self.tooltip}
def IsActive(self):
if FreeCAD.ActiveDocument is not None:
@@ -43,6 +44,7 @@ class PathCommandGroup:
return True
return False
class PathWorkbench (Workbench):
"Path workbench"
@@ -88,14 +90,14 @@ class PathWorkbench (Workbench):
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_Contour", "Path_Profile_Faces", "Path_Profile_Edges", "Path_Pocket_Shape", "Path_Drilling", "Path_MillFace", "Path_Helix", "Path_Adaptive" ]
twodopcmdlist = ["Path_Contour", "Path_Profile_Faces", "Path_Profile_Edges", "Path_Pocket_Shape", "Path_Drilling", "Path_MillFace", "Path_Helix", "Path_Adaptive"]
threedopcmdlist = ["Path_Pocket_3D"]
engravecmdlist = ["Path_Engrave", "Path_Deburr"]
modcmdlist = ["Path_OperationCopy", "Path_Array", "Path_SimpleCopy" ]
modcmdlist = ["Path_OperationCopy", "Path_Array", "Path_SimpleCopy"]
dressupcmdlist = ["Path_DressupAxisMap", "Path_DressupPathBoundary", "Path_DressupDogbone", "Path_DressupDragKnife", "Path_DressupLeadInOut", "Path_DressupRampEntry", "Path_DressupTag", "Path_DressupZCorrect"]
extracmdlist = []
#modcmdmore = ["Path_Hop",]
#remotecmdlist = ["Path_Remote"]
# modcmdmore = ["Path_Hop",]
# remotecmdlist = ["Path_Remote"]
engravecmdgroup = ['Path_EngraveTools']
FreeCADGui.addCommand('Path_EngraveTools', PathCommandGroup(engravecmdlist, QtCore.QT_TRANSLATE_NOOP("Path", 'Engraving Operations')))
@@ -107,11 +109,12 @@ class PathWorkbench (Workbench):
extracmdlist.extend(["Path_Area", "Path_Area_Workplane"])
try:
import ocl # pylint: disable=unused-variable
import ocl # pylint: disable=unused-variable
from PathScripts import PathSurfaceGui
threedopcmdlist.append("Path_Surface")
from PathScripts import PathWaterlineGui
threedopcmdlist.extend(["Path_Surface", "Path_Waterline"])
threedcmdgroup = ['Path_3dTools']
FreeCADGui.addCommand('Path_3dTools', PathCommandGroup(threedopcmdlist, QtCore.QT_TRANSLATE_NOOP("Path",'3D Operations')))
FreeCADGui.addCommand('Path_3dTools', PathCommandGroup(threedopcmdlist, QtCore.QT_TRANSLATE_NOOP("Path", '3D Operations')))
except ImportError:
FreeCAD.Console.PrintError("OpenCamLib is not working!\n")
@@ -122,7 +125,9 @@ class PathWorkbench (Workbench):
if extracmdlist:
self.appendToolbar(QtCore.QT_TRANSLATE_NOOP("Path", "Helpful Tools"), extracmdlist)
self.appendMenu([QtCore.QT_TRANSLATE_NOOP("Path", "&Path")], projcmdlist +["Path_ExportTemplate", "Separator"] + toolbitcmdlist + toolcmdlist +["Separator"] + twodopcmdlist + engravecmdlist +["Separator"] +threedopcmdlist +["Separator"])
self.appendMenu([QtCore.QT_TRANSLATE_NOOP("Path", "&Path")], projcmdlist + ["Path_ExportTemplate", "Separator"] +
toolbitcmdlist + toolcmdlist + ["Separator"] + twodopcmdlist + engravecmdlist + ["Separator"] +
threedopcmdlist + ["Separator"])
self.appendMenu([QtCore.QT_TRANSLATE_NOOP("Path", "&Path"), QtCore.QT_TRANSLATE_NOOP(
"Path", "Path Dressup")], dressupcmdlist)
self.appendMenu([QtCore.QT_TRANSLATE_NOOP("Path", "&Path"), QtCore.QT_TRANSLATE_NOOP(
@@ -136,7 +141,7 @@ class PathWorkbench (Workbench):
curveAccuracy = PathPreferences.defaultLibAreaCurveAccuracy()
if curveAccuracy:
Path.Area.setDefaultParams(Accuracy = curveAccuracy)
Path.Area.setDefaultParams(Accuracy=curveAccuracy)
Log('Loading Path workbench... done\n')
@@ -171,8 +176,8 @@ class PathWorkbench (Workbench):
if obj.isDerivedFrom("Path::Feature"):
if "Profile" in selectedName or "Contour" in selectedName or "Dressup" in selectedName:
self.appendContextMenu("", "Separator")
#self.appendContextMenu("", ["Set_StartPoint"])
#self.appendContextMenu("", ["Set_EndPoint"])
# self.appendContextMenu("", ["Set_StartPoint"])
# self.appendContextMenu("", ["Set_EndPoint"])
for cmd in self.dressupcmds:
self.appendContextMenu("", [cmd])
menuAppended = True
@@ -182,10 +187,10 @@ class PathWorkbench (Workbench):
if menuAppended:
self.appendContextMenu("", "Separator")
Gui.addWorkbench(PathWorkbench())
FreeCAD.addImportType(
"GCode (*.nc *.gc *.ncc *.ngc *.cnc *.tap *.gcode)", "PathGui")
# FreeCAD.addExportType(
# "GCode (*.nc *.gc *.ncc *.ngc *.cnc *.tap *.gcode)", "PathGui")

View File

@@ -35,6 +35,7 @@ else:
Processed = False
def Startup():
global Processed # pylint: disable=global-statement
if not Processed:
@@ -71,12 +72,13 @@ def Startup():
from PathScripts import PathSimpleCopy
from PathScripts import PathSimulatorGui
from PathScripts import PathStop
# from PathScripts import PathSurfaceGui # Added in initGui.py due to OCL dependency
from PathScripts import PathToolController
from PathScripts import PathToolControllerGui
from PathScripts import PathToolLibraryManager
from PathScripts import PathToolLibraryEditor
from PathScripts import PathUtilsGui
# from PathScripts import PathWaterlineGui # Added in initGui.py due to OCL dependency
Processed = True
else:
PathLog.debug('Skipping PathGui initialisation')

View File

@@ -30,12 +30,14 @@ import PathScripts.PathUtils as PathUtils
import math
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
#PathLog.trackModule(PathLog.thisModule())
# PathLog.trackModule(PathLog.thisModule())
class PathBaseGate(object):
# pylint: disable=no-init
pass
class EGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
return sub and sub[0:4] == 'Edge'
@@ -66,6 +68,7 @@ class ENGRAVEGate(PathBaseGate):
return False
class CHAMFERGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
try:
@@ -94,7 +97,7 @@ class DRILLGate(PathBaseGate):
if hasattr(obj, "Shape") and sub:
shape = obj.Shape
subobj = shape.getElement(sub)
return PathUtils.isDrillable(shape, subobj, includePartials = True)
return PathUtils.isDrillable(shape, subobj, includePartials=True)
else:
return False
@@ -159,6 +162,7 @@ class POCKETGate(PathBaseGate):
return pocketable
class ADAPTIVEGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
@@ -170,6 +174,7 @@ class ADAPTIVEGate(PathBaseGate):
return adaptive
class CONTOURGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
pass
@@ -182,34 +187,42 @@ def contourselect():
FreeCADGui.Selection.addSelectionGate(CONTOURGate())
FreeCAD.Console.PrintWarning("Contour Select Mode\n")
def eselect():
FreeCADGui.Selection.addSelectionGate(EGate())
FreeCAD.Console.PrintWarning("Edge Select Mode\n")
def drillselect():
FreeCADGui.Selection.addSelectionGate(DRILLGate())
FreeCAD.Console.PrintWarning("Drilling Select Mode\n")
def engraveselect():
FreeCADGui.Selection.addSelectionGate(ENGRAVEGate())
FreeCAD.Console.PrintWarning("Engraving Select Mode\n")
def chamferselect():
FreeCADGui.Selection.addSelectionGate(CHAMFERGate())
FreeCAD.Console.PrintWarning("Deburr Select Mode\n")
def profileselect():
FreeCADGui.Selection.addSelectionGate(PROFILEGate())
FreeCAD.Console.PrintWarning("Profiling Select Mode\n")
def pocketselect():
FreeCADGui.Selection.addSelectionGate(POCKETGate())
FreeCAD.Console.PrintWarning("Pocketing Select Mode\n")
def adaptiveselect():
FreeCADGui.Selection.addSelectionGate(ADAPTIVEGate())
FreeCAD.Console.PrintWarning("Adaptive Select Mode\n")
def surfaceselect():
if(MESHGate() is True or PROFILEGate() is True):
FreeCADGui.Selection.addSelectionGate(True)
@@ -237,10 +250,12 @@ def select(op):
opsel['Profile Edges'] = eselect
opsel['Profile Faces'] = profileselect
opsel['Surface'] = surfaceselect
opsel['Waterline'] = surfaceselect
opsel['Adaptive'] = adaptiveselect
opsel['Probe'] = probeselect
return opsel[op]
def clear():
FreeCADGui.Selection.removeSelectionGate()
FreeCAD.Console.PrintWarning("Free Select\n")

File diff suppressed because it is too large Load Diff

View File

@@ -39,89 +39,120 @@ __doc__ = "Surface operation page controller and command implementation."
class TaskPanelOpPage(PathOpGui.TaskPanelPage):
'''Page controller class for the Surface operation.'''
def initPage(self, obj):
self.setTitle("3D Surface")
self.updateVisibility()
def getForm(self):
'''getForm() ... returns UI'''
return FreeCADGui.PySideUic.loadUi(":/panels/PageOpSurfaceEdit.ui")
def getFields(self, obj):
'''getFields(obj) ... transfers values from UI to obj's proprties'''
self.updateToolController(obj, self.form.toolController)
self.updateCoolant(obj, self.form.coolantController)
PathGui.updateInputField(obj, 'DepthOffset', self.form.depthOffset)
PathGui.updateInputField(obj, 'SampleInterval', self.form.sampleInterval)
if obj.StepOver != self.form.stepOver.value():
obj.StepOver = self.form.stepOver.value()
if obj.Algorithm != str(self.form.algorithmSelect.currentText()):
obj.Algorithm = str(self.form.algorithmSelect.currentText())
if obj.BoundBox != str(self.form.boundBoxSelect.currentText()):
obj.BoundBox = str(self.form.boundBoxSelect.currentText())
if obj.DropCutterDir != str(self.form.dropCutterDirSelect.currentText()):
obj.DropCutterDir = str(self.form.dropCutterDirSelect.currentText())
if obj.ScanType != str(self.form.scanType.currentText()):
obj.ScanType = str(self.form.scanType.currentText())
if obj.StepOver != self.form.stepOver.value():
obj.StepOver = self.form.stepOver.value()
if obj.LayerMode != str(self.form.layerMode.currentText()):
obj.LayerMode = str(self.form.layerMode.currentText())
if obj.CutPattern != str(self.form.cutPattern.currentText()):
obj.CutPattern = str(self.form.cutPattern.currentText())
obj.DropCutterExtraOffset.x = FreeCAD.Units.Quantity(self.form.boundBoxExtraOffsetX.text()).Value
obj.DropCutterExtraOffset.y = FreeCAD.Units.Quantity(self.form.boundBoxExtraOffsetY.text()).Value
if obj.DropCutterDir != str(self.form.dropCutterDirSelect.currentText()):
obj.DropCutterDir = str(self.form.dropCutterDirSelect.currentText())
PathGui.updateInputField(obj, 'DepthOffset', self.form.depthOffset)
PathGui.updateInputField(obj, 'SampleInterval', self.form.sampleInterval)
if obj.UseStartPoint != self.form.useStartPoint.isChecked():
obj.UseStartPoint = self.form.useStartPoint.isChecked()
if obj.OptimizeLinearPaths != self.form.optimizeEnabled.isChecked():
obj.OptimizeLinearPaths = self.form.optimizeEnabled.isChecked()
self.updateToolController(obj, self.form.toolController)
self.updateCoolant(obj, self.form.coolantController)
if obj.OptimizeStepOverTransitions != self.form.optimizeStepOverTransitions.isChecked():
obj.OptimizeStepOverTransitions = self.form.optimizeStepOverTransitions.isChecked()
def setFields(self, obj):
'''setFields(obj) ... transfers obj's property values to UI'''
self.selectInComboBox(obj.Algorithm, self.form.algorithmSelect)
self.setupToolController(obj, self.form.toolController)
self.setupCoolant(obj, self.form.coolantController)
self.selectInComboBox(obj.BoundBox, self.form.boundBoxSelect)
self.selectInComboBox(obj.ScanType, self.form.scanType)
self.selectInComboBox(obj.LayerMode, self.form.layerMode)
self.selectInComboBox(obj.CutPattern, self.form.cutPattern)
self.form.boundBoxExtraOffsetX.setText(FreeCAD.Units.Quantity(obj.DropCutterExtraOffset.x, FreeCAD.Units.Length).UserString)
self.form.boundBoxExtraOffsetY.setText(FreeCAD.Units.Quantity(obj.DropCutterExtraOffset.y, FreeCAD.Units.Length).UserString)
self.selectInComboBox(obj.DropCutterDir, self.form.dropCutterDirSelect)
self.form.boundBoxExtraOffsetX.setText(str(obj.DropCutterExtraOffset.x))
self.form.boundBoxExtraOffsetY.setText(str(obj.DropCutterExtraOffset.y))
self.form.depthOffset.setText(FreeCAD.Units.Quantity(obj.DepthOffset.Value, FreeCAD.Units.Length).UserString)
self.form.sampleInterval.setText(str(obj.SampleInterval))
self.form.stepOver.setValue(obj.StepOver)
self.form.sampleInterval.setText(FreeCAD.Units.Quantity(obj.SampleInterval.Value, FreeCAD.Units.Length).UserString)
if obj.UseStartPoint:
self.form.useStartPoint.setCheckState(QtCore.Qt.Checked)
else:
self.form.useStartPoint.setCheckState(QtCore.Qt.Unchecked)
if obj.OptimizeLinearPaths:
self.form.optimizeEnabled.setCheckState(QtCore.Qt.Checked)
else:
self.form.optimizeEnabled.setCheckState(QtCore.Qt.Unchecked)
self.setupToolController(obj, self.form.toolController)
self.setupCoolant(obj, self.form.coolantController)
if obj.OptimizeStepOverTransitions:
self.form.optimizeStepOverTransitions.setCheckState(QtCore.Qt.Checked)
else:
self.form.optimizeStepOverTransitions.setCheckState(QtCore.Qt.Unchecked)
def getSignalsForUpdate(self, obj):
'''getSignalsForUpdate(obj) ... return list of signals for updating obj'''
signals = []
signals.append(self.form.toolController.currentIndexChanged)
signals.append(self.form.algorithmSelect.currentIndexChanged)
signals.append(self.form.coolantController.currentIndexChanged)
signals.append(self.form.boundBoxSelect.currentIndexChanged)
signals.append(self.form.dropCutterDirSelect.currentIndexChanged)
signals.append(self.form.scanType.currentIndexChanged)
signals.append(self.form.layerMode.currentIndexChanged)
signals.append(self.form.cutPattern.currentIndexChanged)
signals.append(self.form.boundBoxExtraOffsetX.editingFinished)
signals.append(self.form.boundBoxExtraOffsetY.editingFinished)
signals.append(self.form.sampleInterval.editingFinished)
signals.append(self.form.stepOver.editingFinished)
signals.append(self.form.dropCutterDirSelect.currentIndexChanged)
signals.append(self.form.depthOffset.editingFinished)
signals.append(self.form.stepOver.editingFinished)
signals.append(self.form.sampleInterval.editingFinished)
signals.append(self.form.useStartPoint.stateChanged)
signals.append(self.form.optimizeEnabled.stateChanged)
signals.append(self.form.coolantController.currentIndexChanged)
signals.append(self.form.optimizeStepOverTransitions.stateChanged)
return signals
def updateVisibility(self):
if self.form.algorithmSelect.currentText() == "OCL Dropcutter":
self.form.boundBoxExtraOffsetX.setEnabled(True)
self.form.boundBoxExtraOffsetY.setEnabled(True)
self.form.boundBoxSelect.setEnabled(True)
self.form.dropCutterDirSelect.setEnabled(True)
self.form.stepOver.setEnabled(True)
else:
if self.form.scanType.currentText() == "Planar":
self.form.cutPattern.setEnabled(True)
self.form.boundBoxExtraOffsetX.setEnabled(False)
self.form.boundBoxExtraOffsetY.setEnabled(False)
self.form.boundBoxSelect.setEnabled(False)
self.form.dropCutterDirSelect.setEnabled(False)
self.form.stepOver.setEnabled(False)
else:
self.form.cutPattern.setEnabled(False)
self.form.boundBoxExtraOffsetX.setEnabled(True)
self.form.boundBoxExtraOffsetY.setEnabled(True)
self.form.dropCutterDirSelect.setEnabled(True)
def registerSignalHandlers(self, obj):
self.form.algorithmSelect.currentIndexChanged.connect(self.updateVisibility)
self.form.scanType.currentIndexChanged.connect(self.updateVisibility)
Command = PathOpGui.SetupOperation('Surface',

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,138 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2020 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.PathWaterline as PathWaterline
import PathScripts.PathGui as PathGui
import PathScripts.PathOpGui as PathOpGui
from PySide import QtCore
__title__ = "Path Waterline Operation UI"
__author__ = "sliptonic (Brad Collette), russ4262 (Russell Johnson)"
__url__ = "http://www.freecadweb.org"
__doc__ = "Waterline operation page controller and command implementation."
class TaskPanelOpPage(PathOpGui.TaskPanelPage):
'''Page controller class for the Waterline operation.'''
def initPage(self, obj):
# self.setTitle("Waterline")
self.updateVisibility()
def getForm(self):
'''getForm() ... returns UI'''
return FreeCADGui.PySideUic.loadUi(":/panels/PageOpWaterlineEdit.ui")
def getFields(self, obj):
'''getFields(obj) ... transfers values from UI to obj's proprties'''
self.updateToolController(obj, self.form.toolController)
if obj.Algorithm != str(self.form.algorithmSelect.currentText()):
obj.Algorithm = str(self.form.algorithmSelect.currentText())
if obj.BoundBox != str(self.form.boundBoxSelect.currentText()):
obj.BoundBox = str(self.form.boundBoxSelect.currentText())
if obj.LayerMode != str(self.form.layerMode.currentText()):
obj.LayerMode = str(self.form.layerMode.currentText())
if obj.CutPattern != str(self.form.cutPattern.currentText()):
obj.CutPattern = str(self.form.cutPattern.currentText())
PathGui.updateInputField(obj, 'BoundaryAdjustment', self.form.boundaryAdjustment)
if obj.StepOver != self.form.stepOver.value():
obj.StepOver = self.form.stepOver.value()
PathGui.updateInputField(obj, 'SampleInterval', self.form.sampleInterval)
if obj.OptimizeLinearPaths != self.form.optimizeEnabled.isChecked():
obj.OptimizeLinearPaths = self.form.optimizeEnabled.isChecked()
def setFields(self, obj):
'''setFields(obj) ... transfers obj's property values to UI'''
self.setupToolController(obj, self.form.toolController)
self.selectInComboBox(obj.Algorithm, self.form.algorithmSelect)
self.selectInComboBox(obj.BoundBox, self.form.boundBoxSelect)
self.selectInComboBox(obj.LayerMode, self.form.layerMode)
self.selectInComboBox(obj.CutPattern, self.form.cutPattern)
self.form.boundaryAdjustment.setText(FreeCAD.Units.Quantity(obj.BoundaryAdjustment.Value, FreeCAD.Units.Length).UserString)
self.form.stepOver.setValue(obj.StepOver)
self.form.sampleInterval.setText(FreeCAD.Units.Quantity(obj.SampleInterval.Value, FreeCAD.Units.Length).UserString)
if obj.OptimizeLinearPaths:
self.form.optimizeEnabled.setCheckState(QtCore.Qt.Checked)
else:
self.form.optimizeEnabled.setCheckState(QtCore.Qt.Unchecked)
def getSignalsForUpdate(self, obj):
'''getSignalsForUpdate(obj) ... return list of signals for updating obj'''
signals = []
signals.append(self.form.toolController.currentIndexChanged)
signals.append(self.form.algorithmSelect.currentIndexChanged)
signals.append(self.form.boundBoxSelect.currentIndexChanged)
signals.append(self.form.layerMode.currentIndexChanged)
signals.append(self.form.cutPattern.currentIndexChanged)
signals.append(self.form.boundaryAdjustment.editingFinished)
signals.append(self.form.stepOver.editingFinished)
signals.append(self.form.sampleInterval.editingFinished)
signals.append(self.form.optimizeEnabled.stateChanged)
return signals
def updateVisibility(self):
if self.form.algorithmSelect.currentText() == 'OCL Dropcutter':
self.form.cutPattern.setEnabled(False)
self.form.boundaryAdjustment.setEnabled(False)
self.form.stepOver.setEnabled(False)
self.form.sampleInterval.setEnabled(True)
self.form.optimizeEnabled.setEnabled(True)
else:
self.form.cutPattern.setEnabled(True)
self.form.boundaryAdjustment.setEnabled(True)
if self.form.cutPattern.currentText() == 'None':
self.form.stepOver.setEnabled(False)
else:
self.form.stepOver.setEnabled(True)
self.form.sampleInterval.setEnabled(False)
self.form.optimizeEnabled.setEnabled(False)
def registerSignalHandlers(self, obj):
self.form.algorithmSelect.currentIndexChanged.connect(self.updateVisibility)
self.form.cutPattern.currentIndexChanged.connect(self.updateVisibility)
Command = PathOpGui.SetupOperation('Waterline',
PathWaterline.Create,
TaskPanelOpPage,
'Path-Waterline',
QtCore.QT_TRANSLATE_NOOP("Waterline", "Waterline"),
QtCore.QT_TRANSLATE_NOOP("Waterline", "Create a Waterline Operation from a model"),
PathWaterline.SetupProperties)
FreeCAD.Console.PrintLog("Loading PathWaterlineGui... done\n")