FoundationPartsSheet MetalJog

Jog

SheetMetalJog(body, line, offset) offsets the part of a flange beyond line with two opposite bends. The strap above steps up 10 mm at x = 10 and carries on flat.

  • Which side moves: the side away from fixed_face if you give one, otherwise the side with less material.
  • jog_angle (default 90°) sets the steepness of the step.
  • dimension_position says what offset measures: OUTSIDE (default) from the original top face to the jogged panel’s top face, INSIDE the clear height between the facing faces, OVERALL top to bottom.

The jogged panel keeps its original width, so the part grows by the step. It is built from two chained edge flanges, so it unfolds (front, orange) and takes cuts like any other flange.

from cadbuildr.foundation import (
    Assembly,
    Line,
    Part,
    Point,
    Rectangle,
    SheetMetalBaseFlange,
    SheetMetalJog,
    SheetMetalToSolid,
    Sketch,
    Unfold,
    show,
)


class _JoggedStrap(Part):
    """A strap with a 10 mm jog: the part beyond x = 10 steps up and continues flat."""

    def __init__(self, flatten=False, length=100, width=40, thickness=2):
        s = Sketch(self.xy())
        body = SheetMetalBaseFlange(
            profile=Rectangle.from_center_and_sides(s.origin, length, width),
            thickness=thickness,
        )
        line = Line(Point(s, 10, -width / 2), Point(s, 10, width / 2))
        body = SheetMetalJog(body=body, line=line, offset=10)
        if flatten:
            body = Unfold(body=body)
        self.add_operation(SheetMetalToSolid(body=body))
        self.paint("orange" if flatten else "light_blue")


class SheetMetalJogStrap(Assembly):
    """SheetMetalJog: the jogged strap (back) and its flat pattern (front)."""

    def __init__(self):
        folded = _JoggedStrap()
        folded.translate([0, 35, 0])
        self.add_component(folded)
        flat = _JoggedStrap(flatten=True)
        flat.translate([0, -35, 0])
        self.add_component(flat)


show(SheetMetalJogStrap())