The GridfinityBox class creates parameterized Gridfinity boxes. Dimensions are provided in 3D units: length and width are multiples of 42 mm, and height is a multiple of 7 mm.
Core Configuration Options:
lite_style: If True, creates a simplified, homogenous 1 mm thick walled shell (faster printing, less material). Note: lite_style cannot be combined with solid boxes, finger scoops, or magnet holes.holes: Boolean to add magnet holes to the bottom.unsupported_holes: If True, uses a 3D-printer friendly hole style with thin filler strips to avoid needing supports.no_lip: Boolean to remove the top mounting lip feature.scoops: Boolean to add finger scoops.scoop_rad: Radius of the interior scoops.labels: Boolean to add a label flange to the top.label_width: Width of the label strip.label_height: Thickness height of label overhang.label_lip_height: Thickness of label vertical lip.length_div: Number of dividing walls along the length.width_div: Number of dividing walls along the width.solid: Boolean to make the box partially solid.solid_ratio: Ratio of solid height (0.0 to 1.0).wall_th: Wall thickness (0.5-2.5 mm).fillet_interior: Boolean to enable/disable internal fillet edges.
# Create a simple 3 x 2 box, 5U high
box = GridfinityBox(3, 2, 5)
box.save_step_file()
# Create a "lite" style 3 x 2 box, 5U high
box = GridfinityBox(3, 2, 5, lite_style=True)
# Add magnet holes with printer-friendly unsupported style
box = GridfinityBox(1, 1, 5, holes=True, unsupported_holes=True)
# Add dividing walls, scoops, and labels
box = GridfinityBox(3, 2, 5, length_div=2, width_div=1, scoops=True, labels=True)
# Create a partially solid box
box = GridfinityBox(3, 2, 5, solid=True, solid_ratio=0.7)