diff --git a/src/Mod/Path/Gui/Resources/Path.qrc b/src/Mod/Path/Gui/Resources/Path.qrc
index 98b0f03bbd..a9889ef325 100644
--- a/src/Mod/Path/Gui/Resources/Path.qrc
+++ b/src/Mod/Path/Gui/Resources/Path.qrc
@@ -60,6 +60,16 @@
icons/Path-BPlay.svg
icons/Path-BStep.svg
icons/Path-BStop.svg
+ icons/arrow-ccw.svg
+ icons/arrow-cw.svg
+ icons/arrow-down.svg
+ icons/arrow-left.svg
+ icons/arrow-left-down.svg
+ icons/arrow-left-up.svg
+ icons/arrow-right.svg
+ icons/arrow-right-down.svg
+ icons/arrow-right-up.svg
+ icons/arrow-up.svg
icons/edge-join-miter.svg
icons/edge-join-miter-not.svg
icons/edge-join-round.svg
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-ccw.svg b/src/Mod/Path/Gui/Resources/icons/arrow-ccw.svg
new file mode 100644
index 0000000000..c5ca60bd53
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-ccw.svg
@@ -0,0 +1,70 @@
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-cw.svg b/src/Mod/Path/Gui/Resources/icons/arrow-cw.svg
new file mode 100644
index 0000000000..e2f4aae1a8
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-cw.svg
@@ -0,0 +1,172 @@
+
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-down.svg b/src/Mod/Path/Gui/Resources/icons/arrow-down.svg
new file mode 100644
index 0000000000..c69ad2c53b
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-down.svg
@@ -0,0 +1,311 @@
+
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-left-down.svg b/src/Mod/Path/Gui/Resources/icons/arrow-left-down.svg
new file mode 100644
index 0000000000..3bac94b4b0
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-left-down.svg
@@ -0,0 +1,311 @@
+
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-left-up.svg b/src/Mod/Path/Gui/Resources/icons/arrow-left-up.svg
new file mode 100644
index 0000000000..5187ef1f42
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-left-up.svg
@@ -0,0 +1,311 @@
+
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-left.svg b/src/Mod/Path/Gui/Resources/icons/arrow-left.svg
new file mode 100644
index 0000000000..9bc5365634
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-left.svg
@@ -0,0 +1,311 @@
+
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-right-down.svg b/src/Mod/Path/Gui/Resources/icons/arrow-right-down.svg
new file mode 100644
index 0000000000..417523ad2c
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-right-down.svg
@@ -0,0 +1,311 @@
+
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-right-up.svg b/src/Mod/Path/Gui/Resources/icons/arrow-right-up.svg
new file mode 100644
index 0000000000..0d02844c35
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-right-up.svg
@@ -0,0 +1,311 @@
+
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-right.svg b/src/Mod/Path/Gui/Resources/icons/arrow-right.svg
new file mode 100644
index 0000000000..7b25dbfe60
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-right.svg
@@ -0,0 +1,311 @@
+
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/icons/arrow-up.svg b/src/Mod/Path/Gui/Resources/icons/arrow-up.svg
new file mode 100644
index 0000000000..a5a3b0dd58
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/icons/arrow-up.svg
@@ -0,0 +1,311 @@
+
+
+
+
diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py
index 96a5940a50..3d258222ad 100644
--- a/src/Mod/Path/PathScripts/PathJobGui.py
+++ b/src/Mod/Path/PathScripts/PathJobGui.py
@@ -773,7 +773,7 @@ class TaskPanel:
self.template.updateUI()
- def orientSelected(self, axis):
+ def modelSetAxis(self, axis):
def flipSel(sel):
PathLog.debug("flip")
p = sel.Object.Placement
@@ -823,6 +823,29 @@ class TaskPanel:
FreeCADGui.Selection.clearSelection()
FreeCADGui.Selection.addSelection(selObject, selFeature)
+ def modelSet0(self, axis):
+ for sel in FreeCADGui.Selection.getSelectionEx():
+ model = sel.Object
+ for name in sel.SubElementNames:
+ feature = model.Shape.getElement(name)
+ bb = feature.BoundBox
+ offset = FreeCAD.Vector(axis.x * bb.XMax, axis.y * bb.YMax, axis.z * bb.ZMax)
+ PathLog.track(feature.BoundBox.ZMax, offset)
+ p = model.Placement
+ p.move(offset)
+ model.Placement = p
+
+ def modelMove(self, axis):
+ scale = self.form.modelMoveValue.value()
+ for sel in FreeCADGui.Selection.getSelectionEx():
+ offset = axis * scale
+ Draft.move(sel.Object, offset)
+
+ def modelRotate(self, axis):
+ angle = self.form.modelRotateValue.value()
+ for sel in FreeCADGui.Selection.getSelectionEx():
+ Draft.rotate(sel.Object, angle, sel.Object.Shape.BoundBox.Center, axis)
+
def alignSetOrigin(self):
(obj, by) = self.alignMoveToOrigin()
@@ -928,15 +951,21 @@ class TaskPanel:
PathLog.track(len(sel))
if len(sel) == 1 and len(sel[0].SubObjects) == 1:
if 'Vertex' == sel[0].SubObjects[0].ShapeType:
- self.form.orientGroup.setEnabled(False)
+ self.form.modelSetXAxis.setEnabled(False)
+ self.form.modelSetYAxis.setEnabled(False)
+ self.form.modelSetZAxis.setEnabled(False)
self.form.setOrigin.setEnabled(True)
self.form.moveToOrigin.setEnabled(True)
else:
- self.form.orientGroup.setEnabled(True)
+ self.form.modelSetXAxis.setEnabled(True)
+ self.form.modelSetYAxis.setEnabled(True)
+ self.form.modelSetZAxis.setEnabled(True)
self.form.setOrigin.setEnabled(False)
self.form.moveToOrigin.setEnabled(False)
else:
- self.form.orientGroup.setEnabled(False)
+ self.form.modelSetXAxis.setEnabled(False)
+ self.form.modelSetYAxis.setEnabled(False)
+ self.form.modelSetZAxis.setEnabled(False)
self.form.setOrigin.setEnabled(False)
self.form.moveToOrigin.setEnabled(False)
@@ -947,6 +976,19 @@ class TaskPanel:
self.form.centerInStock.setEnabled(True)
self.form.centerInStockXY.setEnabled(True)
+ if len(sel) > 0:
+ self.form.modelSetX0.setEnabled(True)
+ self.form.modelSetY0.setEnabled(True)
+ self.form.modelSetZ0.setEnabled(True)
+ self.form.modelMoveGroup.setEnabled(True)
+ self.form.modelRotateGroup.setEnabled(True)
+ else:
+ self.form.modelSetX0.setEnabled(False)
+ self.form.modelSetY0.setEnabled(False)
+ self.form.modelSetZ0.setEnabled(False)
+ self.form.modelMoveGroup.setEnabled(False)
+ self.form.modelRotateGroup.setEnabled(False)
+
def jobModelEdit(self):
dialog = PathJobDlg.JobCreate()
dialog.setupTitle(translate("Path_Job", "Model Selection"))
@@ -1024,12 +1066,30 @@ class TaskPanel:
self.form.stock.currentIndexChanged.connect(self.updateStockEditor)
self.form.refreshStock.clicked.connect(self.refreshStock)
- self.form.orientXAxis.clicked.connect(lambda: self.orientSelected(FreeCAD.Vector(1, 0, 0)))
- self.form.orientYAxis.clicked.connect(lambda: self.orientSelected(FreeCAD.Vector(0, 1, 0)))
- self.form.orientZAxis.clicked.connect(lambda: self.orientSelected(FreeCAD.Vector(0, 0, 1)))
+ self.form.modelSetXAxis.clicked.connect(lambda: self.modelSetAxis(FreeCAD.Vector(1, 0, 0)))
+ self.form.modelSetYAxis.clicked.connect(lambda: self.modelSetAxis(FreeCAD.Vector(0, 1, 0)))
+ self.form.modelSetZAxis.clicked.connect(lambda: self.modelSetAxis(FreeCAD.Vector(0, 0, 1)))
+ self.form.modelSetX0.clicked.connect(lambda: self.modelSet0(FreeCAD.Vector(-1, 0, 0)))
+ self.form.modelSetY0.clicked.connect(lambda: self.modelSet0(FreeCAD.Vector( 0, -1, 0)))
+ self.form.modelSetZ0.clicked.connect(lambda: self.modelSet0(FreeCAD.Vector( 0, 0, -1)))
self.form.setOrigin.clicked.connect(self.alignSetOrigin)
self.form.moveToOrigin.clicked.connect(self.alignMoveToOrigin)
+
+ self.form.modelMoveLeftUp.clicked.connect( lambda: self.modelMove(FreeCAD.Vector(-1, 1, 0)))
+ self.form.modelMoveLeft.clicked.connect( lambda: self.modelMove(FreeCAD.Vector(-1, 0, 0)))
+ self.form.modelMoveLeftDown.clicked.connect( lambda: self.modelMove(FreeCAD.Vector(-1, -1, 0)))
+
+ self.form.modelMoveUp.clicked.connect( lambda: self.modelMove(FreeCAD.Vector( 0, 1, 0)))
+ self.form.modelMoveDown.clicked.connect( lambda: self.modelMove(FreeCAD.Vector( 0, -1, 0)))
+
+ self.form.modelMoveRightUp.clicked.connect( lambda: self.modelMove(FreeCAD.Vector( 1, 1, 0)))
+ self.form.modelMoveRight.clicked.connect( lambda: self.modelMove(FreeCAD.Vector( 1, 0, 0)))
+ self.form.modelMoveRightDown.clicked.connect( lambda: self.modelMove(FreeCAD.Vector( 1, -1, 0)))
+
+ self.form.modelRotateLeft.clicked.connect( lambda: self.modelRotate(FreeCAD.Vector(0, 0, 1)))
+ self.form.modelRotateRight.clicked.connect( lambda: self.modelRotate(FreeCAD.Vector(0, 0, -1)))
+
self.updateSelection()
# set active page
diff --git a/src/Mod/Path/PathScripts/PathStock.py b/src/Mod/Path/PathScripts/PathStock.py
index 8e3c84f9cf..fac9f65b1f 100644
--- a/src/Mod/Path/PathScripts/PathStock.py
+++ b/src/Mod/Path/PathScripts/PathStock.py
@@ -122,7 +122,7 @@ class StockFromBase(Stock):
return None
def execute(self, obj):
- bb = shapeBoundBox(obj.Base.Group)
+ bb = shapeBoundBox(obj.Base.Group) if obj.Base else None
PathLog.track(obj.Label, bb)
# Sometimes, when the Base changes it's temporarily not assigned when