- made the Minimum Distance Tool more precise for the Excellon Editor since in the Excellon Editor the holes shape are represented as a cross line but in reality they should be evaluated as circles

This commit is contained in:
Marius Stanciu 2019-09-30 03:57:15 +03:00 committed by Marius
parent 34062e8296
commit 3211fedca0
2 changed files with 14 additions and 1 deletions

View File

@ -16,6 +16,7 @@ CAD program, and create G-Code for Isolation routing.
- added a new tool named Minimum Distance Tool who will calculate the minimum distance between two objects; key shortcut: SHIFT + M
- finished the Minimum Distance Tool in case of using it at the object level (not in Editors)
- completed the Minimum Distance Tool by adding the usage in Editors
- made the Minimum Distance Tool more precise for the Excellon Editor since in the Excellon Editor the holes shape are represented as a cross line but in reality they should be evaluated as circles
29.09.2019

View File

@ -214,7 +214,19 @@ class DistanceMin(FlatCAMTool):
str(len(selected_objs))))
return
else:
first_pos, last_pos = nearest_points(selected_objs[0].geo, selected_objs[1].geo)
# the objects are really MultiLinesStrings made out of 2 lines in cross shape
xmin, ymin, xmax, ymax = selected_objs[0].geo.bounds
first_geo_radius = (xmax - xmin) / 2
first_geo_center = Point(xmin + first_geo_radius, ymin + first_geo_radius)
first_geo = first_geo_center.buffer(first_geo_radius)
# the objects are really MultiLinesStrings made out of 2 lines in cross shape
xmin, ymin, xmax, ymax = selected_objs[1].geo.bounds
last_geo_radius = (xmax - xmin) / 2
last_geo_center = Point(xmin + last_geo_radius, ymin + last_geo_radius)
last_geo = last_geo_center.buffer(last_geo_radius)
first_pos, last_pos = nearest_points(first_geo, last_geo)
elif self.app.call_source == 'grb_editor':
selected_objs = self.app.grb_editor.selected
if len(selected_objs) != 2: