01
02
03
04
import cadquery as cq
# Linear slider base (rails + stops)
stroke = 150.0
base_w, base_t = 40.0, 8.0
rail_w, rail_h, rail_gap = 8.0, 8.0, 16.0
stop_depth = 6.0
rail_off = (rail_gap + rail_w) / 2.0
base_len = stroke + 60 + stop_depth * 2
base = (
cq.Workplane("XY")
.box(base_w, base_len, base_t, centered=(True, True, False))
.faces(">Z").workplane()
.pushPoints([(rail_off,0), (-rail_off,0)])
.rect(rail_w, base_len).extrude(rail_h)
)