Guest User

Untitled

a guest
Mar 6th, 2018
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. // Written in 2018 by Kevin Fowlks <[email protected]>
  2. // Replacement faceplate for stamina row machine
  3.  
  4. // Global Varibles
  5. font = "Liberation Sans";
  6.  
  7. module roundedRect(size, radius)
  8. {
  9. x = size[0];
  10. y = size[1];
  11. z = size[2];
  12.  
  13. linear_extrude(height=z)
  14. hull()
  15. {
  16. // place 4 circles in the corners, with the given radius
  17. translate([(-x/2)+(radius/2), (-y/2)+(radius/2)])
  18. circle(r=radius);
  19.  
  20. translate([(x/2)-(radius/2), (-y/2)+(radius/2)])
  21. circle(r=radius);
  22.  
  23. translate([(-x/2)+(radius/2), (y/2)-(radius/2)])
  24. circle(r=radius);
  25.  
  26. translate([(x/2)-(radius/2), (y/2)-(radius/2)])
  27. circle(r=radius);
  28. }
  29. }
  30.  
  31.  
  32. module faceplate() {
  33. thickness=3.1;
  34. height = 105.8;
  35. length = 13.9;
  36. width= 72.3;
  37.  
  38. lcd_screen_offset_height = 15;
  39. fitrow_text_offset_height = 1;
  40.  
  41. difference() {
  42. union() {
  43. difference() {
  44. color("blue")
  45. translate([(89.9/2)-(width/2),0,(114.9/2)-(height/2)])
  46. cube([width,length,height]);
  47. color("orange")
  48. translate([(89.9/2)-((width-thickness)/2),4,(114.9/2)-((height-thickness)/2)])
  49. cube([width-thickness,length,height-thickness]);
  50. }
  51. outerfaceplate();
  52. }
  53.  
  54. translate([(89.9/2)-(49.5/2),5,((114.9/2)-(86.1/2))+lcd_screen_offset_height])
  55. tft_lcd_screen_cutout();
  56. }
  57.  
  58. //TODO: Create post holes for LCD screen
  59.  
  60. translate([(89.9/2)-(32/2),2,((114.9/2)-(86.1/2))+fitrow_text_offset_height])
  61. fitrow_text();
  62. }
  63.  
  64. module notch() {
  65. height = 3.9;
  66. length = 3.0;
  67. width= 11.0;
  68. translate([-2,-2,-3])
  69. wedge(60, width, length, height);
  70. }
  71.  
  72. module outerfaceplate() {
  73. outerface_height = 114.9;
  74. outerface_thickness = .4;
  75. outerface_width= 86.9; // Size reduced due to rounded corners.
  76. radius = 1;
  77. color("red")
  78.  
  79. // Lets round the excess
  80. minkowski()
  81. {
  82. cube([outerface_width,outerface_thickness,outerface_height]);
  83. sphere(r=radius);
  84. }
  85. }
  86.  
  87. module fitrow_text() {
  88.  
  89. content = "Fit Row";
  90. color("green")
  91. translate ([0,0,0]) {
  92. rotate ([90,0,0]) {
  93. linear_extrude(height = 3.9) {
  94. text(content, font = font, size = 7, direction = "ltr", spacing = 1 );
  95. }
  96. }
  97. }
  98.  
  99. }
  100.  
  101. module tft_lcd() {
  102.  
  103. translate([0,-40,10.6])
  104.  
  105. tft_lcd_screen();
  106.  
  107. height = 86.1; // mm
  108. length = 2.1;
  109. width= 49.9;
  110. translate([0,-50,0])
  111. color("green")
  112. difference() {
  113. //rotate([0,90,90])
  114. //cylinder(r=5,h=10)
  115. cube([width,length,height]);
  116. //rotate([0,90,90])
  117. //color("black")
  118. //translate([0,0,0])
  119. //cylinder(r=length,h=10);
  120. }
  121. }
  122. module tft_lcd_screen_cutout() {
  123. lcd_screen_height = 69.2; // mm
  124. lcd_screen_thickness = 14;
  125. lcd_screen_width= 49.9;
  126. translate([0,-6,0])
  127. color("yellow")
  128. cube([lcd_screen_width,lcd_screen_thickness,lcd_screen_height]);
  129. }
  130.  
  131. module tft_lcd_screen() {
  132. lcd_screen_height = 69.2; // mm
  133. lcd_screen_thickness = 2.4;
  134. lcd_screen_width= 49.9;
  135. translate([0,-12,0])
  136. color("purple")
  137. cube([lcd_screen_width,lcd_screen_thickness,lcd_screen_height]);
  138. }
  139.  
  140. echo(version=version());
  141.  
  142. // Display faceplate
  143. faceplate();
  144.  
  145. // This is for LCD platement and reference
  146. // tft_lcd();
Advertisement
Add Comment
Please, Sign In to add comment