Version checker and several cleanups. Docs re-built. Some tooltips.
This commit is contained in:
parent
68a275e042
commit
34b95494ae
234
FlatCAM.py
234
FlatCAM.py
|
@ -25,6 +25,7 @@ from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCan
|
|||
from camlib import *
|
||||
import sys
|
||||
import urllib
|
||||
import copy
|
||||
|
||||
|
||||
########################################
|
||||
|
@ -1007,12 +1008,7 @@ class App:
|
|||
# User must take care to implement initialize
|
||||
# in a thread-safe way as is is likely that we
|
||||
# have been invoked in a separate thread.
|
||||
initialize(obj, self)
|
||||
|
||||
# Check units and convert if necessary
|
||||
if self.options["units"].upper() != obj.units.upper():
|
||||
GLib.idle_add(lambda: self.info("Converting units to " + self.options["units"] + "."))
|
||||
obj.convert_units(self.options["units"])
|
||||
#initialize(obj, self)
|
||||
|
||||
# Set default options from self.options
|
||||
for option in self.options:
|
||||
|
@ -1020,6 +1016,17 @@ class App:
|
|||
oname = option[len(kind)+1:]
|
||||
obj.options[oname] = self.options[option]
|
||||
|
||||
# Initialize as per user request
|
||||
# User must take care to implement initialize
|
||||
# in a thread-safe way as is is likely that we
|
||||
# have been invoked in a separate thread.
|
||||
initialize(obj, self)
|
||||
|
||||
# Check units and convert if necessary
|
||||
if self.options["units"].upper() != obj.units.upper():
|
||||
GLib.idle_add(lambda: self.info("Converting units to " + self.options["units"] + "."))
|
||||
obj.convert_units(self.options["units"])
|
||||
|
||||
# Add to our records
|
||||
self.stuff[name] = obj
|
||||
|
||||
|
@ -1047,15 +1054,12 @@ class App:
|
|||
:type percentage: float
|
||||
:param text: Text to display on the progress bar.
|
||||
:type text: str
|
||||
:return:
|
||||
:return: None
|
||||
"""
|
||||
self.progress_bar.set_text(text)
|
||||
self.progress_bar.set_fraction(percentage)
|
||||
return False
|
||||
|
||||
def save_project(self):
|
||||
return
|
||||
|
||||
def get_current(self):
|
||||
"""
|
||||
Returns the currently selected FlatCAMObj in the application.
|
||||
|
@ -1063,6 +1067,11 @@ class App:
|
|||
:return: Currently selected FlatCAMObj in the application.
|
||||
:rtype: FlatCAMObj or None
|
||||
"""
|
||||
|
||||
# TODO: Could possibly read the form into the object here.
|
||||
# But there are some cases when the form for the object
|
||||
# is not up yet. See on_tree_selection_changed.
|
||||
|
||||
try:
|
||||
return self.stuff[self.selected_item_name]
|
||||
except:
|
||||
|
@ -1256,7 +1265,7 @@ class App:
|
|||
:return: None
|
||||
"""
|
||||
|
||||
# Captura the latest changes
|
||||
# Capture the latest changes
|
||||
try:
|
||||
self.get_current().read_form()
|
||||
except:
|
||||
|
@ -1300,6 +1309,7 @@ class App:
|
|||
except:
|
||||
print "WARNING: Failed to parse project file:", filename
|
||||
f.close()
|
||||
return
|
||||
|
||||
# Clear the current project
|
||||
self.on_file_new(None)
|
||||
|
@ -1387,8 +1397,7 @@ class App:
|
|||
"cb_gerber_plot": "Plot this object on the main window.",
|
||||
"cb_gerber_mergepolys": "Show overlapping polygons as single.",
|
||||
"cb_gerber_solid": "Paint inside polygons.",
|
||||
"cb_gerber_multicolored": "Draw polygons with different polygons.",
|
||||
"button1": ""
|
||||
"cb_gerber_multicolored": "Draw polygons with different polygons."
|
||||
}
|
||||
|
||||
for widget in tooltips:
|
||||
|
@ -1398,19 +1407,36 @@ class App:
|
|||
## EVENT HANDLERS ##
|
||||
########################################
|
||||
def on_offset_object(self, widget):
|
||||
"""
|
||||
Offsets the object's geometry by the vector specified
|
||||
in the form. Re-plots.
|
||||
|
||||
:param widget: Ignored
|
||||
:return: None
|
||||
"""
|
||||
|
||||
obj = self.get_current()
|
||||
obj.read_form()
|
||||
assert isinstance(obj, FlatCAMObj)
|
||||
try:
|
||||
vect = self.get_eval("entry_eval_" + obj.kind + "_offset")
|
||||
except:
|
||||
self.info("ERROR: Vector is not in (x, y) format.")
|
||||
return
|
||||
assert isinstance(obj, Geometry)
|
||||
obj.offset(vect)
|
||||
obj.plot(self.figure)
|
||||
self.on_zoom_fit(None)
|
||||
self.on_zoom_fit(None) # TODO: Change this. Just done to aline all axes.
|
||||
return
|
||||
|
||||
def on_cb_plot_toggled(self, widget):
|
||||
"""
|
||||
Callback for toggling the "Plot" checkbox. Re-plots.
|
||||
|
||||
:param widget: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
self.get_current().read_form()
|
||||
self.get_current().plot(self.figure)
|
||||
self.on_zoom_fit(None) # TODO: Does not update correctly otherwise.
|
||||
|
@ -1513,7 +1539,6 @@ class App:
|
|||
|
||||
self.new_object("excellon", "Alignment Drills", obj_init)
|
||||
|
||||
|
||||
def on_toggle_pointbox(self, widget):
|
||||
"""
|
||||
Callback for radio selection change between point and box in the
|
||||
|
@ -1618,6 +1643,7 @@ class App:
|
|||
for dim in dimensions:
|
||||
options_set[dim] *= factor
|
||||
|
||||
# The scaling factor depending on choice of units.
|
||||
factor = 1/25.4
|
||||
if self.builder.get_object('rb_mm').get_active():
|
||||
factor = 25.4
|
||||
|
@ -1629,6 +1655,7 @@ class App:
|
|||
self.options2form()
|
||||
return
|
||||
|
||||
# Changing project units. Warn user.
|
||||
label = Gtk.Label("Changing the units of the project causes all geometrical \n" + \
|
||||
"properties of all objects to be scaled accordingly. Continue?")
|
||||
dialog = Gtk.Dialog("Changing Project Units", self.window, 0,
|
||||
|
@ -1644,14 +1671,14 @@ class App:
|
|||
dialog.destroy()
|
||||
|
||||
if response == Gtk.ResponseType.OK:
|
||||
print "Converting units..."
|
||||
print "Converting options..."
|
||||
#print "Converting units..."
|
||||
#print "Converting options..."
|
||||
self.read_form()
|
||||
scale_options(factor)
|
||||
self.options2form()
|
||||
for obj in self.stuff:
|
||||
units = self.get_radio_value({"rb_mm": "MM", "rb_inch": "IN"})
|
||||
print "Converting ", obj, " to ", units
|
||||
#print "Converting ", obj, " to ", units
|
||||
self.stuff[obj].convert_units(units)
|
||||
current = self.get_current()
|
||||
if current is not None:
|
||||
|
@ -1667,6 +1694,7 @@ class App:
|
|||
self.toggle_units_ignore = False
|
||||
|
||||
self.read_form()
|
||||
self.info("Converted units to %s" % self.options["units"])
|
||||
self.units_label.set_text("[" + self.options["units"] + "]")
|
||||
|
||||
def on_file_openproject(self, param):
|
||||
|
@ -1743,6 +1771,7 @@ class App:
|
|||
:param param: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
self.options.update(self.defaults)
|
||||
self.options2form() # Update UI
|
||||
|
||||
|
@ -1754,6 +1783,7 @@ class App:
|
|||
:param param: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
self.defaults.update(self.options)
|
||||
self.options2form() # Update UI
|
||||
|
||||
|
@ -1765,9 +1795,10 @@ class App:
|
|||
:param param: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
obj = self.get_current()
|
||||
if obj is None:
|
||||
print "WARNING: No object selected."
|
||||
self.info("WARNING: No object selected.")
|
||||
return
|
||||
for option in self.options:
|
||||
if option.find(obj.kind + "_") == 0:
|
||||
|
@ -1783,9 +1814,10 @@ class App:
|
|||
:param param: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
obj = self.get_current()
|
||||
if obj is None:
|
||||
print "WARNING: No object selected."
|
||||
self.info("WARNING: No object selected.")
|
||||
return
|
||||
obj.read_form()
|
||||
for option in obj.options:
|
||||
|
@ -1804,7 +1836,7 @@ class App:
|
|||
"""
|
||||
obj = self.get_current()
|
||||
if obj is None:
|
||||
print "WARNING: No object selected."
|
||||
self.info("WARNING: No object selected.")
|
||||
return
|
||||
obj.read_form()
|
||||
for option in obj.options:
|
||||
|
@ -1821,9 +1853,10 @@ class App:
|
|||
:param param: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
obj = self.get_current()
|
||||
if obj is None:
|
||||
print "WARNING: No object selected."
|
||||
self.info("WARNING: No object selected.")
|
||||
return
|
||||
for option in self.defaults:
|
||||
if option.find(obj.kind + "_") == 0:
|
||||
|
@ -1839,6 +1872,7 @@ class App:
|
|||
:param param: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
try:
|
||||
f = open("defaults.json")
|
||||
options = f.read()
|
||||
|
@ -1877,8 +1911,9 @@ class App:
|
|||
:param widget: The widget from which this was called. Ignore.
|
||||
:return: None
|
||||
"""
|
||||
combo_sel = self.combo_options.get_active()
|
||||
print "Options --> ", combo_sel
|
||||
|
||||
#combo_sel = self.combo_options.get_active()
|
||||
#print "Options --> ", combo_sel
|
||||
self.options2form()
|
||||
|
||||
def on_options_update(self, widget):
|
||||
|
@ -1890,6 +1925,7 @@ class App:
|
|||
:param widget: The widget from which this was called. Ignore.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
if self.options_update_ignore:
|
||||
return
|
||||
self.read_form()
|
||||
|
@ -1902,8 +1938,8 @@ class App:
|
|||
:param widget: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
obj = self.get_current()
|
||||
assert isinstance(obj, FlatCAMObj)
|
||||
factor = self.get_eval("entry_eval_" + obj.kind + "_scalefactor")
|
||||
obj.scale(factor)
|
||||
obj.to_form()
|
||||
|
@ -1918,7 +1954,6 @@ class App:
|
|||
:param event: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
print "on_canvas_configure()"
|
||||
|
||||
xmin, xmax = self.axes.get_xlim()
|
||||
ymin, ymax = self.axes.get_ylim()
|
||||
|
@ -1941,6 +1976,7 @@ class App:
|
|||
"""
|
||||
Callback for request from the Gerber form to generate a bounding box for the
|
||||
geometry in the object. Creates a FlatCAMGeometry with the bounding box.
|
||||
The box can have rounded corners if specified in the form.
|
||||
|
||||
:param widget: Ignored.
|
||||
:return: None
|
||||
|
@ -1948,12 +1984,13 @@ class App:
|
|||
# TODO: Use Gerber.get_bounding_box(...)
|
||||
gerber = self.get_current()
|
||||
gerber.read_form()
|
||||
name = self.selected_item_name + "_bbox"
|
||||
name = gerber.options["name"] + "_bbox"
|
||||
|
||||
def geo_init(geo_obj, app_obj):
|
||||
assert isinstance(geo_obj, FlatCAMGeometry)
|
||||
# Bounding box with rounded corners
|
||||
bounding_box = gerber.solid_geometry.envelope.buffer(gerber.options["bboxmargin"])
|
||||
if not gerber.options["bboxrounded"]:
|
||||
if not gerber.options["bboxrounded"]: # Remove rounded corners
|
||||
bounding_box = bounding_box.envelope
|
||||
geo_obj.solid_geometry = bounding_box
|
||||
|
||||
|
@ -1967,19 +2004,19 @@ class App:
|
|||
:param widget: The widget from which this was called.
|
||||
:return: None
|
||||
"""
|
||||
print "Re-plotting"
|
||||
|
||||
self.get_current().read_form()
|
||||
obj = self.get_current()
|
||||
obj.read_form()
|
||||
|
||||
self.set_progress_bar(0.5, "Plotting...")
|
||||
#GLib.idle_add(lambda: self.set_progress_bar(0.5, "Plotting..."))
|
||||
|
||||
def thread_func(app_obj):
|
||||
assert isinstance(app_obj, App)
|
||||
#GLib.idle_add(lambda: app_obj.set_progress_bar(0.5, "Plotting..."))
|
||||
#GLib.idle_add(lambda: app_obj.get_current().plot(app_obj.figure))
|
||||
app_obj.get_current().plot(app_obj.figure)
|
||||
obj.plot(app_obj.figure)
|
||||
GLib.idle_add(lambda: app_obj.on_zoom_fit(None))
|
||||
GLib.timeout_add(300, lambda: app_obj.set_progress_bar(0.0, ""))
|
||||
GLib.timeout_add(300, lambda: app_obj.set_progress_bar(0.0, "Idle"))
|
||||
|
||||
t = threading.Thread(target=thread_func, args=(self,))
|
||||
t.daemon = True
|
||||
|
@ -1990,29 +2027,28 @@ class App:
|
|||
Callback for button active/click on Excellon form to
|
||||
create a CNC Job for the Excellon file.
|
||||
|
||||
:param widget: The widget from which this was called.
|
||||
:param widget: Ignored
|
||||
:return: None
|
||||
"""
|
||||
|
||||
job_name = self.selected_item_name + "_cnc"
|
||||
excellon = self.get_current()
|
||||
assert isinstance(excellon, FlatCAMExcellon)
|
||||
excellon.read_form()
|
||||
job_name = excellon.options["name"] + "_cnc"
|
||||
|
||||
# Object initialization function for app.new_object()
|
||||
def job_init(job_obj, app_obj):
|
||||
excellon_ = self.get_current()
|
||||
assert isinstance(excellon_, FlatCAMExcellon)
|
||||
# excellon_ = self.get_current()
|
||||
# assert isinstance(excellon_, FlatCAMExcellon)
|
||||
assert isinstance(job_obj, FlatCAMCNCjob)
|
||||
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(0.2, "Creating CNC Job..."))
|
||||
job_obj.z_cut = excellon_.options["drillz"]
|
||||
job_obj.z_move = excellon_.options["travelz"]
|
||||
job_obj.feedrate = excellon_.options["feedrate"]
|
||||
job_obj.z_cut = excellon.options["drillz"]
|
||||
job_obj.z_move = excellon.options["travelz"]
|
||||
job_obj.feedrate = excellon.options["feedrate"]
|
||||
# There could be more than one drill size...
|
||||
# job_obj.tooldia = # TODO: duplicate variable!
|
||||
# job_obj.options["tooldia"] =
|
||||
job_obj.generate_from_excellon_by_tool(excellon_, excellon_.options["toolselection"])
|
||||
job_obj.generate_from_excellon_by_tool(excellon, excellon.options["toolselection"])
|
||||
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(0.5, "Parsing G-Code..."))
|
||||
job_obj.gcode_parse()
|
||||
|
@ -2068,16 +2104,15 @@ class App:
|
|||
:param widget: The widget from which this was called.
|
||||
:return: None
|
||||
"""
|
||||
name = self.selected_item_name + "_noncopper"
|
||||
|
||||
gerb = self.get_current()
|
||||
gerb.read_form()
|
||||
name = gerb.options["name"] + "_noncopper"
|
||||
|
||||
def geo_init(geo_obj, app_obj):
|
||||
assert isinstance(geo_obj, FlatCAMGeometry)
|
||||
#gerber = app_obj.stuff[app_obj.selected_item_name] # TODO: Remove.
|
||||
gerber = app_obj.get_current()
|
||||
assert isinstance(gerber, FlatCAMGerber)
|
||||
gerber.read_form()
|
||||
bounding_box = gerber.solid_geometry.envelope.buffer(gerber.options["noncoppermargin"])
|
||||
non_copper = bounding_box.difference(gerber.solid_geometry)
|
||||
bounding_box = gerb.solid_geometry.envelope.buffer(gerb.options["noncoppermargin"])
|
||||
non_copper = bounding_box.difference(gerb.solid_geometry)
|
||||
geo_obj.solid_geometry = non_copper
|
||||
|
||||
# TODO: Check for None
|
||||
|
@ -2091,15 +2126,15 @@ class App:
|
|||
:param widget: The widget from which this was called.
|
||||
:return: None
|
||||
"""
|
||||
name = self.selected_item_name + "_cutout"
|
||||
|
||||
gerb = self.get_current()
|
||||
gerb.read_form()
|
||||
name = gerb.options["name"] + "_cutout"
|
||||
|
||||
def geo_init(geo_obj, app_obj):
|
||||
# TODO: get from object
|
||||
margin = app_obj.get_eval("entry_eval_gerber_cutoutmargin")
|
||||
gap_size = app_obj.get_eval("entry_eval_gerber_cutoutgapsize")
|
||||
#gerber = app_obj.stuff[app_obj.selected_item_name]
|
||||
gerber = app_obj.get_current()
|
||||
minx, miny, maxx, maxy = gerber.bounds()
|
||||
margin = gerb.options["cutoutmargin"]
|
||||
gap_size = gerb.options["cutoutgapsize"]
|
||||
minx, miny, maxx, maxy = gerb.bounds()
|
||||
minx -= margin
|
||||
maxx += margin
|
||||
miny -= margin
|
||||
|
@ -2152,14 +2187,17 @@ class App:
|
|||
:param widget: The widget from which this was called.
|
||||
:return: None
|
||||
"""
|
||||
print "Generating Isolation Geometry:"
|
||||
iso_name = self.selected_item_name + "_iso"
|
||||
|
||||
gerb = self.get_current()
|
||||
gerb.read_form()
|
||||
iso_name = gerb.options["name"] + "_iso"
|
||||
|
||||
def iso_init(geo_obj, app_obj):
|
||||
# TODO: Object must be updated on form change and the options
|
||||
# TODO: read from the object.
|
||||
tooldia = app_obj.get_eval("entry_eval_gerber_isotooldia")
|
||||
geo_obj.solid_geometry = self.get_current().isolation_geometry(tooldia / 2.0)
|
||||
# Propagate options
|
||||
geo_obj.options["cnctooldia"] = gerb.options["isotooldia"]
|
||||
|
||||
geo_obj.solid_geometry = gerb.isolation_geometry(gerb.options["isotooldia"] / 2.0)
|
||||
app_obj.info("Isolation geometry created: %s" % geo_obj.options["name"])
|
||||
|
||||
# TODO: Do something if this is None. Offer changing name?
|
||||
self.new_object("geometry", iso_name, iso_init)
|
||||
|
@ -2171,26 +2209,26 @@ class App:
|
|||
:param widget: The widget from which this was called.
|
||||
:return: None
|
||||
"""
|
||||
print "Generating CNC job"
|
||||
job_name = self.selected_item_name + "_cnc"
|
||||
|
||||
source_geo = self.get_current()
|
||||
source_geo.read_form()
|
||||
job_name = source_geo.options["name"] + "_cnc"
|
||||
|
||||
# Object initialization function for app.new_object()
|
||||
# RUNNING ON SEPARATE THREAD!
|
||||
def job_init(job_obj, app_obj):
|
||||
assert isinstance(job_obj, FlatCAMCNCjob)
|
||||
#geometry = app_obj.stuff[app_obj.selected_item_name]
|
||||
geometry = app_obj.get_current()
|
||||
assert isinstance(geometry, FlatCAMGeometry)
|
||||
geometry.read_form()
|
||||
# Propagate options
|
||||
job_obj.options["tooldia"] = source_geo.options["cnctooldia"]
|
||||
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(0.2, "Creating CNC Job..."))
|
||||
job_obj.z_cut = geometry.options["cutz"]
|
||||
job_obj.z_move = geometry.options["travelz"]
|
||||
job_obj.feedrate = geometry.options["feedrate"]
|
||||
job_obj.options["tooldia"] = geometry.options["cnctooldia"]
|
||||
job_obj.z_cut = source_geo.options["cutz"]
|
||||
job_obj.z_move = source_geo.options["travelz"]
|
||||
job_obj.feedrate = source_geo.options["feedrate"]
|
||||
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(0.4, "Analyzing Geometry..."))
|
||||
# TODO: The tolerance should not be hard coded. Just for testing.
|
||||
job_obj.generate_from_geometry(geometry, tolerance=0.0005)
|
||||
job_obj.generate_from_geometry(source_geo, tolerance=0.0005)
|
||||
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(0.5, "Parsing G-Code..."))
|
||||
job_obj.gcode_parse()
|
||||
|
@ -2204,6 +2242,7 @@ class App:
|
|||
# To be run in separate thread
|
||||
def job_thread(app_obj):
|
||||
app_obj.new_object("cncjob", job_name, job_init)
|
||||
GLib.idle_add(lambda: app_obj.info("CNCjob created: %s" % job_name))
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(1.0, "Done!"))
|
||||
GLib.timeout_add_seconds(1, lambda: app_obj.set_progress_bar(0.0, ""))
|
||||
|
||||
|
@ -2223,9 +2262,11 @@ class App:
|
|||
:param widget: The widget from which this was called.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
self.info("Click inside the desired polygon.")
|
||||
geo = self.get_current()
|
||||
geo.read_form()
|
||||
assert isinstance(geo, FlatCAMGeometry)
|
||||
tooldia = geo.options["painttooldia"]
|
||||
overlap = geo.options["paintoverlap"]
|
||||
|
||||
|
@ -2255,12 +2296,12 @@ class App:
|
|||
:param widget: The widget from which this was called.
|
||||
:return: None
|
||||
"""
|
||||
def on_success(self, filename):
|
||||
cncjob = self.get_current()
|
||||
def on_success(app_obj, filename):
|
||||
cncjob = app_obj.get_current()
|
||||
f = open(filename, 'w')
|
||||
f.write(cncjob.gcode)
|
||||
f.close()
|
||||
self.info("Saved to: " + filename)
|
||||
app_obj.info("Saved to: " + filename)
|
||||
|
||||
self.file_chooser_save_action(on_success)
|
||||
|
||||
|
@ -2271,7 +2312,9 @@ class App:
|
|||
:param widget: The widget from which this was called.
|
||||
:return: None
|
||||
"""
|
||||
print "on_delete():", self.selected_item_name
|
||||
|
||||
# Keep this for later
|
||||
name = copy.copy(self.selected_item_name)
|
||||
|
||||
# Remove plot
|
||||
self.figure.delaxes(self.get_current().axes)
|
||||
|
@ -2283,6 +2326,8 @@ class App:
|
|||
# Update UI
|
||||
self.build_list() # Update the items list
|
||||
|
||||
self.info("Object deleted: %s" % name)
|
||||
|
||||
def on_toolbar_replot(self, widget):
|
||||
"""
|
||||
Callback for toolbar button. Re-plots all objects.
|
||||
|
@ -2320,6 +2365,7 @@ class App:
|
|||
self.stuff[new_name] = self.stuff.pop(self.selected_item_name) # Update dictionary
|
||||
self.stuff[new_name].options["name"] = new_name # update object
|
||||
self.info('Name change: ' + self.selected_item_name + " to " + new_name)
|
||||
|
||||
self.selected_item_name = new_name # Update selection name
|
||||
|
||||
self.build_list() # Update the items list
|
||||
|
@ -2337,7 +2383,7 @@ class App:
|
|||
:type selection: Gtk.TreeSelection
|
||||
:return: None
|
||||
"""
|
||||
print "on_tree_selection_change(): ",
|
||||
print "DEBUG: on_tree_selection_change(): ",
|
||||
model, treeiter = selection.get_selected()
|
||||
|
||||
if treeiter is not None:
|
||||
|
@ -2346,13 +2392,13 @@ class App:
|
|||
if obj is not None:
|
||||
obj.read_form()
|
||||
|
||||
print "You selected", model[treeiter][0]
|
||||
print "DEBUG: You selected", model[treeiter][0]
|
||||
self.selected_item_name = model[treeiter][0]
|
||||
obj_new = self.get_current()
|
||||
if obj_new is not None:
|
||||
GLib.idle_add(lambda: obj_new.build_ui())
|
||||
else:
|
||||
print "Nothing selected"
|
||||
print "DEBUG: Nothing selected"
|
||||
self.selected_item_name = None
|
||||
self.setup_component_editor()
|
||||
|
||||
|
@ -2391,7 +2437,7 @@ class App:
|
|||
:param param: Whatever is passed by the event. Ignore.
|
||||
:return: None
|
||||
"""
|
||||
print "quit from menu"
|
||||
|
||||
self.window.destroy()
|
||||
Gtk.main_quit()
|
||||
|
||||
|
@ -2402,7 +2448,7 @@ class App:
|
|||
:param param: Whatever is passed by the event. Ignore.
|
||||
:return: None
|
||||
"""
|
||||
print "quit from X"
|
||||
|
||||
self.window.destroy()
|
||||
Gtk.main_quit()
|
||||
|
||||
|
@ -2431,7 +2477,7 @@ class App:
|
|||
t.start()
|
||||
#on_success(self, filename)
|
||||
elif response == Gtk.ResponseType.CANCEL:
|
||||
print("Cancel clicked")
|
||||
self.info("Open cancelled.") # print("Cancel clicked")
|
||||
dialog.destroy()
|
||||
|
||||
def file_chooser_save_action(self, on_success):
|
||||
|
@ -2454,7 +2500,7 @@ class App:
|
|||
dialog.destroy()
|
||||
on_success(self, filename)
|
||||
elif response == Gtk.ResponseType.CANCEL:
|
||||
print("Cancel clicked")
|
||||
self.info("Save cancelled.") # print("Cancel clicked")
|
||||
dialog.destroy()
|
||||
|
||||
def on_fileopengerber(self, param):
|
||||
|
@ -2536,9 +2582,13 @@ class App:
|
|||
def on_success(app_obj, filename):
|
||||
assert isinstance(app_obj, App)
|
||||
|
||||
def obj_init(job_obj, app_obj):
|
||||
assert isinstance(app_obj, App)
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(0.1, "Opening G-Code ..."))
|
||||
def obj_init(job_obj, app_obj_):
|
||||
"""
|
||||
|
||||
:type app_obj_: App
|
||||
"""
|
||||
assert isinstance(app_obj_, App)
|
||||
GLib.idle_add(lambda: app_obj_.set_progress_bar(0.1, "Opening G-Code ..."))
|
||||
|
||||
f = open(filename)
|
||||
gcode = f.read()
|
||||
|
@ -2546,13 +2596,13 @@ class App:
|
|||
|
||||
job_obj.gcode = gcode
|
||||
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(0.2, "Parsing ..."))
|
||||
GLib.idle_add(lambda: app_obj_.set_progress_bar(0.2, "Parsing ..."))
|
||||
job_obj.gcode_parse()
|
||||
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(0.6, "Creating geometry ..."))
|
||||
GLib.idle_add(lambda: app_obj_.set_progress_bar(0.6, "Creating geometry ..."))
|
||||
job_obj.create_geometry()
|
||||
|
||||
GLib.idle_add(lambda: app_obj.set_progress_bar(0.6, "Plotting ..."))
|
||||
GLib.idle_add(lambda: app_obj_.set_progress_bar(0.6, "Plotting ..."))
|
||||
|
||||
name = filename.split('/')[-1].split('\\')[-1]
|
||||
app_obj.new_object("cncjob", name, obj_init)
|
||||
|
@ -2572,6 +2622,7 @@ class App:
|
|||
:param event: Contains information about the event.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
try: # May fail in case mouse not within axes
|
||||
self.position_label.set_label("X: %.4f Y: %.4f" % (
|
||||
event.xdata, event.ydata))
|
||||
|
@ -2594,6 +2645,7 @@ class App:
|
|||
was clicked, the pixel coordinates and the axes coordinates.
|
||||
:return: None
|
||||
"""
|
||||
|
||||
# For key presses
|
||||
self.canvas.grab_focus()
|
||||
|
||||
|
@ -2676,7 +2728,7 @@ class App:
|
|||
:param event: Ignored.
|
||||
:return: None
|
||||
"""
|
||||
print 'you pressed', event.key, event.xdata, event.ydata
|
||||
#print 'you pressed', event.key, event.xdata, event.ydata
|
||||
|
||||
if event.key == '1': # 1
|
||||
self.on_zoom_fit(None)
|
||||
|
|
65
FlatCAM.ui
65
FlatCAM.ui
|
@ -2122,6 +2122,8 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label13">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes"><b>Isolation Routing:</b> Cutting copper
|
||||
around traces for electrical isolation.</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="ypad">3</property>
|
||||
|
@ -2146,6 +2148,9 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label14">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Tool paths for isolation routing are drawn
|
||||
at 1/2 of the tool diameter away from
|
||||
polygons defined in Gerber.</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="xpad">3</property>
|
||||
<property name="label" translatable="yes">Tool diam:</property>
|
||||
|
@ -2188,6 +2193,8 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_markup" translatable="yes">Creates a geometry object with tool
|
||||
paths for isolation routing.</property>
|
||||
<signal name="activate" handler="on_generate_isolation" swapped="no"/>
|
||||
<signal name="clicked" handler="on_generate_isolation" swapped="no"/>
|
||||
</object>
|
||||
|
@ -2201,6 +2208,8 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes"><b>Board cutout:</b> Cut around
|
||||
the edge of the board.</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="ypad">3</property>
|
||||
|
@ -2224,6 +2233,9 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label27">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Distance away from the rectangular edge
|
||||
enclosing the board to generate the
|
||||
cutting tool path.</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Margin: </property>
|
||||
</object>
|
||||
|
@ -2270,6 +2282,9 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label28">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Length of the gaps along the toolpath.
|
||||
These gaps are needed to hold the
|
||||
board in place until the job is complete.</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Gap size: </property>
|
||||
</object>
|
||||
|
@ -2304,6 +2319,8 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Gaps are placed on the top and
|
||||
bottom edges of the board cutout.</property>
|
||||
<property name="margin_right">8</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
|
@ -2321,6 +2338,8 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Gaps are placed on the left and right
|
||||
edges of the board cutout.</property>
|
||||
<property name="margin_right">8</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="active">True</property>
|
||||
|
@ -2338,6 +2357,8 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Gaps are placed on the four edges
|
||||
of the board cutout.</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">rb_2lr</property>
|
||||
|
@ -2369,6 +2390,8 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_markup" translatable="yes">Generates the Geometry object with
|
||||
toolpaths for board cutout.</property>
|
||||
<signal name="activate" handler="on_gerber_generate_cutout" swapped="no"/>
|
||||
<signal name="clicked" handler="on_gerber_generate_cutout" swapped="no"/>
|
||||
</object>
|
||||
|
@ -2382,6 +2405,12 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label30">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes"><b>Non-copper regions</b>: Use to create
|
||||
geometry with polygons covering areas
|
||||
without copper on the board.
|
||||
|
||||
This can be used, for example, to clear all
|
||||
copper from certain regions.</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="ypad">3</property>
|
||||
|
@ -2407,6 +2436,12 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label31">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Defines how far from the rectangular box
|
||||
enclosing the contents of the board the
|
||||
edge of the board is.
|
||||
|
||||
Copper-free areas will be located within
|
||||
this boundary.</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Boundary margin: </property>
|
||||
</object>
|
||||
|
@ -2444,6 +2479,8 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_markup" translatable="yes">Creates a Geometry Object covering
|
||||
areas without copper.</property>
|
||||
<signal name="activate" handler="on_gerber_generate_noncopper" swapped="no"/>
|
||||
<signal name="clicked" handler="on_gerber_generate_noncopper" swapped="no"/>
|
||||
</object>
|
||||
|
@ -2457,6 +2494,8 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label41">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes"><b>Bounding Box:</b> A simple rectangular
|
||||
boundary around the PCB contents.</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="ypad">3</property>
|
||||
|
@ -2482,6 +2521,9 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label42">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Distance from the rectangular box enclosing
|
||||
the PCB contents at which to draw the
|
||||
bounding box.</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Boundary margin: </property>
|
||||
</object>
|
||||
|
@ -2519,6 +2561,9 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Whether to draw rounded corners on the bounding
|
||||
box. The radius is the Boundary margin.
|
||||
</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
|
@ -2534,6 +2579,8 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_markup" translatable="yes">Generates a Geometry object
|
||||
with the bounding box.</property>
|
||||
<signal name="activate" handler="on_generate_gerber_bounding_box" swapped="no"/>
|
||||
<signal name="clicked" handler="on_generate_gerber_bounding_box" swapped="no"/>
|
||||
</object>
|
||||
|
@ -2547,6 +2594,9 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label51">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes"><b>Scale:</b> Resizes the geometry
|
||||
of the object. All sizes and coordinates
|
||||
are multiplied by the given factor.</property>
|
||||
<property name="margin_top">3</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="ypad">3</property>
|
||||
|
@ -2572,6 +2622,8 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label52">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Factor by which to multiply all
|
||||
geometrical dimensions.</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Factor:</property>
|
||||
</object>
|
||||
|
@ -2608,6 +2660,8 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_markup" translatable="yes">Scales the geometry
|
||||
of this object.</property>
|
||||
<signal name="activate" handler="on_scale_object" swapped="no"/>
|
||||
<signal name="clicked" handler="on_scale_object" swapped="no"/>
|
||||
</object>
|
||||
|
@ -2621,6 +2675,8 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label97">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes"><b>Offset:</b> Shift the geometry of
|
||||
this object by the specified (x, y) vector.</property>
|
||||
<property name="margin_top">3</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="ypad">3</property>
|
||||
|
@ -2646,6 +2702,10 @@ THE SOFTWARE.</property>
|
|||
<object class="GtkLabel" id="label98">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Vector by which to offset the geometry.
|
||||
Format is <b>(x, y)</b>, where <b>x</b> and <b>y</b> are
|
||||
decimal numbers representing the
|
||||
distance in the corresponding axis.</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Offset Vector: </property>
|
||||
</object>
|
||||
|
@ -2682,6 +2742,8 @@ THE SOFTWARE.</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_markup" translatable="yes">Offset the geometry of
|
||||
this object.</property>
|
||||
<signal name="activate" handler="on_offset_object" swapped="no"/>
|
||||
<signal name="clicked" handler="on_offset_object" swapped="no"/>
|
||||
</object>
|
||||
|
@ -3472,6 +3534,9 @@ project.</property>
|
|||
<object class="GtkLabel" id="label58">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Tool paths for isolation routing are drawn
|
||||
at 1/2 of the tool diameter away from
|
||||
polygons defined in Gerber.</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="xpad">3</property>
|
||||
<property name="label" translatable="yes">Tool diam:</property>
|
||||
|
|
20
camlib.py
20
camlib.py
|
@ -167,6 +167,14 @@ class Geometry:
|
|||
"""
|
||||
Sets object's attributes from a dictionary.
|
||||
Attributes to include are listed in ``self.ser_attrs``.
|
||||
This method will look only for only and all the
|
||||
attributes in ``self.ser_attrs``. They must all
|
||||
be present. Use only for deserializing saved
|
||||
objects.
|
||||
|
||||
:param d: Dictionary of attributes to set in the object.
|
||||
:type d: dict
|
||||
:return: None
|
||||
"""
|
||||
for attr in self.ser_attrs:
|
||||
setattr(self, attr, d[attr])
|
||||
|
@ -523,8 +531,8 @@ class Gerber (Geometry):
|
|||
Main Gerber parser. Reads Gerber and populates ``self.paths``, ``self.apertures``,
|
||||
``self.flashes``, ``self.regions`` and ``self.units``.
|
||||
|
||||
:param glines: Gerber code as list of strings, each
|
||||
element being one line of the source file.
|
||||
:param glines: Gerber code as list of strings, each element being
|
||||
one line of the source file.
|
||||
:type glines: list
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
@ -1219,10 +1227,10 @@ class CNCjob(Geometry):
|
|||
:param append: Wether to append to self.gcode or re-write it.
|
||||
:type append: bool
|
||||
:param tooldia: If given, sets the tooldia property but does
|
||||
not affect the process in any other way.
|
||||
not affect the process in any other way.
|
||||
:type tooldia: bool
|
||||
:param tolerance: All points in the simplified object will be within the
|
||||
tolerance distance of the original geometry.
|
||||
tolerance distance of the original geometry.
|
||||
:return: None
|
||||
:rtype: None
|
||||
"""
|
||||
|
@ -1487,7 +1495,7 @@ class CNCjob(Geometry):
|
|||
:param polygon: A Shapely.Polygon
|
||||
:type polygon: Shapely.Polygon
|
||||
:param tolerance: All points in the simplified object will be within the
|
||||
tolerance distance of the original geometry.
|
||||
tolerance distance of the original geometry.
|
||||
:type tolerance: float
|
||||
:return: G-code to cut along polygon.
|
||||
:rtype: str
|
||||
|
@ -1522,7 +1530,7 @@ class CNCjob(Geometry):
|
|||
:param linear: The path to cut along.
|
||||
:type: Shapely.LinearRing or Shapely.Linear String
|
||||
:param tolerance: All points in the simplified object will be within the
|
||||
tolerance distance of the original geometry.
|
||||
tolerance distance of the original geometry.
|
||||
:type tolerance: float
|
||||
:return: G-code to cut alon the linear feature.
|
||||
:rtype: str
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -131,6 +131,7 @@
|
|||
| <a href="#R"><strong>R</strong></a>
|
||||
| <a href="#S"><strong>S</strong></a>
|
||||
| <a href="#T"><strong>T</strong></a>
|
||||
| <a href="#V"><strong>V</strong></a>
|
||||
| <a href="#Z"><strong>Z</strong></a>
|
||||
|
||||
</div>
|
||||
|
@ -392,11 +393,19 @@
|
|||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="index.html#FlatCAM.Excellon.offset">offset() (FlatCAM.Excellon method)</a>
|
||||
<dt><a href="index.html#FlatCAM.CNCjob.offset">offset() (FlatCAM.CNCjob method)</a>
|
||||
</dt>
|
||||
|
||||
<dd><dl>
|
||||
|
||||
<dt><a href="index.html#FlatCAM.Excellon.offset">(FlatCAM.Excellon method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="index.html#FlatCAM.FlatCAMGeometry.offset">(FlatCAM.FlatCAMGeometry method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="index.html#FlatCAM.Geometry.offset">(FlatCAM.Geometry method)</a>
|
||||
</dt>
|
||||
|
||||
|
@ -418,6 +427,10 @@
|
|||
</dt>
|
||||
|
||||
|
||||
<dt><a href="index.html#FlatCAM.App.on_cb_plot_toggled">on_cb_plot_toggled() (FlatCAM.App method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="index.html#FlatCAM.App.on_clear_plots">on_clear_plots() (FlatCAM.App method)</a>
|
||||
</dt>
|
||||
|
||||
|
@ -536,6 +549,10 @@
|
|||
</dt>
|
||||
|
||||
|
||||
<dt><a href="index.html#FlatCAM.App.on_offset_object">on_offset_object() (FlatCAM.App method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="index.html#FlatCAM.App.on_options_app2object">on_options_app2object() (FlatCAM.App method)</a>
|
||||
</dt>
|
||||
|
||||
|
@ -626,9 +643,15 @@
|
|||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="index.html#FlatCAM.Gerber.parse_file">parse_file() (FlatCAM.Gerber method)</a>
|
||||
<dt><a href="index.html#FlatCAM.Excellon.parse_file">parse_file() (FlatCAM.Excellon method)</a>
|
||||
</dt>
|
||||
|
||||
<dd><dl>
|
||||
|
||||
<dt><a href="index.html#FlatCAM.Gerber.parse_file">(FlatCAM.Gerber method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></dd>
|
||||
|
||||
<dt><a href="index.html#FlatCAM.Excellon.parse_lines">parse_lines() (FlatCAM.Excellon method)</a>
|
||||
</dt>
|
||||
|
@ -693,6 +716,12 @@
|
|||
<dt><a href="index.html#FlatCAM.App.read_form_item">read_form_item() (FlatCAM.App method)</a>
|
||||
</dt>
|
||||
|
||||
<dd><dl>
|
||||
|
||||
<dt><a href="index.html#FlatCAM.FlatCAMObj.read_form_item">(FlatCAM.FlatCAMObj method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></dd>
|
||||
</dl></td>
|
||||
</tr></table>
|
||||
|
||||
|
@ -713,6 +742,10 @@
|
|||
</dt>
|
||||
|
||||
|
||||
<dt><a href="index.html#FlatCAM.FlatCAMGeometry.scale">(FlatCAM.FlatCAMGeometry method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="index.html#FlatCAM.Geometry.scale">(FlatCAM.Geometry method)</a>
|
||||
</dt>
|
||||
|
||||
|
@ -788,6 +821,16 @@
|
|||
</dl></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="V">V</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="index.html#FlatCAM.App.versionCheck">versionCheck() (FlatCAM.App method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="Z">Z</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
|
|
@ -381,6 +381,22 @@ as to use the whole canvas.</p>
|
|||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.App.on_cb_plot_toggled">
|
||||
<tt class="descname">on_cb_plot_toggled</tt><big>(</big><em>widget</em><big>)</big><a class="headerlink" href="#FlatCAM.App.on_cb_plot_toggled" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Callback for toggling the “Plot” checkbox. Re-plots.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>widget</strong> – Ignored.</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.App.on_clear_plots">
|
||||
<tt class="descname">on_clear_plots</tt><big>(</big><em>widget</em><big>)</big><a class="headerlink" href="#FlatCAM.App.on_clear_plots" title="Permalink to this definition">¶</a></dt>
|
||||
|
@ -756,7 +772,7 @@ create a CNC Job for the Excellon file.</p>
|
|||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>widget</strong> – The widget from which this was called.</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>widget</strong> – Ignored</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
|
@ -768,7 +784,8 @@ create a CNC Job for the Excellon file.</p>
|
|||
<dt id="FlatCAM.App.on_generate_gerber_bounding_box">
|
||||
<tt class="descname">on_generate_gerber_bounding_box</tt><big>(</big><em>widget</em><big>)</big><a class="headerlink" href="#FlatCAM.App.on_generate_gerber_bounding_box" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Callback for request from the Gerber form to generate a bounding box for the
|
||||
geometry in the object. Creates a FlatCAMGeometry with the bounding box.</p>
|
||||
geometry in the object. Creates a FlatCAMGeometry with the bounding box.
|
||||
The box can have rounded corners if specified in the form.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
|
@ -909,6 +926,23 @@ For details, see: <a class="reference external" href="http://matplotlib.org/user
|
|||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.App.on_offset_object">
|
||||
<tt class="descname">on_offset_object</tt><big>(</big><em>widget</em><big>)</big><a class="headerlink" href="#FlatCAM.App.on_offset_object" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Offsets the object’s geometry by the vector specified
|
||||
in the form. Re-plots.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>widget</strong> – Ignored</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.App.on_options_app2object">
|
||||
<tt class="descname">on_options_app2object</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#FlatCAM.App.on_options_app2object" title="Permalink to this definition">¶</a></dt>
|
||||
|
@ -1417,7 +1451,7 @@ in the GUI. This selection will in turn trigger
|
|||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"></p>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">None</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -1488,6 +1522,22 @@ displayed.</p>
|
|||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.App.versionCheck">
|
||||
<tt class="descname">versionCheck</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.App.versionCheck" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Checks for the latest version of the program. Alerts the
|
||||
user if theirs is outdated. This method is meant to be run
|
||||
in a saeparate thread.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.App.zoom">
|
||||
<tt class="descname">zoom</tt><big>(</big><em>factor</em>, <em>center=None</em><big>)</big><a class="headerlink" href="#FlatCAM.App.zoom" title="Permalink to this definition">¶</a></dt>
|
||||
|
@ -1553,7 +1603,21 @@ it again in descendents.</p>
|
|||
<dt id="FlatCAM.Geometry.from_dict">
|
||||
<tt class="descname">from_dict</tt><big>(</big><em>d</em><big>)</big><a class="headerlink" href="#FlatCAM.Geometry.from_dict" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Sets object’s attributes from a dictionary.
|
||||
Attributes to include are listed in <tt class="docutils literal"><span class="pre">self.ser_attrs</span></tt>.</p>
|
||||
Attributes to include are listed in <tt class="docutils literal"><span class="pre">self.ser_attrs</span></tt>.
|
||||
This method will look only for only and all the
|
||||
attributes in <tt class="docutils literal"><span class="pre">self.ser_attrs</span></tt>. They must all
|
||||
be present. Use only for deserializing saved
|
||||
objects.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>d</strong> (<em>dict</em>) – Dictionary of attributes to set in the object.</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
|
@ -1876,14 +1940,15 @@ read from the given file.</p>
|
|||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>glines</strong> – Gerber code as list of strings, each</td>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>glines</strong> (<em>list</em>) – Gerber code as list of strings, each element being
|
||||
one line of the source file.</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>element being one line of the source file.
|
||||
:type glines: list
|
||||
:return: None
|
||||
:rtype: None</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
|
@ -1950,10 +2015,37 @@ the size (diameter).</li>
|
|||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.Excellon.parse_file">
|
||||
<tt class="descname">parse_file</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#FlatCAM.Excellon.parse_file" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Reads the specified file as array of lines as
|
||||
passes it to <tt class="docutils literal"><span class="pre">parse_lines()</span></tt>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> (<em>str</em>) – The file to be read and parsed.</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.Excellon.parse_lines">
|
||||
<tt class="descname">parse_lines</tt><big>(</big><em>elines</em><big>)</big><a class="headerlink" href="#FlatCAM.Excellon.parse_lines" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Main Excellon parser.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>elines</strong> (<em>list</em>) – List of strings, each being a line of Excellon code.</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
|
@ -2057,21 +2149,24 @@ for the specified tools.</p>
|
|||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>geometry</strong> (<em>Geometry</em>) – Geometry defining the toolpath</li>
|
||||
<li><strong>append</strong> (<em>bool</em>) – Wether to append to self.gcode or re-write it.</li>
|
||||
<li><strong>tooldia</strong> – If given, sets the tooldia property but does</li>
|
||||
<li><strong>tooldia</strong> (<em>bool</em>) – If given, sets the tooldia property but does
|
||||
not affect the process in any other way.</li>
|
||||
<li><strong>tolerance</strong> – All points in the simplified object will be within the
|
||||
tolerance distance of the original geometry.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">None</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">None</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>not affect the process in any other way.
|
||||
:type tooldia: bool
|
||||
:param tolerance: All points in the simplified object will be within the
|
||||
tolerance distance of the original geometry.
|
||||
:return: None
|
||||
:rtype: None</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
|
@ -2084,24 +2179,44 @@ tolerance distance of the original geometry.
|
|||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>linear</strong> – The path to cut along.</li>
|
||||
<li><strong>tolerance</strong> – All points in the simplified object will be within the</li>
|
||||
<li><strong>tolerance</strong> (<em>float</em>) – All points in the simplified object will be within the
|
||||
tolerance distance of the original geometry.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Type:</th><td class="field-body"><p class="first last">Shapely.LinearRing or Shapely.Linear String</p>
|
||||
<tr class="field-even field"><th class="field-name">Type:</th><td class="field-body"><p class="first">Shapely.LinearRing or Shapely.Linear String</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">G-code to cut alon the linear feature.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">str</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>tolerance distance of the original geometry.
|
||||
:type tolerance: float
|
||||
:return: G-code to cut alon the linear feature.
|
||||
:rtype: str</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.CNCjob.offset">
|
||||
<tt class="descname">offset</tt><big>(</big><em>vect</em><big>)</big><a class="headerlink" href="#FlatCAM.CNCjob.offset" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Offsets all the geometry on the XY plane in the object by the
|
||||
given vector.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>vect</strong> (<em>tuple</em>) – (x, y) offset vector.</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.CNCjob.plot2">
|
||||
<tt class="descname">plot2</tt><big>(</big><em>axes, tooldia=None, dpi=75, margin=0.1, color={'C': ['#5E6CFF', '#4650BD'], 'T': ['#F0E24D', '#B5AB3A']}, alpha={'C': 1.0, 'T': 0.3}, tool_tolerance=0.001</em><big>)</big><a class="headerlink" href="#FlatCAM.CNCjob.plot2" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">plot2</tt><big>(</big><em>axes, tooldia=None, dpi=75, margin=0.1, color={'C': ['#5E6CFF', '#4650BD'], 'T': ['#F0E24D', '#B5AB3A']}, alpha={'C': 1.0, 'T': 0.3}, tool_tolerance=0.0005</em><big>)</big><a class="headerlink" href="#FlatCAM.CNCjob.plot2" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Plots the G-code job onto the given axes.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
|
@ -2134,18 +2249,21 @@ of a polygon.</p>
|
|||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>polygon</strong> (<em>Shapely.Polygon</em>) – A Shapely.Polygon</li>
|
||||
<li><strong>tolerance</strong> – All points in the simplified object will be within the</li>
|
||||
<li><strong>tolerance</strong> (<em>float</em>) – All points in the simplified object will be within the
|
||||
tolerance distance of the original geometry.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">G-code to cut along polygon.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">str</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>tolerance distance of the original geometry.
|
||||
:type tolerance: float
|
||||
:return: G-code to cut along polygon.
|
||||
:rtype: str</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
|
@ -2210,10 +2328,16 @@ by the user in their respective forms.</p>
|
|||
<dl class="method">
|
||||
<dt id="FlatCAM.FlatCAMObj.deserialize">
|
||||
<tt class="descname">deserialize</tt><big>(</big><em>obj_dict</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.deserialize" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Re-builds an object from its serialized version.
|
||||
@param obj_dict: Dictionary representing a FlatCAMObj
|
||||
@type obj_dict: dict
|
||||
@return None</p>
|
||||
<dd><p>Re-builds an object from its serialized version.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>obj_dict</strong> (<em>dict</em>) – Dictionary representing a FlatCAMObj</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>:return None</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
|
@ -2239,19 +2363,43 @@ clears them. Descendants must do the actual plotting.</p>
|
|||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.FlatCAMObj.read_form_item">
|
||||
<tt class="descname">read_form_item</tt><big>(</big><em>option</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.read_form_item" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Reads the specified option from the UI form into <tt class="docutils literal"><span class="pre">self.options</span></tt>.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>option</strong> (<em>str</em>) – Name of the option.</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.FlatCAMObj.serialize">
|
||||
<tt class="descname">serialize</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.serialize" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a representation of the object as a dictionary so
|
||||
it can be later exported as JSON. Override this method.
|
||||
@return: Dictionary representing the object
|
||||
@rtype: dict</p>
|
||||
it can be later exported as JSON. Override this method.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Dictionary representing the object</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.FlatCAMObj.set_form_item">
|
||||
<tt class="descname">set_form_item</tt><big>(</big><em>option</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.set_form_item" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Copies the specified options to the UI form.</p>
|
||||
<dd><p>Copies the specified option to the UI form.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
|
@ -2342,7 +2490,7 @@ and options.</p>
|
|||
<dl class="class">
|
||||
<dt id="FlatCAM.FlatCAMExcellon">
|
||||
<em class="property">class </em><tt class="descclassname">FlatCAM.</tt><tt class="descname">FlatCAMExcellon</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMExcellon" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Represents Excellon code.</p>
|
||||
<dd><p>Represents Excellon/Drill code.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
|
@ -2356,6 +2504,42 @@ and options.</p>
|
|||
<em class="property">class </em><tt class="descclassname">FlatCAM.</tt><tt class="descname">FlatCAMGeometry</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGeometry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Geometric object not associated with a specific
|
||||
format.</p>
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.FlatCAMGeometry.offset">
|
||||
<tt class="descname">offset</tt><big>(</big><em>vect</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGeometry.offset" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Offsets all geometry by a given vector/</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>vect</strong> (<em>tuple</em>) – (x, y) vector by which to offset the object’s geometry.</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="FlatCAM.FlatCAMGeometry.scale">
|
||||
<tt class="descname">scale</tt><big>(</big><em>factor</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGeometry.scale" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Scales all geometry by a given factor.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>factor</strong> (<em>float</em>) – Factor by which to scale the object’s geometry/</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue