This folder is the maintained source package for a two-lane Pinewood Derby infrared break-beam gate. All dimensions are in millimetres and all source comments are in English.
The design deliberately separates the structural U-frame, removable cable covers, and electronics housing. That keeps parts printable without excessive support material and lets the electronics housing be replaced independently.
| File | Purpose |
|---|---|
pinewood_u_frame.scad |
Main parametric U-frame: start and finish variants, left/right mirrors, cable channels, sensor pockets, covers, and 250 mm printer split joints. |
electronics_housing_40mm_entry.scad |
Separate glue-on electronics housing with board supports, display opening, USB opening, cable pass-through, and sliding lid. |
breakbeam_sensor_holder_test.scad |
Small isolated test model for the sensor pocket, optical slot, cable channel, and cover fit. Print this first when changing sensor-related dimensions. |
clip_on_cable_covers.scad |
Supplemental external clip-on covers with tapered 2 mm to 3.5 mm legs; it does not modify the original U-frame. |
export_all_stls.sh |
Exports all required U-frame, cover, and housing STL files. |
export_housing_stls.sh |
Exports only the two housing STL files. |
export_clip_on_covers.sh |
Exports only the supplemental clip-on cover STL files. |
pinewood_u_frame.scad uses:
+X: open side of the U-frame / track side.X=0: rear face of the tall rail; this is where the concealed cable channel and glue-on housing are located.Y: lateral width of the 20 mm square profile.Z: vertical direction.The U opening stays clear. The break-beam modules are mounted from the outer cable-channel side. Only their optical openings are visible from inside the U-frame. The optical opening is a 15.4 x 7.7 mm slot, extending only back towards the rail; the end of each arm retains a solid 7 mm section.
electronics_housing_40mm_entry.scad uses:
Y=0: flat glue face against the rear mounting plate of the U-frame.+Y: outside / display-lid side.X: housing width.Z: housing height.The housing cable pass-through is 12 x 40 mm and aligns with the open central segment of the U-frame cable channel. The lid slides from left to right in integrated grooves; its entry side is deliberately open so no fragile bridge is printed across the entry.
| Parameter | Default | Meaning |
|---|---|---|
profile |
20 | Square U-frame profile size. |
arm |
105 | Length of each upper/lower arm. |
| Start height | 340 | Overall start-frame height. |
| Finish height | 240 | Overall finish-frame height. |
channel_depth |
10 | Recessed cable-channel depth. |
sensor_extra |
4 | Additional depth for the sensor pocket. |
| Sensor body | 19.8 x 9.9 x 7.9 | Sensor dimensions assumed by the pocket. |
| Optic slot | 15.4 x 7.7 | Through-slot visible from inside the U. |
| Solid arm tip | 7 | Material left beyond the sensor channel. |
mid_gap |
40 | Open cable-entry section at the center of the rear rail. |
mount_width |
60 | Width of the flat glue area for the housing. |
| Parameter | Default | Meaning |
|---|---|---|
box_width |
95 | Housing width for rigid connectors and side cable space. Set to 70 for silicone-wire-only wiring. |
box_height |
82 | Overall housing height. |
box_depth |
48 | Overall housing depth. |
wall |
3 | Housing wall thickness. |
| Board footprint | 64 x 63 | Board dimensions used by the supports. |
board_stack |
17.8 | Board plus ESP/display assembly height. |
| Display opening | 27.8 x 50.8 | Vertical display opening with clearance. |
| Cable pass-through | 12 x 40 | Opening towards the U-frame cable channel. |
| Lid thickness | 2 | Sliding display lid thickness. |
lid_fit_clearance |
0.2 | Extra PETG clearance for the sliding lid. Increase slightly if the lid is too tight. |
Open either SCAD file in OpenSCAD. Change the variables at the top, press F6 to render, then use File → Export → Export as STL.
Set variant to one of:
start_left, start_rightfinish_left, finish_right*_right mirrors the complete geometry. Use this only when the physical lane needs the mirrored orientation.
Set piece to one of:
preview: assembled frame and covers for inspection.frame: complete one-piece frame; suitable for the 240 mm finish gate.start_bottom, start_middle, start_top: three interlocking sections for the 340 mm start gate on a 250 mm printer.lower_arm_cover, upper_arm_cover, lower_vertical_cover, upper_vertical_cover: individual cable covers.print_layout: all four covers laid flat for printing.The start sections have keyed tongues and sockets. They must be assembled in their intended orientation; this preserves the 90° frame geometry and sensor alignment.
Set piece to:
base: housing body only.lid: sliding display lid only.print_layout: both parts arranged for printing.preview: assembled inspection view.Open a terminal in this folder and run:
chmod +x export_all_stls.sh export_housing_stls.sh export_clip_on_covers.sh
./export_all_stls.sh
The generated files are written to stl/. The full export contains:
To export only the housing:
./export_housing_stls.sh
To export only the supplemental clip-on covers:
./export_clip_on_covers.sh
clip_on_cable_covers.scad is an additive-only model. It is not referenced by,
and does not alter, pinewood_u_frame.scad. Every cover is a U-shaped friction
clip with a 21 mm clear inner width at the closed side, narrowing to 19.5 mm at
the open clipping side. Its 15 mm legs taper from 2 mm to 3.5 mm thickness and
provide the snap/friction fit over the 20 mm frame profile from the cable-duct
side.
Exported installation-specific parts are:
finish_clip_lower_arm and finish_clip_upper_arm: one 105 mm clip for each arm of a finish U-frame. The final 20 mm has only the flat cover; its side legs stop after 85 mm.finish_clip_outer_lower and finish_clip_outer_upper: two 80 mm rear clips for a finish U-frame, each with both side legs over the full 80 mm length.start_clip_lower_arm and start_clip_upper_arm: one 105 mm clip for each arm of a start U-frame. The final 20 mm has only the flat cover; its side legs stop after 85 mm.start_clip_outer_lower and start_clip_outer_upper: two 130 mm rear clips for a start U-frame, each with both side legs over the full 130 mm length.The clips are exported in print orientation, with their flat outer top face on
the print bed and their legs facing upward. They need no support. The 21 mm
clearance is intentionally a friction fit. If your PETG profile or printer
calibration makes it too tight, increase clip_open_inner_width in 0.1 mm steps.
piece="print_layout" displays all eight required physical clips separately
and fits them onto a 250 x 250 mm print bed.
The scripts expect openscad to be available on the command path. To use a different executable, set OPENSCAD_BIN:
OPENSCAD_BIN=/path/to/openscad ./export_all_stls.sh
breakbeam_sensor_holder_test.scad with piece="outer_open" and/or piece="cover".preview in OpenSCAD before exporting production parts.profile, arm, box_width, or board_width, inspect preview and the physical clearances instead of assuming every dependent feature still fits.Keep the following invariants unless the project requirements explicitly change: