{
 "commands": [
  {
   "command": "parameters.add",
   "params": {
    "name": "d",
    "expression": "6 mm",
    "comment": "cable diameter (main parameter), about 4..12 mm"
   }
  },
  {
   "command": "parameters.add",
   "params": {
    "name": "gap",
    "expression": "d - 0.5 mm",
    "comment": "snap opening, must be < d"
   }
  },
  {
   "command": "parameters.add",
   "params": {
    "name": "wall",
    "expression": "1.6 mm"
   }
  },
  {
   "command": "parameters.add",
   "params": {
    "name": "base_l",
    "expression": "20 mm"
   }
  },
  {
   "command": "parameters.add",
   "params": {
    "name": "base_w",
    "expression": "12 mm"
   }
  },
  {
   "command": "parameters.add",
   "params": {
    "name": "t",
    "expression": "2 mm"
   }
  },
  {
   "command": "parameters.add",
   "params": {
    "name": "seat",
    "expression": "0.4 mm",
    "comment": "floor between cable and base top"
   }
  },
  {
   "command": "parameters.add",
   "params": {
    "name": "arm_w",
    "expression": "base_w - 2 mm",
    "comment": "clip width along the cable"
   }
  },
  {
   "command": "parameters.add",
   "params": {
    "name": "zc",
    "expression": "t + d/2 + seat",
    "comment": "cable axis height"
   }
  },
  {
   "command": "sketch.create",
   "params": {
    "plane": "XY",
    "name": "BaseSketch"
   }
  },
  {
   "command": "sketch.draw.dimensioned",
   "params": {
    "command": "sketch.rectangle.center",
    "params": {
     "center": [
      0,
      0
     ],
     "corner": [
      10,
      6
     ]
    },
    "dimensions": {
     "width": "base_l",
     "height": "base_w"
    }
   }
  },
  {
   "command": "sketch.constraint.coincident",
   "params": {
    "a": "p5",
    "b": "origin"
   }
  },
  {
   "command": "sketch.finish",
   "params": {}
  },
  {
   "command": "solid.extrude",
   "params": {
    "distance": "t",
    "name": "Base",
    "body_name": "Clip"
   }
  },
  {
   "command": "sketch.create",
   "params": {
    "plane": "XZ",
    "name": "RingSketch"
   }
  },
  {
   "command": "sketch.circle.center",
   "params": {
    "center": [
     0,
     -5.4
    ],
    "diameter": 6
   }
  },
  {
   "command": "sketch.circle.center",
   "params": {
    "center": "c1.center",
    "diameter": 9.2
   }
  },
  {
   "command": "sketch.constraint.coincident",
   "params": {
    "a": "c1.center",
    "b": "y"
   }
  },
  {
   "command": "sketch.dimension",
   "params": {
    "entities": [
     "origin",
     "c1.center"
    ],
    "type": "vertical",
    "value": "zc"
   }
  },
  {
   "command": "sketch.dimension",
   "params": {
    "entities": [
     "c1"
    ],
    "type": "diameter",
    "value": "d"
   }
  },
  {
   "command": "sketch.dimension",
   "params": {
    "entities": [
     "c2"
    ],
    "type": "diameter",
    "value": "d + 2*wall"
   }
  },
  {
   "command": "sketch.finish",
   "params": {}
  },
  {
   "command": "solid.extrude",
   "params": {
    "distance": "arm_w",
    "direction": "symmetric",
    "operation": "join",
    "profiles": [
     {
      "point": [
       0,
       -9.2
      ]
     }
    ],
    "name": "Ring"
   }
  },
  {
   "command": "sketch.create",
   "params": {
    "plane": "XZ",
    "name": "GapSketch"
   }
  },
  {
   "command": "sketch.rectangle.two_point",
   "params": {
    "p0": [
     -2.75,
     -5.4
    ],
    "p1": [
     2.75,
     -12
    ]
   }
  },
  {
   "command": "sketch.dimension",
   "params": {
    "entities": [
     "origin",
     "p1"
    ],
    "type": "horizontal",
    "value": "gap/2"
   }
  },
  {
   "command": "sketch.dimension",
   "params": {
    "entities": [
     "origin",
     "p2"
    ],
    "type": "horizontal",
    "value": "gap/2"
   }
  },
  {
   "command": "sketch.dimension",
   "params": {
    "entities": [
     "origin",
     "p1"
    ],
    "type": "vertical",
    "value": "zc"
   }
  },
  {
   "command": "sketch.dimension",
   "params": {
    "entities": [
     "origin",
     "p3"
    ],
    "type": "vertical",
    "value": "zc + d/2 + wall + 2 mm"
   }
  },
  {
   "command": "sketch.finish",
   "params": {}
  },
  {
   "command": "solid.extrude",
   "params": {
    "distance": "base_w + 4 mm",
    "direction": "symmetric",
    "operation": "cut",
    "name": "Opening"
   }
  },
  {
   "command": "parameters.add",
   "params": {
    "name": "r_base",
    "expression": "2 mm"
   }
  },
  {
   "command": "solid.fillet",
   "params": {
    "edges": [
     [
      10,
      6,
      1
     ],
     [
      -10,
      6,
      1
     ],
     [
      10,
      -6,
      1
     ],
     [
      -10,
      -6,
      1
     ]
    ],
    "radius": "r_base",
    "name": "BaseCorners"
   }
  },
  {
   "command": "solid.fillet",
   "params": {
    "edges": [
     [
      0,
      6,
      2
     ]
    ],
    "radius": "0.8 mm",
    "name": "BaseTopEdge"
   }
  },
  {
   "command": "solid.fillet",
   "params": {
    "edges": [
     [
      0,
      6,
      0
     ]
    ],
    "radius": "0.3 mm",
    "name": "BaseBottomEdge"
   }
  },
  {
   "command": "solid.fillet",
   "params": {
    "edges": [
     [
      3.0984,
      0,
      2
     ],
     [
      -3.0984,
      0,
      2
     ]
    ],
    "radius": "0.8 mm",
    "name": "RingRoot"
   }
  },
  {
   "command": "solid.fillet",
   "params": {
    "edges": [
     [
      2.75,
      0,
      6.5991
     ],
     [
      -2.75,
      0,
      6.5991
     ],
     [
      2.75,
      0,
      9.0875
     ],
     [
      -2.75,
      0,
      9.0875
     ]
    ],
    "radius": "0.6 mm",
    "name": "JawTips"
   }
  },
  {
   "command": "solid.fillet",
   "params": {
    "edges": [
     [
      -4.3226,
      5,
      6.9733
     ],
     [
      -4.3226,
      -5,
      6.9733
     ],
     [
      -2.8191,
      5,
      4.3739
     ],
     [
      -2.8191,
      -5,
      4.3739
     ]
    ],
    "radius": "0.4 mm",
    "name": "RingEdges"
   }
  }
 ]
}