FoundationPartsOperationsPartial revolve (Lathe angle)

Partial revolve (Lathe angle)

Lathe(shape, axis, angle=90) revolves the profile through angle degrees instead of a full turn. The default is 360°.

The elbow revolves a pipe cross-section a quarter turn, then cuts the bore with a second Lathe(..., cut=True, angle=90).

from cadbuildr.foundation import *


class PipeElbow(Part):
    """A 90° pipe elbow: a Lathe with `angle=90` instead of a full turn.

    The pipe cross-section is revolved a quarter turn around the Z axis; a
    `thin_wall`-free solid elbow is then hollowed with a second, cutting
    revolve of the bore.
    """

    def __init__(self, bend_radius=30, outer_r=6, wall=1.5, angle=90):
        s = Sketch(self.xz())
        axis = Axis(Line(Point(s, 0, -10), Point(s, 0, 10)))
        outer = Circle(Point(s, bend_radius, 0), outer_r)
        bore = Circle(Point(s, bend_radius, 0), outer_r - wall)
        self.add_operation(Lathe(outer, axis, angle=angle))
        self.add_operation(Lathe(bore, axis, cut=True, angle=angle))
        self.paint("dark_orange")


show(PipeElbow())