Guest User

https://www.reddit.com/r/3Drequests/comments/1kb9xhk/looking_for_assistance_in_creating_accurate_stl

a guest
May 1st, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.02 KB | Source Code | 0 0
  1. // Rocinante.scad
  2. //
  3. // Version 1, May 1, 2025
  4. // By: Stone Age Sculptor
  5. // License: CC0 (only this script, not the fonts)
  6. //
  7. // Find the fonts yourself!
  8. // I could not find the right fonts
  9. // with a free/open license.
  10. //
  11. // OpenSCAD can finetune the shapes of a font.
  12. // A text can be made heavier or lighter
  13. // with the offset() function, it
  14. // can be scaled in one direction,
  15. // and the intercharacter spacing
  16. // can be adjusted, the corners can
  17. // be made round, and so on.
  18.  
  19. // Overall accuracy, 10 is very low, 500 is very high.
  20. $fn = 200;
  21.  
  22.  
  23. // ----------------------------------------
  24. // Use the fonts that you found here.
  25. // ----------------------------------------
  26.  
  27. use <BankGothicLH Heavy.ttf>
  28. font1 = "BankGothicLH:style=Heavy";
  29.  
  30. // use <FF-DIN-Black.ttf>
  31. // font2 = "DIN Black:style=Regular";
  32.  
  33. use <645-font.otf>
  34. font2 = "DIN Pro:style=Condensed Black";
  35.  
  36. // ----------------------------------------
  37.  
  38.  
  39. // The size of the base plate in millimeters (14" x 10.5").
  40. xsize = 14 * 25.4;
  41. ysize = 10.5 * 25.4;
  42.  
  43. // The distance between the outer edge and the rectangle.
  44. edge_outer = 9;
  45.  
  46. // The width of the rectangle.
  47. edge_linewidth = 4;
  48.  
  49. // The thickness of the base plate.
  50. thickness_plate = 10;
  51.  
  52. // The thickness of the text.
  53. thickness_print = 2;
  54.  
  55. // The width of the bar below the Rocinante text.
  56. bar_width = 4;
  57.  
  58. // The diameter of the circles in the text.
  59. circle_diameter = 4;
  60.  
  61. // The distance between the edge and the center of a hole.
  62. hole_offset = 23;
  63.  
  64. // The diameter of the hole that goes through and through.
  65. hole_diameter = 3;
  66.  
  67. // The diameter of the wider part of the hole.
  68. hole_wider = 10;
  69.  
  70. // The depth of the wider part of the hole.
  71. depth_wider = 3;
  72.  
  73. // Helper value to avoid rounding errors.
  74. epsilon = 0.001;
  75.  
  76. color("Gray")
  77. {
  78. difference()
  79. {
  80. // The base plate.
  81. cube([xsize,ysize,thickness_plate],center=true);
  82.  
  83. // Remove the holes.
  84. for(xm=[-1,1],ym=[-1,1])
  85. {
  86. x = xm*(xsize/2-hole_offset);
  87. y = ym*(ysize/2-hole_offset);
  88. ztop = thickness_plate/2;
  89. translate([x,y,0])
  90. {
  91. cylinder(h=100,d=hole_diameter,center=true);
  92. translate([0,0,ztop-depth_wider])
  93. cylinder(h=100,d=hole_wider);
  94. }
  95. }
  96. }
  97. }
  98.  
  99. color("Silver")
  100. {
  101. // The print is sunk into the base plate,
  102. // to be sure that they connect.
  103. translate([0,0,thickness_plate/2+thickness_print-epsilon])
  104. {
  105. linear_extrude(thickness_print+epsilon)
  106. {
  107. // The rectangle.
  108. difference()
  109. {
  110. x1 = xsize-2*edge_outer;
  111. y1 = ysize-2*edge_outer;
  112. x2 = x1 - 2*edge_linewidth;
  113. y2 = y1 - 2*edge_linewidth;
  114. square([x1,y1],center=true);
  115. square([x2,y2],center=true);
  116. }
  117.  
  118. // The parameter "spacing" is the intercharacter spacing.
  119. // It is default 1.
  120. translate([0,58])
  121. text("ROCINANTE",font=font1,size=32,spacing=0.98,halign="center");
  122.  
  123. // This position and the length of the bar
  124. // could be calculated with the new textmetrics()
  125. // function.
  126. // For now, the numbers are visually finetuned.
  127. translate([1.70,47])
  128. square([280.6,bar_width],center=true);
  129.  
  130. translate([0,15])
  131. text("AN INDEPENDENT SHIP",font=font2,size=12,spacing=1.1,halign="center");
  132. translate([0,-2])
  133. text("OWNED & OPERATED BY",font=font2,size=12,spacing=1.1,halign="center");
  134. translate([0,-34])
  135. text("JAMES NOLDEN NAOMI NAGATA",font=font2,size=15,spacing=1.05,halign="center");
  136. translate([0,-54])
  137. text("ALEX KAMAL AMOS BUNTON",font=font2,size=15,spacing=1.05,halign="center");
  138. translate([0,-86])
  139. text("A LEGITIMATE SAVAGE",font=font2,size=14,spacing=1.05,halign="center");
  140.  
  141. // Not every font might have the definition
  142. // for the circle, therefor they are
  143. // just circles and visually positioned.
  144. translate([0.7,-26.7])
  145. circle(d=circle_diameter);
  146. translate([-7,-46])
  147. circle(d=circle_diameter);
  148. }
  149. }
  150. }
  151.  
Tags: OpenSCAD
Advertisement
Add Comment
Please, Sign In to add comment