MCPcopy Create free account
hub / github.com/Relento/lego_release / offset_boxes

Function offset_boxes

bricks/utils.py:45–63  ·  view source on GitHub ↗
(bl, h, offset_x, offset_y)

Source from the content-addressed store, hash-verified

43
44
45def offset_boxes(bl, h, offset_x, offset_y):
46 bl_new = []
47 if isinstance(h, list):
48 assert len(bl) == len(h)
49 for i, b in enumerate(bl):
50 if len(b) == 4:
51 x0, y0, x1, y1 = b
52 else:
53 assert (len(b) == 5)
54 x0, y0, _, x1, y1 = b
55 x0 += offset_x
56 x1 += offset_x
57 y0 += offset_y
58 y1 += offset_y
59 if isinstance(h, list):
60 bl_new.append((x0, y0, h[i], x1, y1))
61 else:
62 bl_new.append((x0, y0, h, x1, y1))
63 return bl_new
64
65
66def get_area_points_with_p5(area_points):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected