Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Define module for generating concave part
- module generate_concave_part(radius, width, depth) {
- difference() {
- cube([100, width, depth]); // Mold base
- hull() {
- translate([0, -width/2, -depth/2])
- cylinder(r=radius, h=depth);
- translate([0, width/2, -depth/2])
- cylinder(r=radius, h=depth);
- }
- }
- }
- // Define parameters
- base_length = 100; // Length of the fingerboard
- base_width = 32; // Width of the fingerboard
- base_thickness = 5; // Thickness of the mold base
- nose_angle = 25; // Angle of the nose
- tail_angle = 23.5; // Angle of the tail
- concave_radius = 1.3; // Radius of the concave part
- concave_width = 32; // Width of the concave part
- concave_depth = 2; // Depth of the concave part
- // Generate mold base
- mold_base = cube([base_length, base_width, base_thickness]);
- // Generate concave part
- nose_concave = generate_concave_part(concave_radius, concave_width, concave_depth);
- tail_concave = generate_concave_part(concave_radius, concave_width, concave_depth);
- // Position concave parts
- // Position concave parts
- nose_concave_positioned = translate([base_length, base_width/2, base_thickness]) nose_concave;
- tail_concave_positioned = translate([0, base_width/2, base_thickness]) tail_concave;
- // Assign concave parts without rotation
- nose_concave_positioned = nose_concave_translated;
- tail_concave_positioned = tail_concave_translated;
- // Combine mold base and concave parts
- fingerboard_mold = union() {
- mold_base,
- nose_concave_positioned,
- tail_concave_positioned
- };
- // Export STL file
- filename = "fingerboard_mold.stl";
- stl_write(fingerboard_mold, filename);
Advertisement
Add Comment
Please, Sign In to add comment