Merge pull request #12970 from digitalfrost/070822

Use is not operator rather than not ... is
This commit is contained in:
Jelle Spijker 2022-08-08 15:04:47 +02:00 committed by GitHub
commit 2968f96e85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -74,14 +74,14 @@ class ShapeArray:
# If the child-nodes are included, adjust convex hulls as well: # If the child-nodes are included, adjust convex hulls as well:
if include_children: if include_children:
children = node.getAllChildren() children = node.getAllChildren()
if not children is None: if children is not None:
for child in children: for child in children:
# 'Inefficient' combination of convex hulls through known code rather than mess it up: # 'Inefficient' combination of convex hulls through known code rather than mess it up:
child_hull = child.callDecoration("getConvexHull") child_hull = child.callDecoration("getConvexHull")
if not child_hull is None: if child_hull is not None:
hull_verts = hull_verts.unionConvexHulls(child_hull) hull_verts = hull_verts.unionConvexHulls(child_hull)
child_hull_head = child.callDecoration("getConvexHullHead") or 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) hull_head_verts = hull_head_verts.unionConvexHulls(child_hull_head)
offset_verts = hull_head_verts.getMinkowskiHull(Polygon.approximatedCircle(min_offset)) offset_verts = hull_head_verts.getMinkowskiHull(Polygon.approximatedCircle(min_offset))

View File

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