Quellcode durchsuchen

- added a method for intersection to FlatCAMRtree class

Marius Stanciu vor 5 Jahren
Ursprung
Commit
a4c8737ab7
2 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
  1. 1 0
      appEditors/AppGerberEditor.py
  2. 9 0
      camlib.py

+ 1 - 0
appEditors/AppGerberEditor.py

@@ -3800,6 +3800,7 @@ class AppGerberEditor(QtCore.QObject):
                                         pass
                                     else:
                                         for clear_geo in global_clear_geo:
+                                            # Make sure that the clear_geo is within the solid_geo otherwise we loose
                                             # Make sure that the clear_geo is within the solid_geo otherwise we loose
                                             # the solid_geometry. We want for clear_geometry just to cut into
                                             # solid_geometry not to delete it

+ 9 - 0
camlib.py

@@ -8607,6 +8607,15 @@ class FlatCAMRTree(object):
         """
         return next(self.rti.nearest(pt, objects=True))
 
+    def intersection(self, pt):
+        """
+        Will raise StopIteration if no items are found.
+
+        :param pt:
+        :return:
+        """
+        return next(self.rti.intersection(pt, objects=True))
+
 
 class FlatCAMRTreeStorage(FlatCAMRTree):
     """