Commit e252cdc5 authored by sumpfralle's avatar sumpfralle

r683@erker: lars | 2010-02-18 03:25:00 +0100

 calculate dynamic step based on "overlap" and "step down"


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@141 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent a0182168
...@@ -306,22 +306,19 @@ class ProjectGui: ...@@ -306,22 +306,19 @@ class ProjectGui:
self.gui.get_object("Scale up").connect("clicked", self.scale_model, True) self.gui.get_object("Scale up").connect("clicked", self.scale_model, True)
self.gui.get_object("Scale down").connect("clicked", self.scale_model, False) self.gui.get_object("Scale down").connect("clicked", self.scale_model, False)
self.gui.get_object("Scale factor").set_value(2) self.gui.get_object("Scale factor").set_value(2)
# preset the numbers # drill, path and processing settings
self.gui.get_object("LayersControl").set_value(1) for objname, key in (("MaterialAllowanceControl", "material_allowance"),
self.gui.get_object("SamplesControl").set_value(50) ("MaxStepDownControl", "step_down"),
self.gui.get_object("LinesControl").set_value(20) ("OverlapPercentControl", "overlap"),
self.gui.get_object("ToolRadiusControl").set_value(1.0) ("ToolRadiusControl", "tool_radius"),
self.gui.get_object("TorusRadiusControl").set_value(0.25) ("TorusRadiusControl", "torus_radius"),
self.gui.get_object("FeedrateControl").set_value(200) ("FeedrateControl", "feedrate"),
self.gui.get_object("SpeedControl").set_value(1000) ("SpeedControl", "speed")):
obj = self.gui.get_object(objname)
self.settings.add_item(key, obj.get_value, obj.set_value)
# connect buttons with activities # connect buttons with activities
self.gui.get_object("GenerateToolPathButton").connect("clicked", self.generate_toolpath) self.gui.get_object("GenerateToolPathButton").connect("clicked", self.generate_toolpath)
self.gui.get_object("SaveToolPathButton").connect("clicked", self.save_toolpath) self.gui.get_object("SaveToolPathButton").connect("clicked", self.save_toolpath)
# add tool radius for experimental ODE collisions
obj = self.gui.get_object("ToolRadiusControl")
self.settings.add_item("tool_radius", obj.get_value, obj.set_value)
obj = self.gui.get_object("TorusRadiusControl")
self.settings.add_item("torus_radius", obj.get_value, obj.set_value)
# visual and general settings # visual and general settings
self.gui.get_object("Toggle3dView").connect("toggled", self.toggle_3d_view) self.gui.get_object("Toggle3dView").connect("toggled", self.toggle_3d_view)
for name, objname in (("show_model", "ShowModelCheckBox"), for name, objname in (("show_model", "ShowModelCheckBox"),
...@@ -674,23 +671,19 @@ class ProjectGui: ...@@ -674,23 +671,19 @@ class ProjectGui:
maxy = float(self.settings.get("maxy"))+offset maxy = float(self.settings.get("maxy"))+offset
minz = float(self.settings.get("minz")) minz = float(self.settings.get("minz"))
maxz = float(self.settings.get("maxz")) maxz = float(self.settings.get("maxz"))
samples = float(self.gui.get_object("SamplesControl").get_value())
lines = float(self.gui.get_object("LinesControl").get_value()) effective_toolradius = self.settings.get("tool_radius") * (1.0 - self.settings.get("overlap")/200.0)
layers = float(self.gui.get_object("LayersControl").get_value()) x_shift = effective_toolradius
y_shift = effective_toolradius
if pathgenerator == "DropCutter": if pathgenerator == "DropCutter":
if pathprocessor == "ZigZagCutter": if pathprocessor == "ZigZagCutter":
self.option = pycam.PathProcessors.PathAccumulator(zigzag=True) self.option = pycam.PathProcessors.PathAccumulator(zigzag=True)
else: else:
self.option = None self.option = None
self.pathgenerator = pycam.PathGenerators.DropCutter(self.cutter, self.model, self.option, physics=self.physics); self.pathgenerator = pycam.PathGenerators.DropCutter(self.cutter, self.model, self.option, physics=self.physics);
if samples>1: dx = x_shift
dx = (maxx-minx)/(samples-1) dy = y_shift
else:
dx = utils.INFINITE
if lines>1:
dy = (maxy-miny)/(lines-1)
else:
dy = utils.INFINITE
if direction == "x": if direction == "x":
self.toolpath = self.pathgenerator.GenerateToolPath(minx, maxx, miny, maxy, minz, maxz, dx, dy, 0, draw_callback) self.toolpath = self.pathgenerator.GenerateToolPath(minx, maxx, miny, maxy, minz, maxz, dx, dy, 0, draw_callback)
elif direction == "y": elif direction == "y":
...@@ -710,16 +703,13 @@ class ProjectGui: ...@@ -710,16 +703,13 @@ class ProjectGui:
else: else:
self.option = None self.option = None
self.pathgenerator = pycam.PathGenerators.PushCutter(self.cutter, self.model, self.option); self.pathgenerator = pycam.PathGenerators.PushCutter(self.cutter, self.model, self.option);
if pathprocessor == "ContourCutter" and samples>1: if pathprocessor == "ContourCutter":
dx = (maxx-minx)/(samples-1) dx = x_shift
else: else:
dx = utils.INFINITE dx = utils.INFINITE
if lines>1: dy = y_shift
dy = (maxy-miny)/(lines-1) if self.settings.get("step_down") > 0:
else: dz = self.settings.get("step_down")
dy = utils.INFINITE
if layers>1:
dz = (maxz-minz)/(layers-1)
else: else:
dz = utils.INFINITE dz = utils.INFINITE
if direction == "x": if direction == "x":
......
...@@ -71,6 +71,11 @@ path_postprocessor: PathAccumulator ...@@ -71,6 +71,11 @@ path_postprocessor: PathAccumulator
#maxz: 3 #maxz: 3
tool_radius: 1.0 tool_radius: 1.0
torus_radius: 0.25 torus_radius: 0.25
speed: 1000
feedrate: 200
material_allowance: 0
overlap: 20
step_down: 1.0
[Rough] [Rough]
cutter_shape: CylindricalCutter cutter_shape: CylindricalCutter
...@@ -105,6 +110,11 @@ tool_radius: 0.1 ...@@ -105,6 +110,11 @@ tool_radius: 0.1
"maxz": float, "maxz": float,
"tool_radius": float, "tool_radius": float,
"torus_radius": float, "torus_radius": float,
"speed": float,
"feedrate": float,
"material_allowance": float,
"overlap": int,
"step_down": float,
} }
def __init__(self, settings): def __init__(self, settings):
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment