Browse Source

Merge pull request #12970 from digitalfrost/070822

Use is not operator rather than not ... is
Jelle Spijker 2 years ago
parent
commit
2968f96e85
2 changed files with 8 additions and 8 deletions
  1. 4 4
      cura/Arranging/ShapeArray.py
  2. 4 4
      plugins/X3DReader/X3DReader.py

+ 4 - 4
cura/Arranging/ShapeArray.py

@@ -74,14 +74,14 @@ class ShapeArray:
         # If the child-nodes are included, adjust convex hulls as well:
         if include_children:
             children = node.getAllChildren()
-            if not children is None:
+            if children is not None:
                 for child in children:
                     # 'Inefficient' combination of convex hulls through known code rather than mess it up:
                     child_hull = child.callDecoration("getConvexHull")
-                    if not child_hull is None:
+                    if child_hull is not None:
                         hull_verts = hull_verts.unionConvexHulls(child_hull)
                     child_hull_head = child.callDecoration("getConvexHullHead") or child_hull
-                    if not child_hull_head is None:
+                    if child_hull_head is not None:
                         hull_head_verts = hull_head_verts.unionConvexHulls(child_hull_head)
 
         offset_verts = hull_head_verts.getMinkowskiHull(Polygon.approximatedCircle(min_offset))
@@ -159,4 +159,4 @@ class ShapeArray:
 
         max_col_idx = (idxs[0] - p1[0]) / (p2[0] - p1[0]) * (p2[1] - p1[1]) + p1[1]
         sign = numpy.sign(p2[0] - p1[0])
-        return idxs[1] * sign <= max_col_idx * sign
+        return idxs[1] * sign <= max_col_idx * sign

+ 4 - 4
plugins/X3DReader/X3DReader.py

@@ -134,7 +134,7 @@ class X3DReader(MeshReader):
                 geometry = self.resolveDefUse(sub_node)
 
         # TODO: appearance is completely ignored. At least apply the material color...
-        if not geometry is None:
+        if geometry is not None:
             try:
                 self.verts = self.faces = [] # Safeguard
                 self.geometry_importers[geometry.tag](self, geometry)
@@ -493,12 +493,12 @@ class X3DReader(MeshReader):
             # Columns are the unit vectors for the xz plane for the cross-section
             if orient:
                 mrot = orient[i] if len(orient) > 1 else orient[0]
-                if not mrot is None:
+                if mrot is not None:
                     m = m.dot(mrot)  # Tested against X3DOM, the result matches, still not sure :(
 
             if scale:
                 mscale = scale[i] if len(scale) > 1 else scale[0]
-                if not mscale is None:
+                if mscale is not None:
                     m = m.dot(mscale)
 
             # First the cross-section 2-vector is scaled,
@@ -703,7 +703,7 @@ class X3DReader(MeshReader):
         for c in node:
             if c.tag == "Coordinate":
                 c = self.resolveDefUse(c)
-                if not c is None:
+                if c is not None:
                     pt = c.attrib.get("point")
                     if pt:
                         # allow the list of float values in 'point' attribute to