- in Geometry Editor - simplification method is now threaded and optimized
This commit is contained in:
@@ -14,6 +14,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- in Geometry Editor - added new information's (length, coordinates and vertex points number) for the geometric element selected in the Geometry Table
|
- in Geometry Editor - added new information's (length, coordinates and vertex points number) for the geometric element selected in the Geometry Table
|
||||||
- in Geometry Editor - added more parameters displayed for the geometric elements selected in the Geometry Table: is_valid, is_empty, is_ccw, is_simple, is_ring
|
- in Geometry Editor - added more parameters displayed for the geometric elements selected in the Geometry Table: is_valid, is_empty, is_ccw, is_simple, is_ring
|
||||||
- in Geometry Editor - added a new feature: Simplification. It will greatly reduce the number of vertex points in a geometry element selected in the Geometry Table thus potentially greatly reducing the resulting GCode number of lines
|
- in Geometry Editor - added a new feature: Simplification. It will greatly reduce the number of vertex points in a geometry element selected in the Geometry Table thus potentially greatly reducing the resulting GCode number of lines
|
||||||
|
- in Geometry Editor - simplification method is now threaded and optimized
|
||||||
|
|
||||||
26.11.2020
|
26.11.2020
|
||||||
|
|
||||||
|
|||||||
@@ -3871,22 +3871,29 @@ class AppGeoEditor(QtCore.QObject):
|
|||||||
tol = self.geo_tol_entry.get_value()
|
tol = self.geo_tol_entry.get_value()
|
||||||
|
|
||||||
selected_tree_items = self.tw.selectedItems()
|
selected_tree_items = self.tw.selectedItems()
|
||||||
for sel in selected_tree_items:
|
|
||||||
for obj_shape in self.storage.get_objects():
|
|
||||||
try:
|
|
||||||
if id(obj_shape) == int(sel.text(0)):
|
|
||||||
selected_shapes.append(obj_shape)
|
|
||||||
selected_shapes_geos.append(obj_shape.geo.simplify(tolerance=tol))
|
|
||||||
except ValueError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
for shape in selected_shapes:
|
def task_job():
|
||||||
self.delete_shape(shape=shape)
|
with self.app.proc_container.new('%s...' % _("Working")):
|
||||||
|
for sel in selected_tree_items:
|
||||||
|
for obj_shape in self.storage.get_objects():
|
||||||
|
try:
|
||||||
|
if id(obj_shape) == int(sel.text(0)):
|
||||||
|
selected_shapes.append(obj_shape)
|
||||||
|
selected_shapes_geos.append(obj_shape.geo.simplify(tolerance=tol))
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
for geo in selected_shapes_geos:
|
for shape in selected_shapes:
|
||||||
self.add_shape(DrawToolShape(geo))
|
self.delete_shape(shape=shape)
|
||||||
|
|
||||||
self.build_ui_sig.emit()
|
for geo in selected_shapes_geos:
|
||||||
|
self.add_shape(DrawToolShape(geo), build_ui=False)
|
||||||
|
|
||||||
|
self.plot_all()
|
||||||
|
|
||||||
|
self.build_ui_sig.emit()
|
||||||
|
|
||||||
|
self.app.worker_task.emit({'fcn': task_job, 'params': []})
|
||||||
|
|
||||||
def activate(self):
|
def activate(self):
|
||||||
# adjust the status of the menu entries related to the editor
|
# adjust the status of the menu entries related to the editor
|
||||||
|
|||||||
Reference in New Issue
Block a user