# Spec (plain English): "A 200 x 120 x 10 mm steel base plate with four M12
# clearance holes (13.5 mm) set 20 mm in from each corner."
import os

from build123d import *

L, W, T = 200, 120, 10
hole_d, inset = 13.5, 20
xs, ys = L/2 - inset, W/2 - inset

with BuildPart() as plate:
    Box(L, W, T)
    with Locations((-xs, -ys, 0), (xs, -ys, 0), (-xs, ys, 0), (xs, ys, 0)):
        Hole(radius=hole_d / 2)

# Writes next to this script, so the file you downloaded runs where you put it.
out = os.path.dirname(os.path.abspath(__file__))
export_step(plate.part, os.path.join(out, "baseplate.step"))
export_stl(plate.part, os.path.join(out, "baseplate.stl"))
bb = plate.part.bounding_box()
print(f"OK volume={plate.part.volume:.0f} mm^3  bbox={bb.size.X:.0f}x{bb.size.Y:.0f}x{bb.size.Z:.0f}")
