Wednesday, November 20, 2024

ChatGPT 4o mini makes a fork in OpenSCAD, with my minimal assistance

While distracted by Zoom meetings, I give ChatGPT 4o mini some feedback to make a fork model in OpenSCAD. Because I uploaded images, I can't share the links directly I guess.

Me: generate a fork in openscad for me

chatgpt: Here's an example of OpenSCAD code to generate a simple fork. The design features a basic handle and four prongs. You can adjust dimensions as needed.

// Parameters
handle_length = 100;
handle_width = 15;
handle_thickness = 5;
prong_length = 50;
prong_width = 3;
prong_thickness = 2;
gap_between_prongs = 5;

// Generate fork
module fork() {
    // Handle
    difference() {
        cube([handle_length, handle_width, handle_thickness]);
        translate([-1, (handle_width - prong_width * 4 - gap_between_prongs * 3) / 2, 0])
        cube([handle_length * 0.4, handle_width, prong_thickness]); 
    }

    // Prongs
    for (i = [0:3]) {
        translate([handle_length, i * (prong_width + gap_between_prongs), 0])
            cube([prong_length, prong_width, prong_thickness]);
    }
}
fork();