def create_leg(x, y): L = lambda *args: cq.Location(cq.Vector(*args)) C = lambda *args: cq.Color(*args) leg = MAssembly(cq.Workplane("YZ").polyline([(0, 0), (x, 0), (x, y)]), name="base", color=C("Gray")) for i, name in enumerate(link_list): leg.add(parts[name], name=name, color=C(links[name]["col"]), loc=L(0, 0, i * 10 - 50)) return leg
def create_bearing(): L = lambda *args: cq.Location(cq.Vector(*args)) C = lambda *args: cq.Color(*args) assy = MAssembly(outer, loc=L(0, 0, ball_diam / 2), name="outer", color=C("orange")) assy.add(inner, loc=L(20, 0, 0), name="inner", color=C("orange")) for i in range(number_balls): assy.add(ball, loc=L(6 * i, 20, 0), name=balls[i], color=C("black")) return assy