Skip to content

Instantly share code, notes, and snippets.

@azend
Created August 13, 2012 02:36
Show Gist options
  • Save azend/3336497 to your computer and use it in GitHub Desktop.
Save azend/3336497 to your computer and use it in GitHub Desktop.
Simple Parametric Rocket (made with OpenSCAD)
module rocket () {
$fn = 100;
rocket_diameter = 5;
rocket_length = 50;
rocket_nose_cone_length = 10;
rocket_num_fins = 3;
rocket_fin_length = 10;
rocket_fin_width = 5;
rocket_engine_diameter = 4;
rocket_engine_length = 10;
difference() {
union() {
translate([0, 0, (rocket_length - rocket_nose_cone_length) / 2 + ( rocket_nose_cone_length / 2)]) cylinder(r1 = rocket_diameter / 2, r2 = 0, h = rocket_nose_cone_length, center = true);
cylinder(r = rocket_diameter / 2,h = (rocket_length - rocket_nose_cone_length), center = true);
for( x = [0:rocket_num_fins]) {
rotate([0, 0, (360 / rocket_num_fins) * x])
translate([-((rocket_diameter / 2) + (rocket_fin_width / 2)), 0, -( ((rocket_length - rocket_nose_cone_length) / 2 ) - (rocket_fin_length / 2)) ])
rotate([90, 180, 0])
polygon(points = [
[ -(rocket_fin_width /2), -(rocket_fin_length /2)],
[-(rocket_fin_width /2), -(rocket_fin_length /2) + rocket_fin_length],
[-(rocket_fin_width /2) + rocket_fin_width, -(rocket_fin_length /2) + rocket_fin_length]
]);
}
}
union() {
translate([0, 0, -((rocket_length - rocket_nose_cone_length) / 2 ) + (rocket_engine_length / 2)])
cylinder(r = rocket_engine_diameter / 2, h = rocket_engine_length, center = true)
;
}
}
}
rocket();
@RedCarnage
Copy link

The fins don't show up render. Before the polygon command at line 25, add a linear_extrude(1) before that line. Then the fins will show up in the render

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment