from ocp_vscode import * from build123d import * set_port(3939) wc = width_connector = 20.0 lsp = length_straight_part = 5.0 tce = thickness_connector_edge = 1.0 tb = thickness_bevel = 2.5 teub = thickness_edge_until_board = 0.5 wbs = width_board_side = 15.0 ttc = thickness_total_connector = 4.0 cw = clamp_width = 9.8 rc = rotation_clamp = 45.0 dc = depth_clamp = 8.0 with BuildPart() as connector: with BuildSketch() as connector_sk: with BuildLine() as connector_ln: l1 = Line(((wc/2), -(lsp/2)), ((wc/2), (lsp/2))) l2 = ThreePointArc(((wc/2), (lsp/2)), (0, ((lsp/2) + (wc/2))), (-(wc/2), (lsp/2))) l3 = Line((-(wc/2), (lsp/2)), (-(wc/2), -(lsp/2))) l4 = ThreePointArc((-(wc/2), -(lsp/2)), (0, -((lsp/2) + (wc/2))), ((wc/2), -(lsp/2))) make_face() extrude(amount = ttc-teub) chamfer(connector.edges().group_by(Axis.Z)[-1], length = tb, length2 = tb) extrude(connector.faces().sort_by(Axis.Z)[-1], amount = teub) with BuildSketch(connector.faces().sort_by(Axis.Z)[-1]) as metaal_sk: Circle(cw/2) extrude(amount = tce) with BuildSketch(connector.faces().sort_by(Axis.Z)[-1]) as klem_sk: Rectangle(cw, cw, rotation = rc) extrude(amount = dc) #corners = connector.edges().filter_by(Axis.X).group_by(Axis.Y)[0] #fillet(corners, radius = 1) show(connector)