Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

1.2 KB
Raw Blame
// Production geometry for the canonical Interface-only arm witness.
Template<R: Length> Struct ArmBase {
 Circle2 Outside { center: [0mm,0mm] radius: R }
 Profile Section { Loop Outer { Outside |> TraceLoop } }
 Extrude Body { profile: Section from: -4mm to: 0mm }
}
Template<L: Length> Struct ArmLink {
 Rect2 Stock { center: [10mm,0mm] size: [L,5mm] }
 Profile Section { Loop Outer { Stock.Bottom |> Stock.Right |> Stock.Top |> Stock.Left |> Close } }
 Extrude Body { profile: Section from: 0mm to: 3mm }
}
Assembly TwoLinkArm {
  <Assembly TwoLinkArm>
    <Part Base = ArmBase<R: 8mm>>
      Semantic Hinge { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }
    </Part>
    <Part Link1 = ArmLink<L: 20mm>>
      Semantic Input { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }
      Semantic Output { DatumFrame Frame = [20,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }
    </Part>
    <Part Link2 = ArmLink<L: 20mm>>
      Semantic Input { DatumFrame Frame = [0,0,0] x [1,0,0] y [0,1,0] z [0,0,1]; }
    </Part>
  </Assembly>
  anchor: TwoLinkArm.Base.Hinge;
  Interface<Revolute> Shoulder { a: TwoLinkArm.Base.Hinge; b: TwoLinkArm.Link1.Input; }
  Interface<Revolute> Elbow { a: TwoLinkArm.Link1.Output; b: TwoLinkArm.Link2.Input; }
}