Skip to content

Commit d01715a

Browse files
committed
Update make_quad function
1 parent c43f599 commit d01715a

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

geomdl/utilities.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,32 @@ def make_zigzag(points, row_size):
260260

261261

262262
def make_quad(points, row_size, col_size):
263+
""" Changes linearly ordered list of points into a mesh composed of quads.
264+
265+
Please note that this function does not detect the ordering of the input points to detect the input points have
266+
already been processed to generate a mesh.
267+
268+
:param points: list of points to be ordered
269+
:type points: list
270+
:param row_size: number of elements in a row
271+
:param row_size: int
272+
:param col_size: number of elements in a column
273+
:param col_size: int
274+
:return: re-ordered points
275+
:rtype: list
276+
:return:
277+
"""
278+
# Start with generating a zig-zag shape in row direction and then take its reverse
263279
new_points = make_zigzag(points, row_size)
264-
points_reverse = copy.deepcopy(points)
265-
points_reverse.reverse()
280+
new_points.reverse()
266281

282+
# Start generating a zig-zag shape in col direction
267283
forward = True
268284
idx = 0
269285
counter = 0
270286
temp = []
271287
while idx < col_size:
272-
temp.append(points_reverse[idx + (counter * row_size)])
288+
temp.append(points[idx + (counter * row_size)])
273289
counter += 1
274290
if counter % col_size == 0:
275291
if forward:

0 commit comments

Comments
 (0)