Path: Change Profile 'side' enumeration to inside/outside
left/right was too ambiguous correct profile direction set
This commit is contained in:
committed by
Yorik van Havre
parent
48337e03c1
commit
ddb2001dcb
@@ -294,12 +294,12 @@
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Left</string>
|
||||
<string>Outside</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Right</string>
|
||||
<string>Inside</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<height>381</height>
|
||||
<width>285</width>
|
||||
<height>277</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="icon">
|
||||
@@ -111,8 +111,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<height>381</height>
|
||||
<width>120</width>
|
||||
<height>96</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="icon">
|
||||
@@ -178,8 +178,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<height>381</height>
|
||||
<width>154</width>
|
||||
<height>68</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="icon">
|
||||
@@ -288,17 +288,12 @@
|
||||
<widget class="QComboBox" name="cutSide">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Left</string>
|
||||
<string>Outside</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>On</string>
|
||||
<string>Inside</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
|
||||
from . import PathUtils
|
||||
from .PathUtils import fmt
|
||||
|
||||
import Part
|
||||
import FreeCAD
|
||||
import Path
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
from PySide import QtCore, QtGui
|
||||
from DraftTools import translate
|
||||
#from DraftTools import translate
|
||||
|
||||
"""Helix Drill object and FreeCAD command"""
|
||||
|
||||
@@ -86,7 +86,7 @@ def helix_cut(center, r_out, r_in, dr, zmax, zmin, dz, safe_z, tool_diameter, vf
|
||||
tool_diameter: float
|
||||
Width of tool
|
||||
"""
|
||||
from numpy import ceil, allclose, linspace
|
||||
from numpy import ceil, linspace
|
||||
|
||||
if (zmax <= zmin):
|
||||
return
|
||||
@@ -134,7 +134,7 @@ def helix_cut(center, r_out, r_in, dr, zmax, zmin, dz, safe_z, tool_diameter, vf
|
||||
out += rapid(x=x0+r, y=y0)
|
||||
out += rapid(z=zmax + tool_diameter)
|
||||
out += feed(z=zmax, f=vfeed)
|
||||
z = zmin
|
||||
# z = zmin
|
||||
for i in range(1, nz+1):
|
||||
out += arc(x0-r, y0, i=-r, j=0.0, z=zi[2*i-1], f=hfeed)
|
||||
out += arc(x0+r, y0, i= r, j=0.0, z=zi[2*i], f=hfeed)
|
||||
@@ -286,9 +286,9 @@ class ObjectPathHelix(object):
|
||||
return None
|
||||
|
||||
def execute(self, obj):
|
||||
from Part import Circle, Cylinder, Plane
|
||||
from PathScripts import PathUtils
|
||||
from math import sqrt
|
||||
# from Part import Circle, Cylinder, Plane
|
||||
# from PathScripts import PathUtils
|
||||
# from math import sqrt
|
||||
|
||||
output = '(helix cut operation'
|
||||
if obj.Comment:
|
||||
@@ -332,7 +332,7 @@ class ObjectPathHelix(object):
|
||||
# Find other edge of current cylinder
|
||||
other_edge = None
|
||||
for edge in cylinder.Edges:
|
||||
if isinstance(edge.Curve, Circle) and edge.Curve.Center.z != cur_z:
|
||||
if isinstance(edge.Curve, Part.Circle) and edge.Curve.Center.z != cur_z:
|
||||
other_edge = edge
|
||||
break
|
||||
|
||||
@@ -408,8 +408,8 @@ class ObjectPathHelix(object):
|
||||
output += '\n'
|
||||
|
||||
obj.Path = Path.Path(output)
|
||||
if obj.ViewObject:
|
||||
obj.ViewObject.Visibility = True
|
||||
# if obj.ViewObject:
|
||||
# obj.ViewObject.Visibility = True
|
||||
|
||||
|
||||
class ViewProviderPathHelix(object):
|
||||
@@ -451,7 +451,7 @@ class CommandPathHelix(object):
|
||||
|
||||
def Activated(self):
|
||||
import FreeCADGui
|
||||
import Path
|
||||
# import Path
|
||||
from PathScripts import PathUtils
|
||||
|
||||
FreeCAD.ActiveDocument.openTransaction(translate("PathHelix", "Create a helix cut"))
|
||||
@@ -526,7 +526,7 @@ def print_all_exceptions(cls):
|
||||
class TaskPanel(object):
|
||||
|
||||
def __init__(self, obj):
|
||||
from Units import Quantity
|
||||
#from Units import Quantity
|
||||
from PathScripts import PathUtils
|
||||
|
||||
self.obj = obj
|
||||
@@ -867,5 +867,5 @@ class TaskPanel(object):
|
||||
FreeCADGui.Control.closeDialog()
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
# import FreeCADGui
|
||||
FreeCADGui.addCommand('Path_Helix', CommandPathHelix())
|
||||
|
||||
@@ -77,7 +77,7 @@ class ObjectProfile:
|
||||
|
||||
# Profile Properties
|
||||
obj.addProperty("App::PropertyEnumeration", "Side", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Side of edge that tool should cut"))
|
||||
obj.Side = ['Left', 'Right'] # side of profile that cutter is on in relation to direction of profile
|
||||
obj.Side = ['Inside', 'Outside'] # side of profile that cutter is on in relation to direction of profile
|
||||
obj.addProperty("App::PropertyEnumeration", "Direction", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "The direction that the toolpath should go around the part ClockWise CW or CounterClockWise CCW"))
|
||||
obj.Direction = ['CW', 'CCW'] # this is the direction that the profile runs
|
||||
obj.addProperty("App::PropertyBool", "UseComp", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "make True, if using Cutter Radius Compensation"))
|
||||
@@ -148,9 +148,9 @@ class ObjectProfile:
|
||||
obj.SafeHeight = 8.0
|
||||
|
||||
if bb.XLength == fbb.XLength and bb.YLength == fbb.YLength:
|
||||
obj.Side = "Left"
|
||||
obj.Side = "Outside"
|
||||
else:
|
||||
obj.Side = "Right"
|
||||
obj.Side = "Inside"
|
||||
|
||||
item = (ss, sub)
|
||||
if item in baselist:
|
||||
@@ -176,7 +176,7 @@ class ObjectProfile:
|
||||
if obj.UseComp:
|
||||
offsetval = self.radius+obj.OffsetExtra.Value
|
||||
|
||||
if obj.Side == 'Right':
|
||||
if obj.Side == 'Inside':
|
||||
offsetval = 0 - offsetval
|
||||
|
||||
if isHole:
|
||||
@@ -215,9 +215,9 @@ class ObjectProfile:
|
||||
direction = obj.Direction
|
||||
|
||||
if direction == 'CCW':
|
||||
params['orientation'] = 1
|
||||
else:
|
||||
params['orientation'] = 0
|
||||
else:
|
||||
params['orientation'] = 1
|
||||
|
||||
if obj.UseStartPoint is True and obj.StartPoint is not None:
|
||||
params['start'] = obj.StartPoint
|
||||
@@ -444,7 +444,7 @@ class CommandPathProfile:
|
||||
FreeCADGui.doCommand('obj.FinalDepth=' + str(zbottom))
|
||||
|
||||
FreeCADGui.doCommand('obj.SafeHeight = ' + str(ztop + 2.0))
|
||||
FreeCADGui.doCommand('obj.Side = "Left"')
|
||||
FreeCADGui.doCommand('obj.Side = "Outside"')
|
||||
FreeCADGui.doCommand('obj.OffsetExtra = 0.0')
|
||||
FreeCADGui.doCommand('obj.Direction = "CW"')
|
||||
FreeCADGui.doCommand('obj.UseComp = True')
|
||||
|
||||
@@ -82,7 +82,7 @@ class ObjectProfile:
|
||||
|
||||
# Profile Properties
|
||||
obj.addProperty("App::PropertyEnumeration", "Side", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Side of edge that tool should cut"))
|
||||
obj.Side = ['Left', 'Right'] # side of profile that cutter is on in relation to direction of profile
|
||||
obj.Side = ['Outside', 'Inside'] # side of profile that cutter is on in relation to direction of profile
|
||||
obj.addProperty("App::PropertyEnumeration", "Direction", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "The direction that the toolpath should go around the part ClockWise CW or CounterClockWise CCW"))
|
||||
obj.Direction = ['CW', 'CCW'] # this is the direction that the profile runs
|
||||
obj.addProperty("App::PropertyBool", "UseComp", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "make True, if using Cutter Radius Compensation"))
|
||||
@@ -163,7 +163,7 @@ class ObjectProfile:
|
||||
'SectionCount': -1}
|
||||
|
||||
if obj.UseComp:
|
||||
if obj.Side == 'Right':
|
||||
if obj.Side == 'Inside':
|
||||
profileparams['Offset'] = 0 - self.radius+obj.OffsetExtra.Value
|
||||
else:
|
||||
profileparams['Offset'] = self.radius+obj.OffsetExtra.Value
|
||||
@@ -392,7 +392,7 @@ class CommandPathProfileEdges:
|
||||
FreeCADGui.doCommand('obj.FinalDepth=' + str(zbottom))
|
||||
|
||||
FreeCADGui.doCommand('obj.SafeHeight = ' + str(ztop + 2.0))
|
||||
FreeCADGui.doCommand('obj.Side = "Right"')
|
||||
FreeCADGui.doCommand('obj.Side = "Inside"')
|
||||
FreeCADGui.doCommand('obj.OffsetExtra = 0.0')
|
||||
FreeCADGui.doCommand('obj.Direction = "CW"')
|
||||
FreeCADGui.doCommand('obj.UseComp = True')
|
||||
|
||||
Reference in New Issue
Block a user