CaseCorner_M4

Corner screw mount for a screw-mount lid with an M4 sized screw

Category: Case

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
  "CaseCorner_M4"
  (version 20240108)
  (generator turbocaseweb)
  (descr "Corner screw mount for a screw-mount lid with an M4 sized screw")
  (attr board_only exclude_from_pos_files exclude_from_bom allow_missing_courtyard)
  (zone_connect 0)
  (
    property
    "TurboCaseModule"
    "eJylkktuwyAQhvc+BUu7tRM726qrHKOKIgLjGgmDxGPRVrl7hsSkgNwqVUeWDGge3/wzs+ZeAtlTC3ttFJjaik9oyaQlHLmgMzgweAXKy+sE4n1yDfmqCJozVFlJHdRvfUvw60aptVm8Ds3ViYtxBAOKQR3jgnkltMpegrEPKRRHIqGQa0nUksC33cV/85LFJBTdrREkSeO3uwUlq+RPGBD8n5bEedChJQwUdv7qjIek5Lm6H1dpn4dCyQBePGC6agX/JuKKhtG+R3a0/mQxlLk/D++32lkj/aYfCgA2CclxmHXMcq5Qj7lcqH/Q/bRa/WZAmGRd1sVPxXtoDo9JkabtEtxSnsiUuKxRpO3fKYKUF3ygHxc="
    (at 0 0 0)
    (unlocked yes)
    (layer "F.SilkS")
    (hide yes)
    (uuid "4ea80b7f-6682-4919-b897-3f49d817c556")
    (
      effects
      (
        font
        (size 1 1)
        (thickness 0.1)
      )
    )
  )
  (
    property
    "TurboCaseAdd"
    "CaseCorner(size=7.5, hole_diameter=4, head_diameter=7.5, head_height=2.2)"
    (at 0 0 0)
    (unlocked yes)
    (layer "F.SilkS")
    (hide yes)
    (uuid "a6bce1df-4b9e-4fc4-a42c-4f6b27f577a5")
    (
      effects
      (
        font
        (size 1 1)
        (thickness 0.1)
      )
    )
  )
  (
    property
    "TurboCaseSub"
    "CaseCorner_substract(size=7.5, hole_diameter=4, head_diameter=7.5, head_height=2.2)"
    (at 0 0 0)
    (unlocked yes)
    (layer "F.SilkS")
    (hide yes)
    (uuid "c02add8a-0128-4b07-abe0-45613f65934d")
    (
      effects
      (
        font
        (size 1 1)
        (thickness 0.1)
      )
    )
  )
  (
    property
    "TurboCaseConstrain"
    "yes"
    (at 0 0 0)
    (unlocked yes)
    (layer "F.SilkS")
    (hide yes)
    (uuid "5dde72ad-3d71-44c0-9779-2f30319b61ab")
    (
      effects
      (
        font
        (size 1 1)
        (thickness 0.1)
      )
    )
  )
  (
    property
    "TurboCaseScrewSize"
    "4"
    (at 0 0 0)
    (unlocked yes)
    (layer "F.SilkS")
    (hide yes)
    (uuid "b2ec8d25-98a1-4881-b9bf-c8f1a032856b")
    (
      effects
      (
        font
        (size 1 1)
        (thickness 0.1)
      )
    )
  )
  (
    fp_circle
    (center 0 0)
    (end 0 2.0)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (fill none)
    (layer "User.6")
    (uuid "566a3e03-9c79-4113-8c98-5a1805fff321")
  )
  (
    fp_circle
    (center 0 0)
    (end 0 3.75)
    (
      stroke
      (width 0.2)
      (type dot)
    )
    (fill none)
    (layer "User.6")
    (uuid "5d8d88a4-cd89-44d0-bff1-3815805e26cc")
  )
  (
    fp_arc
    (start 0 3.75)
    (mid 0 3.75)
    (end 0 -3.75)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "86498114-56a5-45c4-ac3d-71dc5c8973fa")
  )
  (
    fp_line
    (start -7.5 3.75)
    (end 0 3.75)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "dbd68ceb-4e07-4451-aa5e-fc04ea43bb47")
  )
  (
    fp_line
    (start -7.5 -3.75)
    (end 0 -3.75)
    (
      stroke
      (width 0.2)
      (type default)
    )
    (layer "User.6")
    (uuid "924b1ba5-a3a8-456b-b2ea-f588a057a807")
  )
)

The OpenSCAD code

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

module CaseCorner(size, hole_diameter, head_diameter, head_height) {
    translate([0, 0, -floor_height])
    difference() {
        union() {
            cylinder(inner_height, size/2, size/2);
            translate([-size, 0, inner_height/2])
                cube([size*2, size, inner_height], center=true);
        }

        cylinder(inner_height+1, hole_diameter/2, hole_diameter/2);

        translate([0, 0, floor_height])
            CaseCorner_substract(size, hole_diameter, head_diameter, head_height);

        translate([0, 0, inner_height+0.01])
            children();

    }
}

module CaseCorner_substract(size, hole_diameter, head_diameter, head_height) {
    translate([0, 0, 0.11]) {
        cylinder(inner_height+floor_height, hole_diameter/2, hole_diameter/2);
        translate([0, 0, inner_height+floor_height-head_height])
            cylinder(head_height, hole_diameter/2, head_diameter/2);
    }
}