Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

1.5 KB
Raw Blame
Model ProfileComposeLBracketExternalModifyCounterbore {
    Units: mm

    Record MountSpec { Center: Point2 Diameter: Length }
    Static Mounts: MountSpec[] = [
        MountSpec { Center: Point2(20mm, -10mm) Diameter: 6mm }
        MountSpec { Center: Point2(-30mm, 20mm) Diameter: 6mm }
    ]
    Template<spec: MountSpec> BoltHole {
        Hole<Shaft> Mount {
            On: +Z
            Center: spec.Center
            Diameter: spec.Diameter
            End: ThroughAll
        }
    }

    Concept Struct Layout On XY {
        Rect2 Horizontal { Center: [0mm, -10mm]; Size: [80mm, 20mm] }
        Rect2 Vertical { Center: [-30mm, 10mm]; Size: [20mm, 60mm] }
        Point2 Notch { Position: [-20mm, 0mm] }
    }

    Profile Bracket Using Layout { Loop Outer {
        Horizontal.Bottom As South
            |> Horizontal.Right As East
            |> Horizontal.Top To Notch As Inner
            |> Vertical.Right To Vertical.TopRight As Upright
            |> Vertical.Top As North
            |> Vertical.Left To Horizontal.BottomLeft As West
            |> Close
    } }

    Struct BracketBody {
        Compose BracketBody {
            Base Stock { Profile: Bracket; From: 0mm; To: 12mm; Role: Stock }
        }
    }

    Modify BracketBody {
        Pattern BoltPattern Over Mounts { BoltHole<Current> }
        Hole<Counterbore> LocatingPin {
            On: +Z
            Center: Point2(-30mm, -10mm)
            Diameter: 8mm
            CounterboreDiameter: 14mm
            CounterboreDepth: 4mm
            End: ThroughAll
        }
    }
}