FoundationPartsOperationsSplit & Full round

Split & Full round

  • Split(solid, plane_name, keep) keeps the part of a solid on one side of a world plane ("XY", "YZ", "XZ"). keep="TOP" keeps the +normal side (z ≥ 0 for XY), "BOTTOM" the other — the dome above is half a sphere. keep="BOTH" keeps both halves as separate solids that share the cut face, e.g. to colour or export them apart. The cut uses OpenCascade’s splitter.
  • FullRound(solid, face_finder) rounds over a face: the two long edges of the face picked by the FaceFinder are filleted to (just under) half the face width, turning the flat top of the rib into a half-round.

Both replace the solid built so far with their result, like Fillet.

from cadbuildr.foundation import *


class Dome(Part):
    """Split keeps one side of a world plane: half a sphere."""

    def __init__(self, radius=20):
        s = Sketch(self.xy())
        self.add_operation(Split(Sphere(s.origin, radius), "XY", "TOP"))
        self.paint("light_blue")


class RoundedRib(Part):
    """FullRound rounds over the selected face: the top of a 4 mm rib."""

    def __init__(self, length=40, thickness=4, height=20):
        s = Sketch(self.xy())
        rib = Extrusion(
            Rectangle.from_center_and_sides(s.origin, length, thickness), height
        )
        top = FaceFinder(rule=InPlaneFinderRule(self.xy(), height))
        self.add_operation(FullRound(rib, top))
        self.translate([50, 0, 0])
        self.paint("dark_orange")


class SplitAndFullRound(Assembly):
    def __init__(self):
        self.add_component(Dome())
        self.add_component(RoundedRib())


show(SplitAndFullRound())