From 8bce97e09c7e69722c3751149e112b807fe88a95 Mon Sep 17 00:00:00 2001 From: h3n3 Date: Sun, 5 Jan 2025 16:12:54 +0100 Subject: [PATCH] Verveelvoudigingen clips gemaakt --- .../Toolholders/multiconnect/basicBackSlot.py | 55 ++++++++++++----- .../Toolholders/multiconnect/oneclip.py | 60 +++++++++++++++++++ 2 files changed, 101 insertions(+), 14 deletions(-) create mode 100644 KennedyPegboard/Toolholders/multiconnect/oneclip.py diff --git a/KennedyPegboard/Toolholders/multiconnect/basicBackSlot.py b/KennedyPegboard/Toolholders/multiconnect/basicBackSlot.py index 83e56b9..282168c 100644 --- a/KennedyPegboard/Toolholders/multiconnect/basicBackSlot.py +++ b/KennedyPegboard/Toolholders/multiconnect/basicBackSlot.py @@ -3,6 +3,10 @@ from build123d import * set_port(3939) +# Set the number of clips horizontal: +number_clips_horizontal = 3 +number_clips_vertical = 3 + # 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 @@ -25,20 +29,43 @@ pts = [ ] # Make one basic connector -with BuildPart() as backSlot: - # Make a polyline sketch and revolve it 180 degrees - with BuildSketch(Plane.XZ) as sk_backSlot: - with BuildLine(Plane.XZ) as ln_backSlot: - Polyline(pts) - make_face() - revolve(revolution_arc=180.0, axis=Axis.Z) - # Add a straight part to it - with BuildSketch(Plane.XZ) as sk_extrusion: - with BuildLine(Plane.XZ) as ln_extrusion: - Polyline(pts) - make_face() - mirror(about=Plane.YZ) - extrude(amount = el) +def one_clip(): + with BuildPart() as backSlot: + # Make a polyline sketch and revolve it 180 degrees + with BuildSketch(Plane.XZ) as sk_backSlot: + with BuildLine(Plane.XZ) as ln_backSlot: + Polyline(pts) + make_face() + revolve(revolution_arc=180.0, axis=Axis.Z) +# # Add a straight part to it +# with BuildSketch(Plane.XZ) as sk_extrusion: +# with BuildLine(Plane.XZ) as ln_extrusion: +# Polyline(pts) +# make_face() +# mirror(about=Plane.YZ) +# extrude(amount = el) + return backSlot.part + +# Generate a raster of clips +with BuildPart() as raster: + last_clip = None + for i in range(number_clips_horizontal): + for j in range(number_clips_vertical): + clip = one_clip() + # Put the clips on the right locations + with Locations((i * hdhh, j * hdhh, 0)): + add(clip) + # Connect the clips together + while True: + if last_clip is not None: + with BuildSketch(Plane.XZ) as sk_connect: + with BuildLine(Plane.XZ) as ln_connect: + Polyline(pts) + make_face() + mirror(about=Plane.YZ) + extrude(until=Until.NEXT) + last_clip = clip + break #export_stl(backSlot.part, "backSlot.stl") show_all() diff --git a/KennedyPegboard/Toolholders/multiconnect/oneclip.py b/KennedyPegboard/Toolholders/multiconnect/oneclip.py new file mode 100644 index 0000000..cad56ab --- /dev/null +++ b/KennedyPegboard/Toolholders/multiconnect/oneclip.py @@ -0,0 +1,60 @@ +from ocp_vscode import * +from build123d import * + +set_port(3939) + +# Set the number of clips horizontal: +number_clips_horizontal = 3 +number_clips_vertical = 3 + +# 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 +el = extrusion_length = 10.0 + +pts = [ + (0, 0), + ((wmh+4)/2, 0), + (((wmh+4)/2), dmh+2), + (((wmh+4)/2)-db-2, dmh+2), + (((wmh+4)/2)-db-2, dmh+2-dsr), + ((wmh+4)/2-2, dbr+2), + ((wmh+4)/2-2, 2), + (0, 2), + (0, 0) +] + +# Make one basic connector +def one_clip(): + with BuildPart() as backSlot: + # Make a polyline sketch and revolve it 180 degrees + with BuildSketch(Plane.XZ) as sk_backSlot: + with BuildLine(Plane.XZ) as ln_backSlot: + Polyline(pts) + make_face() + revolve(revolution_arc=180.0, axis=Axis.Z) + # Add a straight part to it + with BuildSketch(Plane.XZ) as sk_extrusion: + with BuildLine(Plane.XZ) as ln_extrusion: + Polyline(pts) + make_face() + mirror(about=Plane.YZ) + extrude(amount = el) + return backSlot.part + +# Generate a raster of clips +with BuildPart() as raster: + last_clip = None + for i in range(number_clips_horizontal): + for j in range(number_clips_vertical): + clip = one_clip() + # Put the clips on the right locations + with Locations((i * hdhh, j * hdhh, 0)): + add(clip) + +#export_stl(backSlot.part, "backSlot.stl") +show_all()