- added a message to show if voronoi_diagram method can be used (require Shapely >= 1.8)

This commit is contained in:
Marius Stanciu
2020-10-22 11:14:21 +03:00
committed by Marius
parent 0ad9d3ebd1
commit 5e4db95a33
2 changed files with 22 additions and 9 deletions

View File

@@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta
================================================= =================================================
22.10.2020
- added a message to show if voronoi_diagram method can be used (require Shapely >= 1.8)
21.10.2020 21.10.2020
- in Geometry Object fixed the issue with not using the End X-Y value and also made some other updates here - in Geometry Object fixed the issue with not using the End X-Y value and also made some other updates here

View File

@@ -26,9 +26,10 @@ from shapely.geometry import Point, MultiPoint, Polygon, LineString, box
import shapely.affinity as affinity import shapely.affinity as affinity
try: try:
from shapely.ops import voronoi_diagram from shapely.ops import voronoi_diagram
VORONOI_ENABLED = True
# from appCommon.Common import voronoi_diagram # from appCommon.Common import voronoi_diagram
except Exception: except Exception:
pass VORONOI_ENABLED = False
import os import os
import sys import sys
@@ -771,9 +772,13 @@ class CNCJobObject(FlatCAMObj, CNCjob):
al_method = self.ui.al_method_radio.get_value() al_method = self.ui.al_method_radio.get_value()
if al_method == 'v': if al_method == 'v':
self.generate_voronoi_geometry(pts=vor_pts_list) if VORONOI_ENABLED is True:
# generate Probing GCode self.generate_voronoi_geometry(pts=vor_pts_list)
self.probing_gcode_text = self.probing_gcode(storage=self.al_voronoi_geo_storage) # generate Probing GCode
self.probing_gcode_text = self.probing_gcode(storage=self.al_voronoi_geo_storage)
else:
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Voronoi function can not be loaded.\n"
"Shapely >= 1.8 is required"))
else: else:
self.generate_bilinear_geometry(pts=bl_pts_list) self.generate_bilinear_geometry(pts=bl_pts_list)
# generate Probing GCode # generate Probing GCode
@@ -1042,12 +1047,16 @@ class CNCJobObject(FlatCAMObj, CNCjob):
al_method = self.ui.al_method_radio.get_value() al_method = self.ui.al_method_radio.get_value()
if al_method == 'v': if al_method == 'v':
pts_list = [] if VORONOI_ENABLED is True:
for k in self.al_voronoi_geo_storage: pts_list = []
pts_list.append(self.al_voronoi_geo_storage[k]['point']) for k in self.al_voronoi_geo_storage:
self.generate_voronoi_geometry(pts=pts_list) pts_list.append(self.al_voronoi_geo_storage[k]['point'])
self.generate_voronoi_geometry(pts=pts_list)
self.probing_gcode_text = self.probing_gcode(self.al_voronoi_geo_storage) self.probing_gcode_text = self.probing_gcode(self.al_voronoi_geo_storage)
else:
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Voronoi function can not be loaded.\n"
"Shapely >= 1.8 is required"))
# rebuild the al table # rebuild the al table
self.build_al_table_sig.emit() self.build_al_table_sig.emit()