mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 10:23:14 +08:00
Refactor check for unknown line types
Using .where() clarifies the intent.
This commit is contained in:
parent
9ac7eb4da7
commit
1c3479c9fc
@ -39,9 +39,11 @@ class LayerPolygon:
|
||||
|
||||
self._extruder = extruder
|
||||
self._types = line_types
|
||||
for idx, line_type in enumerate(self._types):
|
||||
if line_type >= self.__number_of_types: # Got faulty line data from the engine.
|
||||
Logger.log("w", "Found an unknown line type: %s", line_type)
|
||||
unknown_types = np.where(self_types >= self_number_of_types)
|
||||
if unknown_types:
|
||||
# Got faulty line data from the engine.
|
||||
for idx in unknown_types:
|
||||
Logger.log("w", "Found an unknown line type at: %s", idx)
|
||||
self._types[idx] = self.NoneType
|
||||
self._data = data
|
||||
self._line_widths = line_widths
|
||||
|
Loading…
x
Reference in New Issue
Block a user