Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

1.7 KB
Raw Blame
// Each shape publishes its mounting origin. Panel uses its left-edge midpoint.
Template<R: Length, H: Length> Struct Drum {
 Circle2 Outline { center: [0mm,0mm]; radius: R }
 Profile Section { Loop Outer { Outline |> TraceLoop } }
 Extrude Body { profile: Section; from: 0mm; to: H }
 expose { Semantic BottomSeat { DatumFrame Frame = [0mm,0mm,0mm] x [1,0,0] y [0,1,0] z [0,0,1]; } }
}
Template<R: Length, Bore: Length, H: Length> Struct Ring {
 Circle2 Outside { center: [0mm,0mm]; radius: R }
 Circle2 Inside { center: [0mm,0mm]; radius: Bore }
 Profile Section { Loop Outer { Outside |> TraceLoop } Loop Inner { Inside as BoreBoundary |> TraceLoop } }
 Extrude Body { profile: Section; from: 0mm; to: H }
 expose { Semantic BottomSeat { DatumFrame Frame = [0mm,0mm,0mm] x [1,0,0] y [0,1,0] z [0,0,1]; } }
}
Template<L: Length, W: Length, H: Length, R: Length> Struct Panel {
 RoundedRect2 Outline { center: [L / 2,0mm]; size: [L,W]; radius: R }
 Profile Section { Loop Outer { Outline |> TraceLoop } }
 Extrude Body { profile: Section; from: 0mm; to: H }
 expose { Semantic BottomSeat { DatumFrame Frame = [0mm,0mm,0mm] x [1,0,0] y [0,1,0] z [0,0,1]; } }
}
Record HardwareSite { X: Length; Y: Length; Z: Length }
// One complete fastener. The 12 mm shaft ends at the plate underside;
// the head starts above its 2 mm thickness. No shaft protrudes through the plate.
Subassembly CoverFastener {
 <Assembly CoverFastener>
  <Part Standoff = Drum<R:2.5mm,H:12mm>> material: Steel;
   Placement { from: BottomSeat.Frame; to: World; }
  </Part>
  <Part Head = Drum<R:1.5mm,H:1.5mm>> material: Steel;
   Placement { from: BottomSeat.Frame; to: World; translateLocal: [0mm,0mm,14mm]; }
  </Part>
 </Assembly>
 anchor: CoverFastener;
 expose { DatumFrame Mount = Standoff.BottomSeat.Frame; }
}