- fixed bugs in Minimum Distance Tool
This commit is contained in:
@@ -1275,7 +1275,7 @@ class ToolCalibration(FlatCAMTool):
|
||||
if obj.tools:
|
||||
obj_init.tools = deepcopy(obj.tools)
|
||||
except Exception as ee:
|
||||
log.debug("App.on_copy_object() --> %s" % str(ee))
|
||||
log.debug("ToolCalibration.new_calibrated_object.initialize_geometry() --> %s" % str(ee))
|
||||
|
||||
obj_init.scale(xfactor=scalex, yfactor=scaley, point=(origin_x, origin_y))
|
||||
obj_init.skew(angle_x=skewx, angle_y=skewy, point=(origin_x, origin_y))
|
||||
@@ -1301,7 +1301,7 @@ class ToolCalibration(FlatCAMTool):
|
||||
if obj.tools:
|
||||
obj_init.tools = deepcopy(obj.tools)
|
||||
except Exception as err:
|
||||
log.debug("App.on_copy_object() --> %s" % str(err))
|
||||
log.debug("ToolCalibration.new_calibrated_object.initialize_gerber() --> %s" % str(err))
|
||||
|
||||
obj_init.scale(xfactor=scalex, yfactor=scaley, point=(origin_x, origin_y))
|
||||
obj_init.skew(angle_x=skewx, angle_y=skewy, point=(origin_x, origin_y))
|
||||
|
||||
@@ -11,7 +11,8 @@ from flatcamGUI.VisPyVisuals import *
|
||||
from flatcamGUI.GUIElements import FCEntry
|
||||
|
||||
from shapely.ops import nearest_points
|
||||
from shapely.geometry import Point
|
||||
from shapely.geometry import Point, MultiPolygon
|
||||
from shapely.ops import cascaded_union
|
||||
|
||||
import math
|
||||
import logging
|
||||
@@ -205,6 +206,17 @@ class DistanceMin(FlatCAMTool):
|
||||
str(len(selected_objs))))
|
||||
return
|
||||
else:
|
||||
if isinstance(selected_objs[0].solid_geometry, list):
|
||||
try:
|
||||
selected_objs[0].solid_geometry = MultiPolygon(selected_objs[0].solid_geometry)
|
||||
except Exception:
|
||||
selected_objs[0].solid_geometry = cascaded_union(selected_objs[0].solid_geometry)
|
||||
|
||||
try:
|
||||
selected_objs[1].solid_geometry = MultiPolygon(selected_objs[1].solid_geometry)
|
||||
except Exception:
|
||||
selected_objs[1].solid_geometry = cascaded_union(selected_objs[1].solid_geometry)
|
||||
|
||||
first_pos, last_pos = nearest_points(selected_objs[0].solid_geometry, selected_objs[1].solid_geometry)
|
||||
|
||||
elif self.app.call_source == 'geo_editor':
|
||||
@@ -278,7 +290,7 @@ class DistanceMin(FlatCAMTool):
|
||||
)
|
||||
|
||||
if d != 0:
|
||||
self.app.inform.emit("{tx1}: {tx2} D(x) = {d_x} | D(y) = {d_y} | (tx3} = {d_z}".format(
|
||||
self.app.inform.emit("{tx1}: {tx2} D(x) = {d_x} | D(y) = {d_y} | {tx3} = {d_z}".format(
|
||||
tx1=_("MEASURING"),
|
||||
tx2=_("Result"),
|
||||
tx3=_("Distance"),
|
||||
|
||||
Reference in New Issue
Block a user