Merge branch 'Ultimaker:main' into master

This commit is contained in:
Anson Liu 2022-08-19 09:43:31 -04:00 committed by GitHub
commit 9cdee63483
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 311 additions and 59 deletions

View file

@ -432,7 +432,7 @@ class Stretcher:
"""
dist_palp = self.line_width # Palpation distance to seek for a wall
mrot = np.array([[0, -1], [1, 0]]) # Rotation matrix for a quarter turn
for i in range(len(orig_seq)):
for i, _ in enumerate(orig_seq):
ibeg = i # Index of the first point of the segment
iend = i + 1 # Index of the last point of the segment
if iend == len(orig_seq):

View file

@ -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