3D Workspace
Home
Assets
Affiliate Program
Sign up/Log in
?
Upgrade
DCC Bridge
3D Creation Made Simple
Text & Image to 3D Model in seconds
One-Click Texturing & Smart Detail Editing
Free Credits Monthly
Start Free
Anonymous1758705719
09-24 09:34
Model Name
flange hub 3d model
Tags
machine
rendering
realistic
Prompt
//================================================================ // OpenSCAD code to create the 3D model shown in the image. // All dimensions are taken from the provided image. // The model is centered at the origin (0,0,0) for easy manipulation. //================================================================ // Define constants based on the drawing's dimensions base_length = 90; base_width = 60; base_height = 15; raised_section_length = 70; raised_section_height = 30; // 45 - 15 cylinder_outer_diameter = 50; cylinder_height = 35; // 80 - 45 fillet_radius_left = 10; fillet_radius_right = 7; hole_diameter_left = 12; hole_count_left = 2; hole_distance_from_edge_left = 15; hole_diameter_right = 7; // Assuming R7 refers to a 7mm diameter hole hole_distance_from_center_right = 30; six_holes_diameter = 12; six_holes_circle_diameter = 30; six_holes_count = 6; top_bore_diameter = 30; top_bore_height = 12; middle_bore_diameter = 20; middle_bore_height = 21; through_hole_diameter = 10; // ================================================================ // Main body of the model // ================================================================ module main_body() { // The base section union() { difference() { // Main base cube cube([base_length, base_width, base_height], center = true); // Cutout for the rounded corners (fillets) translate([base_length/2 - fillet_radius_left, base_width/2 - fillet_radius_left, 0]) cube([fillet_radius_left, fillet_radius_left, base_height+1], center = true); translate([base_length/2 - fillet_radius_right, -base_width/2 + fillet_radius_right, 0]) cube([fillet_radius_right, fillet_radius_right, base_height+1], center = true); } // Add quarter cylinders to create the fillets translate([base_length/2 - fillet_radius_left, base_width/2 - fillet_radius_left, 0]) cylinder(h = base_height+1, r = fillet_radius_left, center = true, $fn = 60); translate([base_length/2 - fillet_radius_right, -base_width/2 + fillet_radius_right, 0]) cylinder(h = base_height+1, r = fillet_radius_right, center = true, $fn = 60); } // The raised middle section translate([0, 0, base_height/2 + raised_section_height/2]) cube([raised_section_length, base_width, raised_section_height], center = true); // The top cylinder translate([0, 0, base_height/2 + raised_section_height + cylinder_height/2]) cylinder(h = cylinder_height, d = cylinder_outer_diameter, center = true, $fn = 60); } // ================================================================ // Module for all the holes and cutouts // ================================================================ module holes() { // Two holes on the left side (2x ø12) translate([-base_length/2 + hole_distance_from_edge_left, -base_width/2 + hole_distance_from_edge_left, 0]) cylinder(h = 100, d = hole_diameter_left, center = true, $fn = 60); translate([-base_length/2 + hole_distance_from_edge_left, base_width/2 - hole_distance_from_edge_left, 0]) cylinder(h = 100, d = hole_diameter_left, center = true, $fn = 60); // Hole on the right side (ø7) translate([base_length/2 - (base_length - 75), 0, base_height/2 + 30]) rotate([0, 90, 0]) cylinder(h = base_width + 1, d = hole_diameter_right, center = true, $fn = 60); // Central bores and through hole full_height = base_height + raised_section_height + cylinder_height; // Top bore (ø30) translate([0, 0, full_height/2 - top_bore_height/2]) cylinder(h = top_bore_height+1, d = top_bore_diameter, center = true, $fn = 60); // Middle bore (ø20) translate([0, 0, full_height/2 - middle_bore_height/2]) cylinder(h = middle_bore_height+1, d = middle_bore_diameter, center = true, $fn = 60); // Through hole (ø10) cylinder(h = full_height + 1, d = through_hole_diameter, center = true, $fn = 60); // Six holes on a bolt circle (6x ø12 on ø30 circle) cylinder_base_z = base_height + raised_section_height; translate([0, 0, cylinder_base_z + cylinder_height/2]) { for (i = [0:six_holes_count-1]) { rotate([0, 0, i * 360 / six_holes_count]) translate([six_holes_circle_diameter/2, 0, 0]) cylinder(h = cylinder_height + 1, d = six_holes_diameter, center = true, $fn = 60); } } } // ================================================================ // Final assembly by subtracting holes from the main body // ================================================================ difference() { main_body(); holes(); }
Detailed Info
Related Models
Enter invite code
Enter invite code to get credits!