- In Geometry Editor I fixed bug in Arc modes. Arc mode shortcut key is now key 'M' and arc direction change shortcut key is 'D'

This commit is contained in:
Marius Stanciu 2019-04-14 02:46:55 +03:00
parent 081231aca4
commit e92cab2e96
3 changed files with 18 additions and 4 deletions

View File

@ -15,6 +15,7 @@ CAD program, and create G-Code for Isolation routing.
- Gerber Editor: a disabled/enabled sequence for the VisPy cursor on Gerber edit make the graphics better
- Editors: activated an old function that was no longer active: each tool can have it's own set of shortcut keys, the Editor general shortcut keys that are letters are overridden
- Gerber and Geometry editors, when using the Backspace keys for certain tools, they will backtrack one point but now the utility geometry is immediately updated
- In Geometry Editor I fixed bug in Arc modes. Arc mode shortcut key is now key 'M' and arc direction change shortcut key is 'D'
13.04.2019

View File

@ -7589,7 +7589,7 @@ def three_point_circle(p1, p2, p3):
center = a1 + b1 * T[0]
# Radius
radius = norm(center - p1)
radius = np.linalg.norm(center - p1)
return center, radius, T[0]

View File

@ -22,6 +22,7 @@ from shapely.ops import cascaded_union
import shapely.affinity as affinity
from numpy import arctan2, Inf, array, sqrt, sign, dot
from numpy.linalg import norm
from rtree import index as rtindex
from flatcamGUI.GUIElements import OptionalInputSection, FCCheckBox, FCEntry, FCComboBox, FCTextAreaRich, \
@ -1989,11 +1990,21 @@ class FCArc(FCShapeTool):
self.points.append(point)
if len(self.points) == 1:
self.draw_app.app.inform.emit(_("Click on Start arc point ..."))
if self.mode == 'c12':
self.draw_app.app.inform.emit(_("Click on Start point ..."))
elif self.mode == '132':
self.draw_app.app.inform.emit(_("Click on Point3 ..."))
else:
self.draw_app.app.inform.emit(_("Click on Stop point to complete ..."))
return "Click on 1st point ..."
if len(self.points) == 2:
self.draw_app.app.inform.emit(_("Click on End arc point to complete ..."))
if self.mode == 'c12':
self.draw_app.app.inform.emit(_("Click on Stop point to complete ..."))
elif self.mode == '132':
self.draw_app.app.inform.emit(_("Click on Point2 ..."))
else:
self.draw_app.app.inform.emit(_("Click on Center point to complete ..."))
return "Click on 2nd point to complete ..."
if len(self.points) == 3:
@ -2010,11 +2021,13 @@ class FCArc(FCShapeTool):
if key == 'M' or key == QtCore.Qt.Key_M:
if self.mode == 'c12':
self.mode = '12c'
return _('Mode: Start -> Stop -> Center. Click on Start point ...')
elif self.mode == '12c':
self.mode = '132'
return _('Mode: Point1 -> Point3 -> Point2. Click on 1st point ...')
else:
self.mode = 'c12'
return _('Mode: %s') % self.mode
return _('Mode: Center -> Start -> Stop. Click on Center ...')
def utility_geometry(self, data=None):
if len(self.points) == 1: # Show the radius