Show warning on any invalid pixel, not just 10

Now that we have no noise any more we can do this.
Possibly cuts the processing time in half, too.

Contributes to issue CURA-7262.
This commit is contained in:
Ghostkeeper 2020-03-25 18:57:30 +01:00
parent c2651d1141
commit 986284052d
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -291,12 +291,10 @@ class SolidView(View):
"b": (np.uint8, 2, "blue"),
"a": (np.uint8, 3, "alpha") # Never filled since QImage was reformatted to RGB888.
}), np.recarray)
bad_pixel_count = np.sum(np.mod(array.r, 2)) # check number of pixels in the red channel with an odd intersection count
if bad_pixel_count > 10: # allow for 10 pixels to be erroneously marked as problematic
if np.any(np.mod(array.r, 2)):
self._next_xray_checking_time = time.time() + self._xray_warning_cooldown
self._xray_warning_message.show()
Logger.log("i", "Xray overlay found %d non-manifold pixels." % bad_pixel_count)
Logger.log("i", "X-Ray overlay found non-manifold pixels.")
def _onDontAskMeAgain(self, checked: bool) -> None:
CuraApplication.getInstance().getPreferences().setValue(self._show_xray_warning_preference, not checked)