KeyHole_M4

Keyhole wall mounting point

Category: Keyhole

Using this part

This TurboCase prefab can be directly pasted into your KiCad PCB editor by using the copy button below. The code of the footprint is also shown here for reference. The footprint file can also be downloaded to be added to your own local footprint libraries.

Download footprint
(
  footprint
  "KeyHole_M4"
  (version 20240108)
  (generator turbocaseweb)
  (descr "Keyhole wall mounting point")
  (attr board_only exclude_from_pos_files exclude_from_bom allow_missing_courtyard)
  (zone_connect 0)
  (
    property
    "TurboCaseModule"
    "eJzFU8tugzAQvPMVPuLiEINEe0C5V8onVFHlwCZYMkYyRlFU5d+LaR5sSKAvKRYHloWd2ZmhrPJGAVnC/rVS8F4369oakVm/cGUuRQkWDCMFiPy6LEBuC0vJh0faUwqzlZosCA/jtHvSDtK1Ehb8N844m0V8RbuGO42WlfZPH59OtldS52D8KGEEc5jHNPjCuN+hqYfGIQZ4h3nMyEuY9BidOTTr9n2EEPjx0xFhIEWUrBjJQLfFwpoGfsCBEX4LH2uASfc1uN2h6XniwTt4JTL4P2zdCaW6+vm4aS43GzCgM0B+Tjl8f4XAQUy0/yTzA0i4vPGRvGEc2kucu+3AhtEbJO/i/LgLmGh7zXjIr8ldVApHdBpN4vctejCB39szdCWc8sX9l5/38ZTh"
    (at 0 0 0)
    (unlocked yes)
    (layer "F.SilkS")
    (hide yes)
    (uuid "ef79ef8d-5d25-4b0f-b267-2f661e762d73")
    (
      effects
      (
        font
        (size 1 1)
        (thickness 0.1)
      )
    )
  )
  (
    property
    "TurboCaseAdd"
    "KeyHole(hole_diameter=4, head_diameter=7.5, head_height=2.2)"
    (at 0 0 0)
    (unlocked yes)
    (layer "F.SilkS")
    (hide yes)
    (uuid "ba1b8bbb-a09d-4d39-b13f-c695940e40dc")
    (
      effects
      (
        font
        (size 1 1)
        (thickness 0.1)
      )
    )
  )
  (
    property
    "TurboCaseSub"
    "KeyHole_substract(hole_diameter=4, head_diameter=7.5, head_height=2.2)"
    (at 0 0 0)
    (unlocked yes)
    (layer "F.SilkS")
    (hide yes)
    (uuid "c2f55931-1221-4d36-80af-2a504d0e0d86")
    (
      effects
      (
        font
        (size 1 1)
        (thickness 0.1)
      )
    )
  )
  (
    fp_arc
    (start -4.35 0)
    (mid 0 -4.35)
    (end 4.35 0)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "7e48eff3-f340-4597-a05f-7363216e93d2")
  )
  (
    fp_arc
    (start -4.35 7.5)
    (mid 0 11.85)
    (end 4.35 7.5)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "483b9a27-2d04-419b-89ae-72939a569f4e")
  )
  (
    fp_line
    (start -4.35 0)
    (end -4.35 7.5)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "4d5af190-1f6d-4de8-acf4-61aa34c56710")
  )
  (
    fp_line
    (start 4.35 0)
    (end 4.35 7.5)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "0a9c423d-09cb-4943-8da2-e1d04332a750")
  )
  (
    fp_arc
    (start -2.0 0)
    (mid 0 -2.0)
    (end 2.0 0)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "930188fe-580a-4baf-9bf8-d5ad58126ecc")
  )
  (
    fp_line
    (start -2.0 0)
    (end -2.0 7.7)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "06669941-9c82-4e95-a275-046d79920815")
  )
  (
    fp_line
    (start 2.0 0)
    (end 2.0 7.7)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "875f0f91-a97c-4016-8c0c-b9bfce3037c8")
  )
  (
    fp_circle
    (center 0 7.5)
    (end 3.75 7.7)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (fill none)
    (layer "User.6")
    (uuid "b668663b-fc85-4d43-8589-96695c4677d6")
  )
)

The OpenSCAD code

This is the OpenSCAD code that will end up in your final case .scad file:

module KeyHole_substract(hole_diameter, head_diameter, head_height) {
    margin = 0.2;
    translate([0,0,-10])
        union() {
            cylinder(15, (hole_diameter/2)+margin, (hole_diameter/2)+margin);

            translate([0, head_diameter/2, 7.5])
                cube([hole_diameter+(2*margin), head_diameter, 15], center=true);

            translate([0, head_diameter, 0])
                cylinder(15, (head_diameter/2)+margin, (head_diameter/2)+margin);
        }
}
module KeyHole(hole_diameter, head_diameter, head_height) {
    margin = 0.2;
    wall = 0.6;

    difference() {
        union() {
            cylinder(1, (head_diameter/2)+margin+wall, (head_diameter/2)+margin+wall);

            translate([0, head_diameter, 0])
            cylinder(1, (head_diameter/2)+margin+wall, (head_diameter/2)+margin+wall);

            translate([0, head_diameter/2, 0.5])
                cube([(head_diameter)+(2*margin)+(2*wall), head_diameter, 1], center=true);
        }
        union() {
            translate([0, 0, -0.05])
            cylinder(1.1, (head_diameter/2)+margin, (head_diameter/2)+margin);

            translate([0, head_diameter, -0.05])
            cylinder(1.1, (head_diameter/2)+margin, (head_diameter/2)+margin);

            translate([0, head_diameter/2, 0.5])
                cube([(head_diameter)+(2*margin), head_diameter, 1.1], center=true);
        }
    }
}