add a material allowance property
This commit is contained in:
@@ -14,6 +14,19 @@
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="3" column="0">
|
||||
<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>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
@@ -81,14 +94,14 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Direction</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="direction">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The direction for the helix, clockwise or counter clockwise.</p></body></html></string>
|
||||
@@ -105,14 +118,14 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Step over percent</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="stepOverPercent">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Specify the percent of the tool diameter each helix will be offset to the previous one.</p><p><br/></p><p>A step over of 100% means no overlap of the individual cuts.</p></body></html></string>
|
||||
@@ -131,24 +144,32 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Extra Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="Gui::InputField" name="extraOffset">
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<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>QLineEdit</extends>
|
||||
<header>Gui/InputField.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -134,6 +134,15 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp):
|
||||
"Helix Drill",
|
||||
QT_TRANSLATE_NOOP("App::Property", "Starting Radius"),
|
||||
)
|
||||
obj.addProperty(
|
||||
"App::PropertyDistance",
|
||||
"OffsetExtra",
|
||||
"Helix Drill",
|
||||
QT_TRANSLATE_NOOP(
|
||||
"App::Property",
|
||||
"Extra value to stay away from final profile- good for roughing toolpath",
|
||||
),
|
||||
)
|
||||
|
||||
ENUMS = self.helixOpPropertyEnumerations()
|
||||
for n in ENUMS:
|
||||
@@ -148,6 +157,16 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp):
|
||||
QT_TRANSLATE_NOOP("App::Property", "Starting Radius"),
|
||||
)
|
||||
|
||||
if not hasattr(obj, "OffsetExtra"):
|
||||
obj.addProperty(
|
||||
"App::PropertyDistance",
|
||||
"OffsetExtra",
|
||||
"Helix Drill",
|
||||
QT_TRANSLATE_NOOP(
|
||||
"App::Property",
|
||||
"Extra value to stay away from final profile- good for roughing toolpath",
|
||||
),
|
||||
)
|
||||
def circularHoleExecute(self, obj, holes):
|
||||
"""circularHoleExecute(obj, holes) ... generate helix commands for each hole in holes"""
|
||||
PathLog.track()
|
||||
@@ -177,13 +196,13 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp):
|
||||
"step_down": obj.StepDown.Value,
|
||||
"step_over": obj.StepOver / 100,
|
||||
"tool_diameter": tooldiamter,
|
||||
"inner_radius": obj.StartRadius.Value,
|
||||
"inner_radius": obj.StartRadius.Value + obj.OffsetExtra.Value,
|
||||
"direction": obj.Direction,
|
||||
"startAt": obj.StartSide,
|
||||
}
|
||||
|
||||
for hole in holes:
|
||||
args["hole_radius"] = hole["r"] / 2
|
||||
args["hole_radius"] = (hole["r"] / 2) - (obj.OffsetExtra.Value)
|
||||
startPoint = FreeCAD.Vector(hole["x"], hole["y"], obj.StartDepth.Value)
|
||||
endPoint = FreeCAD.Vector(hole["x"], hole["y"], obj.FinalDepth.Value)
|
||||
args["edge"] = Part.makeLine(startPoint, endPoint)
|
||||
|
||||
Reference in New Issue
Block a user