Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

1.5 KB
Raw Blame
Model NamedMountingPoints {
    units: mm

    Feature M8Counterbore(Center: Point2) -> Hole<Counterbore> {
        return Hole<Counterbore> {
            on: MountingArea
            center: Center
            diameter: 8mm
            counterboreDiameter: 16mm
            counterboreDepth: 3mm
            end: ThroughAll
        }
    }

    Static MountPoints: Set<Point2> {
        LowerLeft  => Point2(-16mm, -9mm)
        LowerRight => Point2(16mm, -9mm)
        UpperLeft  => Point2(-16mm, 9mm)
        UpperRight => Point2(16mm, 9mm)
    }

    Concept Struct Supports {
        Top: Plane { origin: [0mm,0mm,8mm]; normal: [0,0,1]; up: [0,1,0] }
    }
    Construction Plane TopSupport { Trace: Supports.Top }
    Concept Struct Layout on XY {
        Rect2 Stock { center: [0mm,0mm]; size: [100mm,80mm] }
        Polygon2<Rhombus> MountBoundaryShape {
            Center: [0mm,0mm]
            Diagonals: [90mm,64mm]
        }
    }
    Profile StockProfile using Layout {
        Loop Outer { Stock.Bottom |> Stock.Right |> Stock.Top |> Stock.Left |> Close }
    }
    Profile MountBoundary using Layout {
        Loop Outer { MountBoundaryShape |> TraceLoop }
    }
    Span<Plane> MountingArea { On: TopSupport; Boundary: MountBoundary }

    Struct Part {
        Compose Plate {
            Base StockBody { profile: StockProfile; from: 0mm; to: 8mm; role: Stock }
            Pattern Mounts over MountPoints {
                point => M8Counterbore(Center: point)
            }
        }
    }
}