--- jupyter: description: 'A lobed gasket as a 2D CAD exercise: a dimensioned drawing to model in planex2d or any CAD system, a solution from Boolean operations on discs with filleted corners, and the area to check a model against.' --- # Lobed gasket A lobed gasket seals a flange with three bolts. It is a ring around the bore with an ear around each bolt hole. Its outline is easiest to model with Boolean operations instead of a sketch, as the union of four discs with its inner corners rounded. Model the gasket 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 lobed gasket exercise: a dimensioned drawing of a gasket with three ears on a bolt circle, the corners between them rounded](../_static/gallery/lobed-gasket.png){.result} ```python import math import planex as px ``` ```python nbsphinx="hidden" from docs_figures import Row ``` ## The discs The body is a disc of radius 30 around the origin. One ear, of radius 14, sits on the bolt circle of 80 straight above the center, and `Rotated` turns two copies of it by 120° and 240°. `px.Unify` unites the four discs into one face, whose only corners are the six where the ears meet the body (Figure 1). ```python body = px.Circle((0, 0), 30).Face() ear = px.Circle((0, 40), 14).Face() lobes = px.Unify([body, ear, ear.Rotated((0, 0), 120), ear.Rotated((0, 0), 240)]) print("corners", len(lobes.vertices)) ``` ```python nbsphinx="hide-input" Row((lobes, "The union of the body and the three ears"), caption="The discs") ``` ## The fillets and the holes `Fillet` rounds the six corners with a radius of 6. The bore of 30 and the three bolt holes of 9, on the bolt circle like the ears, are made the same way and cut out with `-` (Figure 2): ```python lobes.Fillet(lobes.vertices, 6) hole = px.Circle((0, 40), 9 / 2).Face() holes = px.Unify([px.Circle((0, 0), 30 / 2).Face(), hole, hole.Rotated((0, 0), 120), hole.Rotated((0, 0), 240)]) gasket = lobes - holes ``` ```python nbsphinx="hide-input" Row((gasket, "The gasket, its corners rounded and its holes cut"), caption="The gasket") ``` ## The checks This is the area, to compare with your own model. The gasket has three ears around one center, so its centroid lies on that center: ```python print("area", round(gasket.mass, 2), "mm²") print("centroid off the center by", round(math.hypot(*gasket.center[:2]), 6)) ``` The gasket as DXF in millimeters, for a cutting plotter or a laser cutter: ```python gasket.WriteDXF("lobed_gasket.dxf", unit=px.mm, scale=1) # scale=1: the numbers as they are ``` The gasket as DXF: [lobed_gasket.dxf](lobed_gasket.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 arcs of the finished gasket by their radii: the body, the ears, the fillets, the holes found = {} for e in gasket.edges: m = e.Measure() found.setdefault(round(m["radius"], 6), []).append(m["center"][:2]) top = max(found[14], key=lambda c: c[1]) fillet = max(found[6], key=lambda c: (c[0], c[1])) directions = [(math.cos(math.radians(a)), math.sin(math.radians(a))) for a in (90, 210, 330)] view = View([], lines=gasket.Polylines(1e-3), circles=[((0, 0), 40, "pitch")], axes=[((0, 0), (58 * u, 58 * v), (40 * u, 40 * v)) for u, v in directions] + [((-35, 0), (35, 0), (0, 0)), ((0, -35), (0, 0))], radii=[((0, 0), 30, (285, "outside")), (top, 14, (60, "outside", 3)), (fillet, 6, (180, "inside", 6))], diameters=[((0, 0), 15, 135), (top, 4.5, (150, "leader", 3, "EQS"))]) drawing = SheetFigure([view], margin=20, notes=("planex2d.org", "2D exercise 04")) print("scale 1 :", round(1 / drawing.planex_scale), "| paper", [round(v * 25.4) for v in drawing.get_size_inches()], "mm") save_figure(drawing, "lobed-gasket", dpi=200) plt.close(drawing) ```