"""Servo with mounting tabs (RC and serial bus servos): Feetech models by their product specifications. The case's underside is on the XY plane, centred on the origin, the case's long side along X, the output up along +Z on the +X side. One solid: the case, the mounting tabs (one plate over the length across the tabs), the output's base where the drawing gives its height, and the output (spline or round shaft). The tab holes are drilled where the drawing gives their diameter and both centre distances; otherwise they are left out (see the README). No material is set: a servo is an assembly (case, gears, motor, board); take its weight from the maker. """ from steve import Model designation = "STS3032" # Model # Feetech product specifications, section 9 "Outside Dimension" (see the README for each edition, date and page). # case: (length, width, height to the case's top) # tabs: (length over the tabs, width of the tabs, height to the tabs' underside, height to the tabs' top) # output: (output axis from the case's centre along X, output diameter or None, height to the output's base, overall height) # An output diameter of None: the drawing names the spline's teeth but not its diameter (see "Proportions" below). # A base height equal to the case's top: no base is dimensioned. # holes: (diameter, centre distance along X, distances across Y from the centre line, open) or None. The holes sit at # +- half the centre distance from the case's centre, as drawn. open: the drawing shows every hole as a slot open # to the tab's end, the hole's diameter wide. SERVOS = { "STS3032": {"case": (23.0, 12.0, 27.5), "tabs": (32.0, 12.0, 20.5, 22.0), "output": (5.79, 4.95, 28.5, 31.9), "holes": None}, "FT2331M": {"case": (23.0, 12.0, 27.5), "tabs": (32.0, 12.0, 20.5, 22.0), "output": (5.79, 4.95, 28.5, 31.9), "holes": None}, "SCS2332": {"case": (23.0, 12.0, 27.5), "tabs": (32.0, 12.0, 20.5, 22.0), "output": (5.79, 4.95, 28.5, 31.9), "holes": None}, "HL-3606-C001": {"case": (23.0, 12.0, 27.5), "tabs": (32.0, 12.0, 20.5, 22.0), "output": (5.79, 4.95, 28.5, 31.9), "holes": None}, "FS90MG": {"case": (22.5, 12.1, 22.4), "tabs": (32.3, 12.1, 15.7, 18.2), "output": (5.15, 4.7, 26.7, 30.7), "holes": (2.2, 27.7, (0.0,), True)}, "FS90R": {"case": (22.5, 12.1, 23.4), "tabs": (32.3, 12.1, 16.7, 19.2), "output": (5.15, 4.86, 27.7, 30.7), "holes": (2.2, 27.7, (0.0,), True)}, "FT90B": {"case": (22.5, 12.1, 22.4), "tabs": (32.3, 12.1, 15.7, 18.2), "output": (5.15, 4.86, 26.7, 29.7), "holes": (2.2, 27.7, (0.0,), True)}, "FT1190M": {"case": (23.3, 12.1, 21.45), "tabs": (32.5, 11.0, 16.8, 18.4), "output": (5.7, 3.95, 25.25, 28.45), "holes": (2.0, 28.5, (0.0,), False)}, "FT90M": {"case": (23.3, 12.1, 21.45), "tabs": (32.5, 11.0, 16.8, 18.4), "output": (5.7, 3.95, 25.25, 28.45), "holes": (2.0, 28.5, (0.0,), False)}, "FT9015M": {"case": (32.4, 15.0, 29.2), "tabs": (44.0, 15.0, 20.1, 22.3), "output": (7.8, None, 29.2, 33.1), "holes": (4.5, 39.0, (-4.0, 4.0), True)}, "FT9025M": {"case": (36.0, 15.0, 29.2), "tabs": (48.8, 15.0, 19.7, 21.7), "output": (6.0, None, 29.2, 33.1), "holes": (4.2, 42.6, (-3.75, 3.75), True)}, "STS3045": {"case": (36.0, 15.0, 29.2), "tabs": (48.8, 15.0, 19.7, 21.7), "output": (6.0, None, 29.2, 33.1), "holes": (4.2, 42.6, (-3.75, 3.75), True)}, "HL3612": {"case": (36.0, 15.0, 29.2), "tabs": (48.8, 15.0, 19.7, 21.7), "output": (6.0, None, 29.5, 33.6), "holes": (4.2, 42.6, (-3.75, 3.75), True)}, "FI7622M": {"case": (40.0, 20.0, 34.5), "tabs": (55.0, 19.0, 27.0, 29.5), "output": (9.86, None, 38.0, 42.38), "holes": (4.5, 48.0, (-5.0, 5.0), False)}, "FT5320M": {"case": (40.0, 20.0, 39.5), "tabs": (55.0, 19.0, 32.0, 34.5), "output": (9.86, None, 43.0, 47.38), "holes": (4.5, 48.0, (-5.0, 5.0), False)}, "FT5325M": {"case": (40.0, 20.0, 39.5), "tabs": (55.0, 19.0, 32.0, 34.5), "output": (9.86, None, 43.0, 47.38), "holes": (4.5, 48.0, (-5.0, 5.0), False)}, "FT5330M": {"case": (40.0, 20.0, 39.5), "tabs": (55.0, 19.0, 32.0, 34.5), "output": (9.86, None, 43.0, 47.38), "holes": (4.5, 48.0, (-5.0, 5.0), False)}, "FT6325M": {"case": (40.0, 20.0, 39.5), "tabs": (55.0, 19.0, 32.0, 34.5), "output": (9.86, None, 43.0, 47.38), "holes": (4.5, 48.0, (-5.0, 5.0), False)}, "SCS125": {"case": (40.0, 20.0, 39.5), "tabs": (55.0, 19.0, 32.0, 34.5), "output": (9.86, 5.9, 43.0, 47.38), "holes": (4.5, 48.0, (-5.0, 5.0), False)}, "FT5118M": {"case": (40.1, 20.1, 38.9), "tabs": (54.0, 20.1, 27.3, 30.0), "output": (10.05, 5.9, 38.9, 44.3), "holes": (4.5, 49.5, (-5.0, 5.0), True)}, "FT5420M": {"case": (40.6, 20.0, 26.6), "tabs": (54.4, 20.0, 17.15, 19.65), "output": (11.5, None, 26.6, 31.5), "holes": (4.5, 49.5, (-5.0, 5.0), True)}, "FT5425BL": {"case": (40.6, 20.0, 30.0), "tabs": (54.4, 20.0, 20.55, 23.05), "output": (11.5, None, 30.0, 34.9), "holes": (4.5, 49.5, (-5.0, 5.0), True)}, "STS5420": {"case": (40.6, 20.0, 30.0), "tabs": (54.4, 20.0, 20.55, 23.05), "output": (11.5, None, 30.0, 34.9), "holes": (4.5, 49.5, (-5.0, 5.0), True)}, "FT7115M": {"case": (40.16, 20.16, 40.5), "tabs": (54.4, 19.0, 28.3, 30.7), "output": (10.0, None, 41.7, 45.7), "holes": (4.5, 49.5, (-5.0, 5.0), True)}, "FT7125": {"case": (40.16, 20.16, 40.5), "tabs": (54.4, 19.0, 28.3, 30.7), "output": (10.0, None, 41.7, 45.7), "holes": (4.5, 49.5, (-5.0, 5.0), True)}, "FT7135": {"case": (40.16, 20.16, 40.5), "tabs": (54.4, 19.0, 28.3, 30.7), "output": (10.0, None, 41.7, 45.7), "holes": (4.5, 49.5, (-5.0, 5.0), True)}, "FT7235": {"case": (40.17, 20.16, 36.5), "tabs": (54.4, 19.0, 24.3, 26.7), "output": (10.0, None, 37.7, 41.7), "holes": (4.5, 49.5, (-5.0, 5.0), True)}, "FT860B": {"case": (40.0, 20.0, 39.9), "tabs": (54.2, 20.0, 28.9, 31.4), "output": (9.8, 5.9, 41.4, 45.5), "holes": (4.5, 49.5, (-5.0, 5.0), True)}, "STS3046": {"case": (40.0, 20.0, 43.05), "tabs": (54.45, 18.5, 33.0, 35.3), "output": (10.0, 5.9, 43.8, 48.0), "holes": (4.3, 47.8, (-5.0, 5.0), True)}, "SCS46": {"case": (40.0, 20.0, 43.05), "tabs": (54.45, 18.5, 33.0, 35.3), "output": (10.0, 5.9, 43.8, 48.0), "holes": (4.3, 47.8, (-5.0, 5.0), True)}, "SM24BL-C001": {"case": (40.0, 20.0, 47.8), "tabs": (54.0, 19.0, 36.0, 38.5), "output": (10.0, 4.75, 47.8, 54.3), "holes": (3.1, 48.5, (-5.0, 5.0), False)}, "FT995M": {"case": (65.0, 30.0, 48.0), "tabs": (82.0, 30.0, 32.9, 36.9), "output": (16.6, None, 48.0, 55.4), "holes": (6.0, 75.0, (-8.75, 8.75), True)}, "FT450B": {"case": (86.0, 45.0, 100.3), "tabs": (112.0, 45.0, 65.6, 73.6), "output": (20.0, None, 100.3, 112.1), "holes": (6.0, 100.0, (-17.0, 0.0, 17.0), False)}, "FT600B": {"case": (100.0, 51.0, 81.4), "tabs": (132.0, 51.0, 55.0, 60.4), "output": (25.5, 12.0, 81.4, 104.2), "holes": (8.0, 116.0, (-19.5, 19.5), False)}, "FT1000": {"case": (100.0, 51.0, 90.9), "tabs": (132.0, 51.0, 64.5, 69.9), "output": (25.5, 12.0, 90.9, 113.7), "holes": (8.0, 116.0, (-19.5, 19.5), False)}, "FT750B": {"case": (90.0, 48.0, 109.3), "tabs": (114.0, 48.0, 74.6, 82.6), "output": (20.2, None, 109.3, 121.1), "holes": (6.0, 102.0, (-17.0, 0.0, 17.0), False)}, } # Proportions, for looks (the drawings do not dimension them): # - the round base under the output, where the drawing gives its height but not its plan: 0.6 of the case's width across; # - the output's diameter where the drawing names only the spline's teeth: 0.3 of the case's width. BASE_SHARE = 0.6 OUTPUT_SHARE = 0.3 if designation not in SERVOS: raise ValueError(f"Models: {', '.join(SERVOS)}.") s = SERVOS[designation] length, width, case_top = s["case"] span, tab_width, tab_bottom, tab_top = s["tabs"] axis_x, output_d, base_top, overall = s["output"] holes = s["holes"] output_d = output_d or OUTPUT_SHARE * width model = Model() with model.sketch("case_sketch", on="XY", name="Case") as sk: sk.rect("case_rect", (-length / 2, -width / 2), (length / 2, width / 2)) model.extrude("case", "case_sketch", distance=case_top, name="Case") model.plane("tab_plane", on="XY", offset=tab_bottom, name="Tabs") with model.sketch("tab_sketch", on="tab_plane", name="Tabs") as sk: sk.rect("tab_rect", (-span / 2, -tab_width / 2), (span / 2, tab_width / 2)) model.extrude("tabs", "tab_sketch", distance=tab_top - tab_bottom, name="Tabs") if holes: hole_d, pitch_x, ys, open_slots = holes with model.sketch("holes_sketch", on="tab_plane", name="Tab holes") as sk: for i, x in enumerate((-pitch_x / 2, pitch_x / 2)): for j, y in enumerate(ys): sk.circle(f"hole_{i + 1}_{j + 1}", (x, y), hole_d / 2) model.extrude("holes", "holes_sketch", distance=tab_top - tab_bottom, op="cut", name="Tab holes") if open_slots: with model.sketch("slots_sketch", on="tab_plane", name="Slot openings") as sk: for i, x in enumerate((-pitch_x / 2, pitch_x / 2)): end = (span / 2 + 1) * (1 if x > 0 else -1) for j, y in enumerate(ys): sk.rect(f"slot_{i + 1}_{j + 1}", (min(x, end), y - hole_d / 2), (max(x, end), y + hole_d / 2)) model.extrude("slots", "slots_sketch", distance=tab_top - tab_bottom, op="cut", name="Slot openings") if base_top > case_top: model.plane("case_top_plane", on="XY", offset=case_top, name="Case top") with model.sketch("base_sketch", on="case_top_plane", name="Output base") as sk: sk.circle("base_circle", (axis_x, 0), BASE_SHARE * width / 2) model.extrude("base", "base_sketch", distance=base_top - case_top, name="Output base") model.plane("base_plane", on="XY", offset=base_top, name="Output base top") with model.sketch("output_sketch", on="base_plane", name="Output") as sk: sk.circle("output_circle", (axis_x, 0), output_d / 2) model.extrude("output", "output_sketch", distance=overall - base_top, name="Output") result = model.result()