Some classes for drawing. Solved bug of CNC jobs not starting at origin and missing return to origin.
This commit is contained in:
90
FlatCAM.py
90
FlatCAM.py
@@ -25,6 +25,7 @@ from camlib import *
|
|||||||
import sys
|
import sys
|
||||||
import urllib
|
import urllib
|
||||||
import copy
|
import copy
|
||||||
|
import random
|
||||||
|
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
@@ -980,10 +981,17 @@ class App:
|
|||||||
:rtype: None
|
:rtype: None
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Check for existing name
|
### Check for existing name
|
||||||
if name in self.stuff:
|
if name in self.stuff:
|
||||||
self.info("Rename " + name + " in project first.")
|
## Create a new name
|
||||||
return None
|
# Ends with number?
|
||||||
|
match = re.search(r'(.*[^\d])?(\d+)$', name)
|
||||||
|
if match: # Yes: Increment the number!
|
||||||
|
base = match.group(1) or ''
|
||||||
|
num = int(match.group(2))
|
||||||
|
name = base + str(num + 1)
|
||||||
|
else: # No: add a number!
|
||||||
|
name += "_1"
|
||||||
|
|
||||||
# Create object
|
# Create object
|
||||||
classdict = {
|
classdict = {
|
||||||
@@ -2690,26 +2698,76 @@ class App:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
class BaseDraw:
|
||||||
|
def __init__(self, plotcanvas, name=None):
|
||||||
|
"""
|
||||||
|
|
||||||
|
:param plotcanvas: The PlotCanvas where the drawing tool will operate.
|
||||||
|
:type plotcanvas: PlotCanvas
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.plotcanvas = plotcanvas
|
||||||
|
|
||||||
|
# Must have unique axes
|
||||||
|
charset = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890"
|
||||||
|
self.name = name or [random.choice(charset) for i in range(20)]
|
||||||
|
self.axes = self.plotcanvas.new_axes(self.name)
|
||||||
|
|
||||||
|
|
||||||
|
class DrawingObject(BaseDraw):
|
||||||
|
def __init__(self, plotcanvas, name=None):
|
||||||
|
"""
|
||||||
|
Possible objects are:
|
||||||
|
|
||||||
|
* Point
|
||||||
|
* Line
|
||||||
|
* Rectangle
|
||||||
|
* Circle
|
||||||
|
* Polygon
|
||||||
|
"""
|
||||||
|
|
||||||
|
BaseDraw.__init__(self, plotcanvas)
|
||||||
|
self.properties = {}
|
||||||
|
|
||||||
|
def plot(self):
|
||||||
|
return
|
||||||
|
|
||||||
|
def update_plot(self):
|
||||||
|
self.axes.cla()
|
||||||
|
self.plot()
|
||||||
|
self.plotcanvas.auto_adjust_axes()
|
||||||
|
|
||||||
|
|
||||||
|
class DrawingPoint(DrawingObject):
|
||||||
|
def __init__(self, plotcanvas, name=None, coord=None):
|
||||||
|
DrawingObject.__init__(self, plotcanvas)
|
||||||
|
|
||||||
|
self.properties.update({
|
||||||
|
"coordinate": coord
|
||||||
|
})
|
||||||
|
|
||||||
|
def plot(self):
|
||||||
|
x, y = self.properties["coordinate"]
|
||||||
|
self.axes.plot(x, y, 'o')
|
||||||
|
|
||||||
|
|
||||||
class Measurement:
|
class Measurement:
|
||||||
def __init__(self, container, axes, click_subscibers, move_subscribers, update=None):
|
def __init__(self, container, axes, click_subscibers, move_subscribers, update=None):
|
||||||
self.update = update
|
self.update = update
|
||||||
self.container = container
|
self.container = container
|
||||||
self.frame = None
|
self.frame = None
|
||||||
self.label = None
|
self.label = None
|
||||||
self.axes = axes
|
|
||||||
self.click_subscribers = click_subscibers
|
self.click_subscribers = click_subscibers
|
||||||
self.move_subscribers = move_subscribers
|
self.move_subscribers = move_subscribers
|
||||||
self.point1 = None
|
self.point1 = None
|
||||||
self.point2 = None
|
self.point2 = None
|
||||||
self.active = False
|
self.active = False
|
||||||
# self.at = None # AnchoredText object on plot
|
|
||||||
|
|
||||||
def toggle_active(self, *args):
|
def toggle_active(self, *args):
|
||||||
if self.active: # Deactivate
|
if self.active: # Deactivate
|
||||||
self.active = False
|
self.active = False
|
||||||
self.move_subscribers.pop("meas")
|
self.move_subscribers.pop("meas")
|
||||||
self.click_subscribers.pop("meas")
|
self.click_subscribers.pop("meas")
|
||||||
# self.at.remove()
|
|
||||||
self.container.remove(self.frame)
|
self.container.remove(self.frame)
|
||||||
if self.update is not None:
|
if self.update is not None:
|
||||||
self.update()
|
self.update()
|
||||||
@@ -2726,34 +2784,24 @@ class Measurement:
|
|||||||
align.set(0, 0.5, 0, 0)
|
align.set(0, 0.5, 0, 0)
|
||||||
align.set_padding(4, 4, 4, 4)
|
align.set_padding(4, 4, 4, 4)
|
||||||
self.label = Gtk.Label()
|
self.label = Gtk.Label()
|
||||||
self.label.set_label("Measuring tool...")
|
self.label.set_label("Click on a reference point...")
|
||||||
align.add(self.label)
|
abox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 10)
|
||||||
|
abox.pack_start(Gtk.Image.new_from_file('share/measure16.png'), False, False, 0)
|
||||||
|
abox.pack_start(self.label, False, False, 0)
|
||||||
|
align.add(abox)
|
||||||
self.frame.add(align)
|
self.frame.add(align)
|
||||||
self.frame.set_size_request(200, 30)
|
|
||||||
self.frame.set_hexpand(True)
|
|
||||||
self.container.pack_end(self.frame, False, True, 1)
|
self.container.pack_end(self.frame, False, True, 1)
|
||||||
self.frame.show_all()
|
self.frame.show_all()
|
||||||
align.show_all()
|
|
||||||
self.label.show_all()
|
|
||||||
self.container.queue_draw()
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def on_move(self, event):
|
def on_move(self, event):
|
||||||
# try:
|
|
||||||
# self.at.remove()
|
|
||||||
# except:
|
|
||||||
# pass
|
|
||||||
if self.point1 is None:
|
if self.point1 is None:
|
||||||
# self.at = AnchoredText("Click on a reference point...")
|
|
||||||
self.label.set_label("Click on a reference point...")
|
self.label.set_label("Click on a reference point...")
|
||||||
else:
|
else:
|
||||||
dx = event.xdata - self.point1[0]
|
dx = event.xdata - self.point1[0]
|
||||||
dy = event.ydata - self.point1[1]
|
dy = event.ydata - self.point1[1]
|
||||||
d = sqrt(dx**2 + dy**2)
|
d = sqrt(dx**2 + dy**2)
|
||||||
# self.at = AnchoredText("D = %.4f\nD(x) = %.4f\nD(y) = %.4f" % (d, dx, dy),
|
|
||||||
# loc=2, prop={'size': 14}, frameon=False)
|
|
||||||
self.label.set_label("D = %.4f D(x) = %.4f D(y) = %.4f" % (d, dx, dy))
|
self.label.set_label("D = %.4f D(x) = %.4f D(y) = %.4f" % (d, dx, dy))
|
||||||
# self.axes.add_artist(self.at)
|
|
||||||
if self.update is not None:
|
if self.update is not None:
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
|||||||
817
FlatCAM.ui
817
FlatCAM.ui
@@ -57,6 +57,21 @@ THE SOFTWARE.</property>
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkImage" id="image1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="stock">gtk-open</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkImage" id="image10">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="stock">gtk-page-setup</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkImage" id="image16">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="stock">gtk-info</property>
|
||||||
|
</object>
|
||||||
<object class="GtkImage" id="image2">
|
<object class="GtkImage" id="image2">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
@@ -97,21 +112,6 @@ THE SOFTWARE.</property>
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="stock">gtk-open</property>
|
<property name="stock">gtk-open</property>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkImage" id="image1">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="stock">gtk-open</property>
|
|
||||||
</object>
|
|
||||||
<object class="GtkImage" id="image10">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="stock">gtk-page-setup</property>
|
|
||||||
</object>
|
|
||||||
<object class="GtkImage" id="image16">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="stock">gtk-info</property>
|
|
||||||
</object>
|
|
||||||
<object class="GtkOffscreenWindow" id="offscreenwindow_dblsided">
|
<object class="GtkOffscreenWindow" id="offscreenwindow_dblsided">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
@@ -472,6 +472,397 @@ THE SOFTWARE.</property>
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkOffscreenWindow" id="offscrwindow_cncjob">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow" id="sw_cncjob">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="hscrollbar_policy">never</property>
|
||||||
|
<property name="shadow_type">in</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport" id="vp_cncjob">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box_cncjob">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_left">5</property>
|
||||||
|
<property name="margin_right">5</property>
|
||||||
|
<property name="margin_top">5</property>
|
||||||
|
<property name="margin_bottom">5</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box35">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage" id="image15">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="pixbuf">share/cnc32.png</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label17">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="ypad">3</property>
|
||||||
|
<property name="label" translatable="yes">CNC Job Object</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="weight" value="semibold"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box7">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label18">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="xpad">3</property>
|
||||||
|
<property name="label" translatable="yes">Name: </property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="entry_text_cncjob_name">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="invisible_char">●</property>
|
||||||
|
<property name="invisible_char_set">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label19">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">5</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="ypad">3</property>
|
||||||
|
<property name="label" translatable="yes">Plot Options:</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="weight" value="semibold"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="cb_cncjob_plot">
|
||||||
|
<property name="label" translatable="yes">Plot</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
<signal name="toggled" handler="on_cb_plot_toggled" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box9">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">3</property>
|
||||||
|
<property name="margin_bottom">3</property>
|
||||||
|
<property name="spacing">3</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label22">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
<property name="label" translatable="yes">Tool diam:</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="entry_eval_cncjob_tooldia">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="invisible_char">●</property>
|
||||||
|
<property name="invisible_char_set">True</property>
|
||||||
|
<signal name="activate" handler="on_entry_eval_activate" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">6</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button11">
|
||||||
|
<property name="label" translatable="yes">Update Plot</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<signal name="activate" handler="on_update_plot" swapped="no"/>
|
||||||
|
<signal name="clicked" handler="on_update_plot" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">7</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label26">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">3</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="ypad">3</property>
|
||||||
|
<property name="label" translatable="yes">Export G-Code:</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="weight" value="semibold"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">8</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button3">
|
||||||
|
<property name="label" translatable="yes">Export</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<signal name="activate" handler="on_cncjob_exportgcode" swapped="no"/>
|
||||||
|
<signal name="clicked" handler="on_cncjob_exportgcode" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">9</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label45">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">3</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="ypad">3</property>
|
||||||
|
<property name="label" translatable="yes">Scale:</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="weight" value="semibold"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">10</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box13">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">3</property>
|
||||||
|
<property name="margin_bottom">3</property>
|
||||||
|
<property name="spacing">3</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label46">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
<property name="label" translatable="yes">Factor:</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="entry_eval_cncjob_scalefactor">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="invisible_char">●</property>
|
||||||
|
<property name="text" translatable="yes">1.0</property>
|
||||||
|
<property name="invisible_char_set">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">11</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button14">
|
||||||
|
<property name="label" translatable="yes">Scale</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<signal name="activate" handler="on_scale_object" swapped="no"/>
|
||||||
|
<signal name="clicked" handler="on_scale_object" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">12</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label93">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">3</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="ypad">3</property>
|
||||||
|
<property name="label" translatable="yes">Offset:</property>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="weight" value="semibold"/>
|
||||||
|
</attributes>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">13</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box26">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_top">3</property>
|
||||||
|
<property name="margin_bottom">3</property>
|
||||||
|
<property name="spacing">3</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label94">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
<property name="label" translatable="yes">Offset Vector: </property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="entry_eval_cncjob_offset">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="invisible_char">●</property>
|
||||||
|
<property name="text" translatable="yes">(0.0, 0.0)</property>
|
||||||
|
<property name="invisible_char_set">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">14</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button21">
|
||||||
|
<property name="label" translatable="yes">Offset</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<signal name="activate" handler="on_offset_object" swapped="no"/>
|
||||||
|
<signal name="clicked" handler="on_offset_object" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">15</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
<object class="GtkOffscreenWindow" id="offscrwindow_excellon">
|
<object class="GtkOffscreenWindow" id="offscrwindow_excellon">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
@@ -2552,397 +2943,6 @@ this object.</property>
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkOffscreenWindow" id="offscrwindow_cncjob">
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkScrolledWindow" id="sw_cncjob">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="hscrollbar_policy">never</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkViewport" id="vp_cncjob">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box_cncjob">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_left">5</property>
|
|
||||||
<property name="margin_right">5</property>
|
|
||||||
<property name="margin_top">5</property>
|
|
||||||
<property name="margin_bottom">5</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box35">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage" id="image15">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="pixbuf">share/cnc32.png</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label17">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="ypad">3</property>
|
|
||||||
<property name="label" translatable="yes">CNC Job Object</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="weight" value="semibold"/>
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box7">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label18">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="xpad">3</property>
|
|
||||||
<property name="label" translatable="yes">Name: </property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="entry_text_cncjob_name">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="invisible_char">●</property>
|
|
||||||
<property name="invisible_char_set">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label19">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">5</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="ypad">3</property>
|
|
||||||
<property name="label" translatable="yes">Plot Options:</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="weight" value="semibold"/>
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkCheckButton" id="cb_cncjob_plot">
|
|
||||||
<property name="label" translatable="yes">Plot</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">False</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="active">True</property>
|
|
||||||
<property name="draw_indicator">True</property>
|
|
||||||
<signal name="toggled" handler="on_cb_plot_toggled" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">3</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box9">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">3</property>
|
|
||||||
<property name="margin_bottom">3</property>
|
|
||||||
<property name="spacing">3</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label22">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="xalign">1</property>
|
|
||||||
<property name="label" translatable="yes">Tool diam:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="entry_eval_cncjob_tooldia">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="invisible_char">●</property>
|
|
||||||
<property name="invisible_char_set">True</property>
|
|
||||||
<signal name="activate" handler="on_entry_eval_activate" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">6</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="button11">
|
|
||||||
<property name="label" translatable="yes">Update Plot</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<signal name="activate" handler="on_update_plot" swapped="no"/>
|
|
||||||
<signal name="clicked" handler="on_update_plot" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">7</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label26">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">3</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="ypad">3</property>
|
|
||||||
<property name="label" translatable="yes">Export G-Code:</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="weight" value="semibold"/>
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">8</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="button3">
|
|
||||||
<property name="label" translatable="yes">Export</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<signal name="activate" handler="on_cncjob_exportgcode" swapped="no"/>
|
|
||||||
<signal name="clicked" handler="on_cncjob_exportgcode" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">9</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label45">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">3</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="ypad">3</property>
|
|
||||||
<property name="label" translatable="yes">Scale:</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="weight" value="semibold"/>
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">10</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box13">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">3</property>
|
|
||||||
<property name="margin_bottom">3</property>
|
|
||||||
<property name="spacing">3</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label46">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="xalign">1</property>
|
|
||||||
<property name="label" translatable="yes">Factor:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="entry_eval_cncjob_scalefactor">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="invisible_char">●</property>
|
|
||||||
<property name="text" translatable="yes">1.0</property>
|
|
||||||
<property name="invisible_char_set">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">11</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="button14">
|
|
||||||
<property name="label" translatable="yes">Scale</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<signal name="activate" handler="on_scale_object" swapped="no"/>
|
|
||||||
<signal name="clicked" handler="on_scale_object" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">12</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label93">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">3</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="ypad">3</property>
|
|
||||||
<property name="label" translatable="yes">Offset:</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="weight" value="semibold"/>
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">13</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box26">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">3</property>
|
|
||||||
<property name="margin_bottom">3</property>
|
|
||||||
<property name="spacing">3</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label94">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="xalign">1</property>
|
|
||||||
<property name="label" translatable="yes">Offset Vector: </property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="entry_eval_cncjob_offset">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="invisible_char">●</property>
|
|
||||||
<property name="text" translatable="yes">(0.0, 0.0)</property>
|
|
||||||
<property name="invisible_char_set">True</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">14</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="button21">
|
|
||||||
<property name="label" translatable="yes">Offset</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<signal name="activate" handler="on_offset_object" swapped="no"/>
|
|
||||||
<signal name="clicked" handler="on_offset_object" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">15</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<object class="GtkWindow" id="window1">
|
<object class="GtkWindow" id="window1">
|
||||||
<property name="width_request">600</property>
|
<property name="width_request">600</property>
|
||||||
<property name="height_request">400</property>
|
<property name="height_request">400</property>
|
||||||
@@ -4331,7 +4331,7 @@ to overlap each pass.</property>
|
|||||||
<object class="GtkLabel" id="label67">
|
<object class="GtkLabel" id="label67">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xpad">4</property>
|
<property name="xpad">5</property>
|
||||||
<property name="label" translatable="yes"><b>Excellon Objects</b></property>
|
<property name="label" translatable="yes"><b>Excellon Objects</b></property>
|
||||||
<property name="use_markup">True</property>
|
<property name="use_markup">True</property>
|
||||||
</object>
|
</object>
|
||||||
@@ -4707,7 +4707,7 @@ to overlap each pass.</property>
|
|||||||
<object class="GtkLabel" id="label99">
|
<object class="GtkLabel" id="label99">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xpad">4</property>
|
<property name="xpad">5</property>
|
||||||
<property name="label" translatable="yes"><b>Geometry Objects</b></property>
|
<property name="label" translatable="yes"><b>Geometry Objects</b></property>
|
||||||
<property name="use_markup">True</property>
|
<property name="use_markup">True</property>
|
||||||
</object>
|
</object>
|
||||||
@@ -4813,6 +4813,7 @@ to overlap each pass.</property>
|
|||||||
<object class="GtkLabel" id="label74">
|
<object class="GtkLabel" id="label74">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="xpad">5</property>
|
||||||
<property name="label" translatable="yes"><b>CNC Job Objects</b></property>
|
<property name="label" translatable="yes"><b>CNC Job Objects</b></property>
|
||||||
<property name="use_markup">True</property>
|
<property name="use_markup">True</property>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
19
camlib.py
19
camlib.py
@@ -818,23 +818,21 @@ class Gerber (Geometry):
|
|||||||
self.flash_geometry.append(obround)
|
self.flash_geometry.append(obround)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if aperture['type'] == 'P': #Regular polygon
|
if aperture['type'] == 'P': # Regular polygon
|
||||||
loc = flash['loc']
|
loc = flash['loc']
|
||||||
diam = aperture['diam']
|
diam = aperture['diam']
|
||||||
nVertices = aperture['nVertices']
|
nVertices = aperture['nVertices']
|
||||||
points = []
|
points = []
|
||||||
for i in range(0,nVertices):
|
for i in range(0, nVertices):
|
||||||
x = loc[0] + diam * (cos(2 * pi * i / nVertices))
|
x = loc[0] + diam * (cos(2 * pi * i / nVertices))
|
||||||
y = loc[1] + diam * (sin(2 * pi * i / nVertices))
|
y = loc[1] + diam * (sin(2 * pi * i / nVertices))
|
||||||
points.append((x,y))
|
points.append((x, y))
|
||||||
ply = Polygon(points)
|
ply = Polygon(points)
|
||||||
if 'rotation' in aperture:
|
if 'rotation' in aperture:
|
||||||
ply = affinity.rotate(ply, aperture['rotation'])
|
ply = affinity.rotate(ply, aperture['rotation'])
|
||||||
self.flash_geometry.append(ply)
|
self.flash_geometry.append(ply)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print "WARNING: Aperture type %s not implemented" % (aperture['type'])
|
print "WARNING: Aperture type %s not implemented" % (aperture['type'])
|
||||||
|
|
||||||
def create_geometry(self):
|
def create_geometry(self):
|
||||||
@@ -1433,12 +1431,12 @@ class CNCjob(Geometry):
|
|||||||
|
|
||||||
# Current path: temporary storage until tool is
|
# Current path: temporary storage until tool is
|
||||||
# lifted or lowered.
|
# lifted or lowered.
|
||||||
path = []
|
path = [(0, 0)]
|
||||||
|
|
||||||
# Process every instruction
|
# Process every instruction
|
||||||
for gobj in gobjs:
|
for gobj in gobjs:
|
||||||
|
|
||||||
# Changing height:
|
## Changing height
|
||||||
if 'Z' in gobj:
|
if 'Z' in gobj:
|
||||||
if ('X' in gobj or 'Y' in gobj) and gobj['Z'] != current['Z']:
|
if ('X' in gobj or 'Y' in gobj) and gobj['Z'] != current['Z']:
|
||||||
print "WARNING: Non-orthogonal motion: From", current
|
print "WARNING: Non-orthogonal motion: From", current
|
||||||
@@ -1490,6 +1488,13 @@ class CNCjob(Geometry):
|
|||||||
for code in gobj:
|
for code in gobj:
|
||||||
current[code] = gobj[code]
|
current[code] = gobj[code]
|
||||||
|
|
||||||
|
# There might not be a change in height at the
|
||||||
|
# end, therefore, see here too if there is
|
||||||
|
# a final path.
|
||||||
|
if len(path) > 1:
|
||||||
|
geometry.append({"geom": LineString(path),
|
||||||
|
"kind": kind})
|
||||||
|
|
||||||
self.gcode_parsed = geometry
|
self.gcode_parsed = geometry
|
||||||
return geometry
|
return geometry
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user