Pamhyr: Fix Pep8.

This commit is contained in:
Pierre-Antoine Rouby committed 2024-05-15 11:29:39 +02:00
1 parent 9d343a42ce
commit 4be43528e3
6 files changed
+38 -20

No files matched your search

+26 -9
View File
@@ -583,27 +583,44 @@ class ProfileXYZ(Profile, SQLSubModel):
"""
Remove points to keep at most np_purge points.
"""
if (self.nb_points <= np_purge):
return
if (self.nb_points <= np_purge): return
nb_named = 2 # we consider the first and last point as named
nb_named = 2 # we consider the first and last point as named
area = [0.0]
for i in range(1, self.nb_points-1):
if self.point(i).point_is_named():
area.append(9999999.999)
nb_named += 1
else:
area.append(PointXYZ.areatriangle3d(self.point(i-1),self.point(i),self.point(i+1)))
area.append(
PointXYZ.areatriangle3d(
self.point(i-1),
self.point(i),
self.point(i+1))
)
area.append(0.0)
while (self.nb_points > max(np_purge, nb_named)):
to_rm = np.argmin(area[1:self.nb_points-1])+1
while self.nb_points > max(np_purge, nb_named):
to_rm = np.argmin(area[1:self.nb_points - 1]) + 1
self.delete_i([to_rm])
area.pop(to_rm)
for i in [to_rm-1, to_rm]:
if (i == 0): continue
if (i == self.nb_points - 1): continue
if (i == 0):
continue
if (i == self.nb_points - 1):
continue
if self.point(i).point_is_named():
area[i] = 9999999.999
else:
area[i] = PointXYZ.areatriangle3d(self.point(i-1),self.point(i),self.point(i+1))
area[i] = PointXYZ.areatriangle3d(
self.point(i-1),
self.point(i),
self.point(i+1)
)