Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

2.4 KB
Raw Blame
schema Mechanical
Model PickupFunctional {
 units: mm
// One exact pickup part; all construction coordinates are local to its Mount.
Record PickupSpec {
 Width: Length; Depth: Length; BaseHeight: Length
 CoilWidth: Length; CoilDepth: Length; CoilHeight: Length
 CoilOffset: Length; PolePitch: Length
}
Static StandardPickup: PickupSpec {
 Width: 88mm; Depth: 46mm; BaseHeight: 4mm
 CoilWidth: 70mm; CoilDepth: 17mm; CoilHeight: 5mm
 CoilOffset: 10mm; PolePitch: 10.2mm
}
Static BridgePickupSpec = StandardPickup with { PolePitch: 10.2mm }

Feature Coil(Center: Point2, Width: Length, Depth: Length, Height: Length, Support: Plane) -> Boss {
 RoundedRect2 Outline { center: Center; size: [Width,Depth]; radius: 3mm }
 Profile Section { Loop Outer { Outline |> TraceLoop } }
 return Boss { on: Support; profile: Section; height: Height }
}
Feature Pole(Center: Point2, Support: Plane) -> Boss {
 Circle2 Outline { center: Center; radius: 2.2mm }
 Profile Section { Loop Outer { Outline |> TraceLoop } }
 return Boss { on: Support; profile: Section; height: 1mm }
}

Template<Spec: PickupSpec> Struct Humbucker {
 Concept Struct Layout on XY {
  Point2 UpperCenter { position: [0mm,Spec.CoilOffset] }
  Point2 LowerCenter { position: [0mm,-Spec.CoilOffset] }
  Axis2 Longitudinal { origin: [0mm,0mm]; direction: [1,0] }
  Axis2 Transverse { origin: [0mm,0mm]; direction: [0,1] }
  Point2 FirstPole { position: [-2.5 * Spec.PolePitch,Spec.CoilOffset] }
  RoundedRect2 BaseOutline { center: [0mm,0mm]; size: [Spec.Width,Spec.Depth]; radius: 4mm }
 }
 Profile BaseProfile using Layout { Loop Outer { BaseOutline |> TraceLoop } }
 Plane BaseTop { origin: [0mm,0mm,Spec.BaseHeight]; normal: [0,0,1]; up: [0,1,0] }
 Plane CoilTop { origin: [0mm,0mm,Spec.BaseHeight + Spec.CoilHeight]; normal: [0,0,1]; up: [0,1,0] }
 Compose Body {
  Base Housing { profile: BaseProfile; from: 0mm; to: Spec.BaseHeight; role: Stock }
  Feature UpperCoil = Coil(Center: Layout.UpperCenter, Width: Spec.CoilWidth, Depth: Spec.CoilDepth, Height: Spec.CoilHeight, Support: BaseTop)
  Feature LowerCoil = Coil(Center: Layout.LowerCenter, Width: Spec.CoilWidth, Depth: Spec.CoilDepth, Height: Spec.CoilHeight, Support: BaseTop)
  Feature PoleSeed = Pole(Center: Layout.FirstPole, Support: CoilTop)
  Linear Pattern Poles {
   source: PoleSeed
   direction: Layout.Longitudinal.Direction
   count: 6
   spacing: Spec.PolePitch
  }
 }
}

 Struct Product = Humbucker<Spec: StandardPickup>
}