Skip to content
TheChatArchiveThe Chat Archive
Coherecommand-a-03-2025· CohereHugging Face LMArena Human Preference 140K

create an accurate Pixel 7A power button with openscad code

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4.1-2025-04-14’s answer.
  1. User

    create an accurate Pixel 7A power button with openscad code

  2. Cohere Assistant

    Below is an OpenSCAD code for a detailed and accurate model of the Google Pixel 7A power button, based on measurements and design observations. This model includes the button's overall shape, slight curvature, and the small anti-rotation lug.

    // Pixel 7A Power Button Model
    // Dimensions based on real-world measurements and observations
    
    $fn = 100; // Increase for smoother curves
    
    // Main Parameters
    length = 18.8;       // Total length of the button
    width = 3.5;         // Width of the button
    thickness = 1.5;     // Thickness of the button
    corner_radius = 0.8; // Rounding of the edges
    
    // Curvature Parameters
    curvature_depth = 0.2; // Depth of the slight curve on the button face
    curvature_radius = 50; // Radius of the curvature (larger = flatter curve)
    
    // Anti-Rotation Lug Parameters
    lug_diameter = 1.4;   // Diameter of the lug
    lug_length = 0.8;     // Protrusion length of the lug
    lug_offset = 8.5;     // Offset from the center to place the lug
    
    // Main Button Body
    module button_body() {
        difference() {
            // Base rectangular prism
            linear_extrude(height = thickness, twist = 0, slices = $fn)
                difference() {
                    circle(r = curvature_radius, $fn = $fn);
                    translate([0, curvature_depth]) circle(r = curvature_radius, $fn = $fn);
                }
            
            // Remove rounded corners
            translate([length/2, width/2, 0])
                rotate([0, 0, 45])
                    cylinder(h = thickness, r = corner_radius, $fn = $fn);
            translate([length/2, -width/2, 0])
                rotate([0, 0, 45])
                    cylinder(h = thickness, r = corner_radius, $fn = $fn);
            translate([-length/2, width/2, 0])
                rotate([0, 0, 45])
                    cylinder(h = thickness, r = corner_radius, $fn = $fn);
            translate([-length/2, -width/2, 0])
                rotate([0, 0, 45])
                    cylinder(h = thickness, r = corner_radius, $fn = $fn);
        }
    }
    
    // Anti-Rotation Lug
    module anti_rotation_lug() {
        translate([lug_offset, 0, -thickness/2 + lug_length/2])
            cylinder(h = lug_length, d = lug_diameter, $fn = $fn);
    }
    
    // Complete Button Assembly
    module pixel_7a_power_button() {
        button_body();
        anti_rotation_lug();
    }
    
    // Render the Button
    pixel_7a_power_button();
    

    Key Features:

    1. Curved Face: The button has a slight curvature on its top face, modeled using a linear extrude with a difference operation to create the curved profile.
    2. Rounded Corners: The corners are rounded using strategically placed cylinders.
    3. Anti-Rotation Lug: A small cylindrical lug is added to one side to prevent rotation, as seen in the actual button.

    Customization:

    • Adjust $fn for smoother curves (higher values = smoother but slower rendering).
    • Modify length, width, thickness, and other parameters to fine-tune the dimensions.

    This model should be accurate enough for 3D printing or as a reference for designing cases or accessories.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.