- added a Laser preprocessor named 'Z_laser' which will change the Z to the Travel Z on each ToolChange event allowing therefore control of the dot size

- by default now a new blank Geometry object created by FlatCAM is of type multigeo
- made sure that optimizations of lines when importing SVG or DXF as lines will not encounter polygons but only LinesStrings or LinearRings, otherwise having crashes
- fixed the import SVG and import DXF, when importing as Geometry to be imported as multigeo tool
- fixed the import SVG and import DXF, the source files will be saved as loaded into the source_file attribute of the resulting object (be it Geometry or Gerber)
This commit is contained in:
Marius Stanciu
2020-07-23 00:44:33 +03:00
parent cf78211a6f
commit b8fb64a143
7 changed files with 308 additions and 84 deletions

View File

@@ -2193,9 +2193,10 @@ class App(QtCore.QObject):
if edited_object.tools[tool]['tooldia'] == selected_tooldia:
multi_tool = tool
break
log.debug("Editing MultiGeo Geometry with tool diameter: %s" % str(multi_tool))
self.geo_editor.edit_fcgeometry(edited_object, multigeo_tool=multi_tool)
else:
log.debug("Editing SingleGeo Geometry with tool diameter.")
self.geo_editor.edit_fcgeometry(edited_object)
# set call source to the Editor we go into
@@ -8780,9 +8781,15 @@ class App(QtCore.QObject):
units = self.defaults['units'].upper()
def obj_init(geo_obj, app_obj):
geo_obj.import_svg(filename, obj_type, units=units)
geo_obj.multigeo = False
geo_obj.source_file = self.export_gerber(obj_name=name, filename=None, local_use=geo_obj, use_thread=False)
if obj_type == "geometry":
geo_obj.import_svg(filename, obj_type, units=units)
elif obj_type == "gerber":
geo_obj.import_svg(filename, obj_type, units=units)
geo_obj.multigeo = True
with open(filename) as f:
file_content = f.read()
geo_obj.source_file = file_content
with self.proc_container.new(_("Importing SVG")) as proc:
@@ -8833,7 +8840,11 @@ class App(QtCore.QObject):
geo_obj.import_dxf_as_gerber(filename, units=units)
else:
return "fail"
geo_obj.multigeo = True
with open(filename) as f:
file_content = f.read()
geo_obj.source_file = file_content
with self.proc_container.new(_("Importing DXF")):