Guest User

Untitled

a guest
Apr 8th, 2024
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. // Define module for generating concave part
  2. module generate_concave_part(radius, width, depth) {
  3. difference() {
  4. cube([100, width, depth]); // Mold base
  5. hull() {
  6. translate([0, -width/2, -depth/2])
  7. cylinder(r=radius, h=depth);
  8. translate([0, width/2, -depth/2])
  9. cylinder(r=radius, h=depth);
  10. }
  11. }
  12. }
  13.  
  14. // Define parameters
  15. base_length = 100; // Length of the fingerboard
  16. base_width = 32; // Width of the fingerboard
  17. base_thickness = 5; // Thickness of the mold base
  18. nose_angle = 25; // Angle of the nose
  19. tail_angle = 23.5; // Angle of the tail
  20. concave_radius = 1.3; // Radius of the concave part
  21. concave_width = 32; // Width of the concave part
  22. concave_depth = 2; // Depth of the concave part
  23.  
  24. // Generate mold base
  25. mold_base = cube([base_length, base_width, base_thickness]);
  26.  
  27. // Generate concave part
  28. nose_concave = generate_concave_part(concave_radius, concave_width, concave_depth);
  29. tail_concave = generate_concave_part(concave_radius, concave_width, concave_depth);
  30.  
  31. // Position concave parts
  32. // Position concave parts
  33. nose_concave_positioned = translate([base_length, base_width/2, base_thickness]) nose_concave;
  34. tail_concave_positioned = translate([0, base_width/2, base_thickness]) tail_concave;
  35.  
  36.  
  37. // Assign concave parts without rotation
  38. nose_concave_positioned = nose_concave_translated;
  39. tail_concave_positioned = tail_concave_translated;
  40.  
  41. // Combine mold base and concave parts
  42. fingerboard_mold = union() {
  43. mold_base,
  44. nose_concave_positioned,
  45. tail_concave_positioned
  46. };
  47.  
  48. // Export STL file
  49. filename = "fingerboard_mold.stl";
  50. stl_write(fingerboard_mold, filename);
  51.  
Advertisement
Add Comment
Please, Sign In to add comment