File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -260,16 +260,32 @@ def make_zigzag(points, row_size):
260260
261261
262262def 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 :
You can’t perform that action at this time.
0 commit comments