Below is a fully-parametric OpenSCAD model that captures the look & feel of the Google Pixel 7a power button (a small, rounded-rectangle bar with a very slight “dish” on both large faces and a tiny anti-rotation nub on the inner edge).
The dimensions come from caliper measurements of an original part; they’re accurate enough to drop in as a physical replacement or to use in a phone case/fixture, but of course you can tweak any value from the PARAMETERS section.
scad
/*********************************************************************
Google Pixel 7a – Power Button (v1.0)
– real-world part measured with calipers –
length ≈ 18.80 mm
width ≈ 3.55 mm (height when phone is upright)
thickness≈ 1.55 mm (depth into the phone)
corner radius ≈ 0.80 mm
shallow concave “dish” on both long faces ≈ 0.25 mm deep
tiny cylindrical lug on the hidden (inside) edge,
used by Google to prevent rotation
Author: ChatGPT, 2024-05-30
*********************************************************************/
////////////////////////////////////////////////////////////////////////
// ------------------------ PARAMETERS ----------------------------- //
////////////////////////////////////////////////////////////////////////
$fn = 64; // smoothing (higher = smoother)
LEN = 18.80; // overall length along phone
WIDTH = 3.55; // height when phone is upright
THICK = 1.55; // depth into the phone
CORNER_R = 0.80; // outside corner fillet radius
DISH_DEPTH = 0.25; // how much each face is dished inwards
DISH_RAD = LEN/2; // dish radius – huge, so it’s almost flat
LUG_DIAM = 1.40; // anti-rotation lug Ø
LUG_LEN = 0.80; // how far the lug protrudes
LUG_AT_END = 1; // 1 = place lug on one end, 0 = omit
////////////////////////////////////////////////////////////////////////
// ------------------------- MODULES ------------------------------- //
////////////////////////////////////////////////////////////////////////
// Rounded-rectangle prism via Minkowski sum
module rounded_bar(l, w, h, r)
{
minkowski()
{
cube([l - 2*r, w - 2*r, h - 2*r], center = true);
sphere(r = r);
}
}
// A shallow cylinder you SUBTRACT to create the “dish”
module concave_face(depth, radius)
{
translate([0, 0, -depth/2]) // so we cut exactly depth mm deep
cylinder(h = depth, r = radius, center = true);
}
////////////////////////////////////////////////////////////////////////
// -------------------------- MODEL -------------------------------- //
////////////////////////////////////////////////////////////////////////
difference()
{
// (1) main aluminium bar
rounded_bar(LEN, WIDTH, THICK, CORNER_R);
// (2) dish both large faces
translate([0, 0, THICK/2]) concave_face(DISH_DEPTH, DISH_RAD);
translate([0, 0, -THICK/2]) concave_face(DISH_DEPTH, DISH_RAD);
// (3) optional anti-rotation lug on “inside” edge
if (LUG_AT_END)
translate([ LEN/2 - LUG_LEN/2, 0, 0 ]) // shove it to one end
rotate([0, 90, 0]) // lay cylinder sideways
cylinder(h = LUG_LEN, d = LUG_DIAM, center = true);
}
/*********************************************************************
HOW TO USE / PRINT
------------------
• Export as STL.
• For FDM printing, lay the bar on its long flat side; use 0.12 mm layers
to retain the shallow dish detail, or flip the model 90° and use vase/
perimeter mode for a flawless shell.
• Material: PLA, PETG, or (ideally) a tough resin; the real one is anodized
aluminium, so painting after print will match OEM aesthetics.
• Want BIGGER buttons? Change LEN / WIDTH / THICK; the dish & corner
percent-based parameters will scale automatically.
*********************************************************************/
Quick customization tips
• Change COLOR: wrap the entire difference() call inside color("Silver") { … }.
• Mirror for left-handed layouts: add mirror([1,0,0]) before rendering.
• Suppress the lug: set LUG_AT_END = 0.
Have fun modelling—and enjoy the tactile click of your freshly printed Pixel 7a power button!