Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

5.4 KB
Raw Blame
Units: mm

Template<OpeningRadius: Length>
Struct LampBase {

    // The large opening is the XY datum. Source XY is translated by (-38, 0) mm.
    Concept Struct BaseSketch on XY {
        Point2 Nose { position: [-144.9mm, 0mm] }
        Point2 UpperNoseHandle { position: [-144.9mm, 53.96mm] }
        Point2 UpperShoulderHandle { position: [-47.32mm, 74.4mm] }
        Point2 UpperShoulder { position: [-5.5mm, 74.4mm] }
        Point2 LowerShoulder { position: [-5.5mm, -74.4mm] }
        Point2 LowerShoulderHandle { position: [-47.32mm, -74.4mm] }
        Point2 LowerNoseHandle { position: [-144.9mm, -53.96mm] }
        Point2 RoundCenter { position: [-5.5mm, 0mm] }
        Point2 OpeningCenter { position: [0mm, 0mm] }
        Point2 PostMountCenter { position: [-116mm, 0mm] }
        Point2 AuxiliaryMountCenter { position: [-82mm, -25mm] }

        CubicBezier2 UpperFlank { from: UpperShoulder; control1: UpperShoulderHandle; control2: UpperNoseHandle; to: Nose }
        Circle2 RoundEnd { center: RoundCenter; radius: 74.4mm }
        CubicBezier2 LowerFlank { from: Nose; control1: LowerNoseHandle; control2: LowerShoulderHandle; to: LowerShoulder }
        Circle2 LargeOpening { center: OpeningCenter; radius: OpeningRadius }
        Circle2 PostMount { center: PostMountCenter; radius: 7mm }
        Circle2 AuxiliaryMount { center: AuxiliaryMountCenter; radius: 3.5mm }
    }

    Profile PlateSection using BaseSketch {
        Loop Outer {
            Segment Lower { trace: LowerFlank; from: Nose; to: LowerShoulder }
            Segment Round { trace: RoundEnd; from: LowerShoulder; to: UpperShoulder; sweep: CounterClockwise }
            Segment Upper { trace: UpperFlank; from: UpperShoulder; to: Nose }
        }
        Loop Inner { LargeOpening as OpeningBoundary |> TraceLoop }
        Loop Inner { PostMount as PostBoundary |> TraceLoop }
        Loop Inner { AuxiliaryMount as AuxiliaryBoundary |> TraceLoop }
    }

    Struct Base { Extrude PrimaryPlate { profile: PlateSection; from: 0mm; to: 12mm } }
}


// Product frame follows the source millimetre XY/Z axes. The base profile has its own opening-centered datum.
Template<PoleRadius: Length, PoleHeight: Length>
Struct Upright {
    Circle2 SectionCircle { center: [0mm,0mm] radius: PoleRadius }
    Profile Section { Loop Outer { SectionCircle |> TraceLoop } }
    Extrude Shaft { profile: Section from: 0mm to: PoleHeight }
}

Template<OuterRadius: Length, InnerRadius: Length, CollarHeight: Length>
Struct AnnularCollar {
    Circle2 Outside { center: [0mm,0mm] radius: OuterRadius }
    Circle2 Inside { center: [0mm,0mm] radius: InnerRadius }
    Profile Section { Loop Outer { Outside |> TraceLoop } Loop Inner { Inside as BoreBoundary |> TraceLoop } }
    Extrude Body { profile: Section from: 0mm to: CollarHeight }
}

// The original underside nut sits within the omitted recessed pocket. This
// canonical fitting is placed immediately below the flat replacement plate.
Template<WidthAcrossFlats: Length, BoreRadius: Length, NutHeight: Length>
Struct HexNut {
    RegularPolygon2<6> Outside { Center: [0mm, 0mm] AcrossFlats: WidthAcrossFlats Rotation: 0deg }
    Circle2 Bore { center: [0mm, 0mm] radius: BoreRadius }
    Profile Section { Loop Outer { Outside |> TraceLoop } Loop Inner { Bore as BoreBoundary |> TraceLoop } }
    Extrude Body { profile: Section from: 0mm to: NutHeight }
}

Template<PivotRadius: Length, PivotLength: Length>
Struct PivotPin {
    Circle2 SectionCircle { center: [0mm,0mm] radius: PivotRadius }
    Profile Section { Loop Outer { SectionCircle |> TraceLoop } }
    Extrude Body { profile: Section from: 0mm to: PivotLength }
}

Template<OutsideRadius: Length, InsideRadius: Length, TubeLength: Length>
Struct HeadTube {
    Circle2 Outside { center: [0mm,0mm] radius: OutsideRadius }
    Circle2 Inside { center: [0mm,0mm] radius: InsideRadius }
    Profile Section { Loop Outer { Outside |> TraceLoop } Loop Inner { Inside as InteriorBoundary |> TraceLoop } }
    Extrude Body { profile: Section from: 0mm to: TubeLength }
}

Assembly CartesianLamp {
    <Assembly CartesianLamp>
        <Part Base = LampBase<OpeningRadius: 61.6mm>>
            Placement { from: Origin; to: Parent; translateLocal: [38mm, 0mm, 0mm]; }
        </Part>
        <Part Pole = Upright<PoleRadius: 5.5mm, PoleHeight: 429mm>>
            Placement { from: Origin; to: Parent; translateLocal: [-78mm, 0mm, 2mm]; }
        </Part>
        <Part LowerCollar = AnnularCollar<OuterRadius: 9mm, InnerRadius: 5.5mm, CollarHeight: 11mm>>
            Placement { from: Origin; to: Parent; translateLocal: [-78mm, 0mm, 12mm]; }
        </Part>
        <Part MountNut = HexNut<WidthAcrossFlats: 17.32mm, BoreRadius: 5.5mm, NutHeight: 3mm>>
            Placement { from: Origin; to: Parent; translateLocal: [-78mm, 0mm, -3mm]; }
        </Part>
        <Part Pivot = PivotPin<PivotRadius: 10mm, PivotLength: 20mm>>
            Placement { from: Origin; to: Parent; translateLocal: [-78mm, -10mm, 441mm]; rotateLocal: { axis: X; angle: -90deg; }; }
        </Part>
        <Part LampBody = HeadTube<OutsideRadius: 27mm, InsideRadius: 26mm, TubeLength: 143.5mm>>
            Placement { from: Origin; to: Parent; translateLocal: [-153.8mm, 0mm, 537.5mm]; rotateLocal: { axis: Y; angle: 126.86989764584402deg; }; }
        </Part>
        <Part Shade = LoftFile<"lamp-shade-loft.firmament">>
            Placement { from: Origin; to: Parent; }
        </Part>
    </Assembly>
    anchor: CartesianLamp;
}