Commit 0b88b5f2 authored by sumpfralle's avatar sumpfralle

fixed various small issues


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@605 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 05721153
......@@ -10,5 +10,5 @@ recursive-include desktop *
recursive-include man *
recursive-include src *
recursive-include share *
recursive-include Samples *
recursive-include samples *
recursive-include Tests *
......@@ -103,6 +103,7 @@ def get_default_model():
return pycam.Importers.TestModel.get_test_model()
def load_model_file(filename, program_locations):
filename = os.path.expanduser(filename)
if not os.path.isfile(filename):
log.warn("The input file ('%') was not found!" % filename)
return None
......@@ -310,7 +311,7 @@ if __name__ == "__main__":
(opts, args) = parser.parse_args()
if len(args) > 0:
inputfile = args[0]
inputfile = os.path.expanduser(args[0])
else:
inputfile = None
......@@ -354,6 +355,9 @@ if __name__ == "__main__":
progress_bar = pycam.Gui.Console.ConsoleProgressBar(sys.stdout,
progress_styles[opts.progress])
if opts.config_file:
opts.config_file = os.path.expanduser(opts.config_file)
if not opts.export_gcode and not opts.export_task_config:
show_gui(inputfile, opts.config_file)
else:
......
......@@ -260,8 +260,11 @@ class Polygon(TransformableContainer):
cross_offset = p2.sub(p1).cross(self._plane.n).normalized()
bisector_normalized = self.get_bisector(index)
factor = cross_offset.dot(bisector_normalized)
if factor != 0:
bisector_sized = bisector_normalized.mul(offset / factor)
return p1.add(bisector_sized)
else:
return p2
def simplify_polygon_intersections(lines):
new_group = lines[:]
# remove all non-adjacent intersecting lines (this splits the group)
......
......@@ -795,6 +795,7 @@ class ProjectGui:
new_value = self.grid_adjustment_value.get_value()
self.settings.set("support_grid_adjustment_value", new_value)
tree_iter = self.grid_adjustment_selector.get_active_iter()
if not tree_iter is None:
value_string = "(%+.1f)" % new_value
self.grid_adjustment_model.set(tree_iter, 1, value_string)
self.update_support_grid_model()
......@@ -1915,6 +1916,7 @@ class ProjectGui:
if not model is None:
self.model = model
# do some initialization
self.append_to_queue(self.update_scale_controls)
self.append_to_queue(self.toggle_3d_view, value=True)
self.append_to_queue(self.update_view)
......
......@@ -192,8 +192,13 @@ class DXFParser:
log.warn("DXFImporter: Incomplete LINE definition between line " \
+ "%d and %d" % (start_line, end_line))
else:
self.lines.append(Line(Point(p1[0], p1[1], p1[2]),
Point(p2[0], p2[1], p2[2])))
line = Line(Point(p1[0], p1[1], p1[2]), Point(p2[0], p2[1], p2[2]))
if line.len > 0:
self.lines.append(line)
else:
log.warn("DXFImporter: Ignoring zero-length LINE (between " \
+ "input line %d and %d): %s" % (start_line, end_line,
line))
def check_header(self):
# TODO: this function is not used?
......
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