from ocp_vscode import *
from build123d import *

set_port(3939)

# Distance hart to hart holes pegboard 1-1/2" or about 38.1 mm
hdhh = hole_distance_hart_to_hart = 38.1
wmh = width_multiconnector_hole = 20.3
dmh = depth_multiconnector_hole = 4.15
dbr = depth_big_round = 1.2121
dsr = depth_small_round = 0.4379
db = depth_bevel = 2.5

with BuildPart() as backSlot:
#    Box(10, 5, 3)
    with BuildSketch() as sk_backSlot:
        Rectangle(10, 5)
    extrude(amount = db)
#arrayOfEdges = backSlot.edges()
#edgs = backSlot.faces().sort_by(Axis.Z)[0].vertices().filter_by(Axis.X)
#fillet(edgs, 0.5)
#vertice = backSlot.vertices()
#for i, vertex in enumerate(vertice):
#    print(f"Vertex {i}: {vertex}")
#edge_0_vertices = [v for v in edge.vertices()]
#for v in edge_0_vertices:
#    print(f"Edge 0 vertex: {v}")
#face = backSlot.faces()[-1]
#for i, edge in enumerate(face.edges()):
#    print(f"edgs {i}: {edge}")

    chamfer(backSlot.edges().group_by(Axis.Z)[0].sort_by(Axis.X)[0], length = 1, length2 = 3)
    fillet(backSlot.edges(), 0.5)

show_all()
