Below is an example OpenSCAD script that creates a simple, parametric 3D model of a rocket. You can adjust the parameters at the top to change the rocket’s body height, diameter, nose cone length, and fin dimensions.
// Increase resolution for smooth curves
$fn = 100;
//===================
// Parameters
//===================
rocket_body_height = 50; // Height of the cylindrical body
rocket_body_diameter = 10; // Diameter of the cylindrical body
rocket_nose_length = 15; // Height of the nose cone
fin_height = 10; // Height of each fin (vertical extent)
fin_width = 5; // How far the fin extends away from the body
fin_depth = 2; // Thickness of each fin
fin_z_offset = rocket_body_height/4; // Vertical position of the fins on the body
//===================
// Rocket Assembly
//===================
module rocket() {
union() {
// Main body (cylinder)
rocket_body(rocket_body_height, rocket_body_diameter);
// Nose cone (cone on top of body)
translate([0, 0, rocket_body_height])
nose_cone(rocket_nose_length, rocket_body_diameter);
// Fins, attached to the side of the body.
fins(fin_height, fin_width, fin_depth, rocket_body_diameter, fin_z_offset);
}
}
//===================
// Modules
//===================
// Module to create the cylindrical rocket body.
module rocket_body(h, d) {
cylinder(h = h, r = d/2, center = false);
}
// Module to create a nose cone.
// The nose is modeled as a cone with bottom radius = half the body diameter
// and top radius = 0.
module nose_cone(h, d) {
cylinder(h = h, r1 = d/2, r2 = 0, center = false);
}
// Module to create a single fin shape.
// The fin is created by extruding a 2D triangular polygon.
module fin_shape(fin_height, fin_width, fin_depth) {
linear_extrude(height = fin_depth)
polygon(points = [ [0, 0],
[fin_width, fin_height/2],
[fin_width, -fin_height/2] ]);
}
// Module to create fins around the rocket body.
// Four fins are placed evenly (every 90°) around the body.
module fins(fin_height, fin_width, fin_depth, body_diameter, z_pos) {
for (angle = [0, 90, 180, 270]) {
rotate([0, 0, angle])
// Move the fin so that its "root" touches the side of the body.
translate([body_diameter/2, 0, z_pos])
fin_shape(fin_height, fin_width, fin_depth);
}
}
//===================
// Render the Rocket
//===================
rocket();
How It Works
-
Parameters:
You can change variables like rocket_body_height, rocket_body_diameter, and rocket_nose_length to adjust the overall size. The fin parameters control the appearance of the fins.
-
Modules:
rocket_body creates a cylinder for the main body.
nose_cone creates a cone to serve as the nose.
fin_shape defines the 2D shape of a single fin which is then extruded.
fins places four fins around the body using a loop that rotates through 0°, 90°, 180°, and 270°.
-
Assembly:
The rocket() module combines the body, nose cone, and fins into one unified model.
Simply copy and paste the script into OpenSCAD, customize the parameters if desired, and render the model. Enjoy your parametric rocket design!