Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

1.7 KB
Raw Blame
schema Mechanical

Model PlaneHoleSupport {
    units: mm

    Concept Struct Supports {
        Top: Plane { origin: [0mm,0mm,8mm]; normal: [0,0,1]; up: [0,1,0] }
    }
    Construction Plane TopSupport { Trace: Supports.Top }

    Record MountSpec { Center: Point2 }
    Static Mounts: MountSpec[] = [
        MountSpec { Center: Point2(-16mm, -9mm) }
        MountSpec { Center: Point2(16mm, -9mm) }
        MountSpec { Center: Point2(-16mm, 9mm) }
        MountSpec { Center: Point2(16mm, 9mm) }
    ]
    Template<spec: MountSpec> M8Counterbore {
        Hole<Counterbore> Mount {
            on: MountingArea
            center: spec.Center
            diameter: 8mm
            counterboreDiameter: 16mm
            counterboreDepth: 3mm
            end: ThroughAll
        }
    }

    Concept Struct Layout on XY {
        Rect2 Stock { center: [0mm,0mm]; size: [100mm,80mm] }
        Point2 South { position: [0mm,-32mm] }
        Point2 East { position: [45mm,0mm] }
        Point2 North { position: [0mm,32mm] }
        Point2 West { position: [-45mm,0mm] }
        Line2 SE { from: South; to: East }
        Line2 EN { from: East; to: North }
        Line2 NW { from: North; to: West }
        Line2 WS { from: West; to: South }
    }

    Profile StockProfile using Layout {
        Loop Outer { Stock.Bottom |> Stock.Right |> Stock.Top |> Stock.Left |> Close }
    }
    Profile MountBoundary using Layout {
        Loop Outer { SE |> EN |> NW |> WS |> Close }
    }

    Span<Plane> MountingArea { On: TopSupport; Boundary: MountBoundary }

    Struct Part {
        Compose Plate {
            Base StockBody { profile: StockProfile; from: 0mm; to: 8mm; role: Stock }
            Pattern MountPattern over Mounts { M8Counterbore<Current> }
        }
    }
}