--- jupyter: description: 'A motor mount plate as a 2D CAD exercise: a dimensioned drawing to model in planex2d or any CAD system, a solution from a centered rectangle with chamfered corners, the motor''s bore and screw holes, and slots for the belt''s tension from linear patterns in two directions, and the area to check a model against.' --- # Motor mount plate A motor mount plate carries a small motor on a frame. The motor's pilot sits in the bore at its center, and four screws hold its flange. The plate is bolted down through four slots, so that it can slide to tension the belt. It is a rectangle with chamfered corners, and the screw holes and the slots are each one feature repeated in two directions. Model the plate from the drawing in planex2d or in any CAD system, then check its area against the value at the end of the page. A solution in planex2d follows. ![The motor mount plate exercise: a dimensioned drawing of a rectangular plate with chamfered corners, a bore, four screw holes and four slots](../_static/gallery/motor-mount-plate.png){.result} ```python import math import planex as px ``` ```python nbsphinx="hidden" from docs_figures import Row ``` ## The plate The plate is a `RectangleC` 130 by 90 around the origin. Its lines are `plate.Line.1` to `plate.Line.4`, the first one the bottom edge, and its right angles are constraints already. With `auto_constraint={"horizontal": True, "vertical": True}`, its bottom edge, drawn level, stays horizontal, as the slots below do. `Chamfer` cuts its four corners at 8 from each corner, and each chamfer makes its lengths dimensions, `chamfer_1.d` and `chamfer_1.d2` for the first (Figure 1): ```python mount = px.Sketch(auto_constraint={"horizontal": True, "vertical": True}) mount.RectangleC(130, 90, id="plate") mount.Constrain("plate.center", "origin", px.Coincident) mount.Constrain("plate.Line.1", px.Distance, 130, id="length") mount.Constrain("plate.Line.2", px.Distance, 90, id="width") mount.Chamfer(["plate.Line.1.start", "plate.Line.2.start", "plate.Line.3.start", "plate.Line.4.start"], 8, id=["chamfer_1", "chamfer_2", "chamfer_3", "chamfer_4"]) print("status", mount.status, "| degrees of freedom", mount.dof) ``` ```python nbsphinx="hide-input" Row((mount, "The rectangle with its chamfered corners, every dimension and tie", {"constraints": True}), caption="The plate") ``` ## The holes and the slots The motor's pilot bore, 22 across, is centered at the origin. The first screw hole, 5.5 across, is 25 to the left of the vertical axis and 25 below the horizontal one. `LinearPattern` repeats it in a 2 by 2 grid, 50 apart both ways. The first slot, 10 long between the centers of its ends and 6.6 wide, lies along $x$ with its middle 50 to the left and 32 below the center, and a second pattern repeats it 100 apart along $x$ and 64 apart up (Figure 2): ```python mount.Circle(22 / 2, center=(1, 1), id="pilot") mount.Constrain("pilot.center", "origin", px.Coincident) mount.Constrain("pilot", px.Diameter, 22, id="pilot_d") mount.Circle(5.5 / 2, center=(-24, -24), id="screw") mount.Constrain("screw", px.Diameter, 5.5, id="screw_d") mount.Constrain("screw.center", "V", px.Distance, 25, id="screw_x") mount.Constrain("screw.center", "H", px.Distance, 25, id="screw_y") mount.LinearPattern("screw", px.H, 2, 50, dir2=px.V, count2=2, spacing2=50, id="screws") mount.Move((-55, -32)).Slot(10, 6.6, id="slot") # 10 between the centers of its ends, 6.6 wide mount.Constrain("slot.spine", px.Distance, 10, id="slot_l") mount.Constrain("slot.spine.mid", "V", px.Distance, 50, id="slot_x") mount.Constrain("slot.spine.mid", "H", px.Distance, 32, id="slot_y") mount.LinearPattern("slot", px.H, 2, 100, dir2=px.V, count2=2, spacing2=64, id="slots") print("status", mount.status, "| degrees of freedom", mount.dof) ``` ```python nbsphinx="hide-input" Row((mount, "The bore, the screw holes and the slots", {"fill": False}), caption="The holes and the slots") ``` ## The checks This is the area, to compare with your own model. It is the rectangle less the four triangles the chamfers cut off, $8^2 / 2$ each, less the bore, the four screw holes and the four slots, each a rectangle 10 by 6.6 and a disc of 6.6. The plate is symmetric about both axes, so its centroid is the origin (Figure 3): ```python face = mount.Face() exact = (130 * 90 - 4 * 8**2 / 2 - math.pi * 11**2 - 4 * math.pi * 2.75**2 - 4 * (10 * 6.6 + math.pi * 3.3**2)) c = face.center print("area", round(face.mass, 2), "mm², exact", round(exact, 2)) print("centroid", tuple(round(v, 6) for v in c[:2])) ``` ```python nbsphinx="hide-input" Row((face, "The motor mount plate", {}), caption="The motor mount plate") ``` The plate as DXF in millimeters, for another CAD system or a laser cutter: ```python mount.WriteDXF("motor_mount_plate.dxf", unit=px.mm, scale=1) # scale=1: the numbers as they are ``` The plate as DXF: [motor_mount_plate.dxf](motor_mount_plate.dxf) ```python nbsphinx="hidden" import sys sys.path.insert(0, "..") import matplotlib.pyplot as plt from drawings import SheetFigure, View from gallery import save_figure # the patterns' pitches between the features' centers; a slot's width across it; the chamfer as length × angle (s0x, s0y), w = mount.Location("slot.spine.start"), mount.dimensions["slot.w"] view = View([(mount, {"length": -60, "width": 85, "pilot_d": 45, "screw_d": (135, "leader", 4), "slot_l": -24})], axes=[((-75, 0), (75, 0), (0, 0)), ((0, -52), (0, 52), (0, 0))] + [((x, -36), (x, 36)) for x in (-25, 25)] + [((-36, y), (36, y)) for y in (-25, 25)] + [((x - 10, y), (x + 10, y)) for x in (-50, 50) for y in (-32, 32)], measures=[((-25, 25), (25, 25), 40, 50), ((25, -25), (25, 25), 36, 50), ((-50, 32), (50, 32), 54, 100), ((50, -32), (50, 32), 75, 64), ((s0x - 6, s0y - w / 2), (s0x - 6, s0y + w / 2), -64, w), ((57, -45), (65, -45), -52, "4× 8 × 45°")]) drawing = SheetFigure([view], margin=24, notes=("planex2d.org", "2D exercise 13")) print("scale", drawing.planex_scale, "| paper", [round(v * 25.4) for v in drawing.get_size_inches()], "mm") save_figure(drawing, "motor-mount-plate", dpi=200) plt.close(drawing) ```