1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| margin = 15
x_min = -210.134 + margin x_max = -84.134 - margin y_min = -140.0997 + margin y_max = -14.0997 - margin z = 0
num_squares = 10
x_length = (x_max - x_min) / num_squares y_length = (y_max - y_min) / num_squares margin_portion = 0.17 hole_portion = 1 - 2 * margin_portion
for i in range(num_squares): for j in range(num_squares): x_start = x_min + i * x_length + x_length * margin_portion y_start = y_min + j * y_length + y_length * margin_portion square_points = [ (x_start, y_start, z), (x_start + x_length * hole_portion, y_start, z), (x_start + x_length * hole_portion, y_start + y_length * hole_portion, z), (x_start, y_start + y_length * hole_portion, z), (x_start, y_start, z), ] square = Part.makePolygon(square_points) Part.show(square)
|