+
+module Machine_Arm(){
+ ysz = cutout_l_end_y_total;
+ // assume the round end is arc of a circle
+ chordlen = dist2d([0,0], [ cutout_l_end_y, cutout_l_end_curve ]);
+ endrad = cutout_l_end_y / cutout_l_end_curve * chordlen;
+
+ translate([0,0,-30]) linear_extrude(height=60) {
+ translate(tile01_tr + [0, (-cutout_tile01_y + cutout_tile11_y)/2]) {
+ intersection(){
+ translate([-100, -ysz/2])
+ square([400, ysz]);
+ translate([ endrad - cutout_tile11_x - cutout_l_end_x_slop, 0 ])
+ circle(r=endrad, $fa=0.01,$fd=5);
+ }
+ }
+ }
+}
+
+module Machine_Profile(){
+ first_rear = machine_rear_profile[0];
+ first_front = machine_front_profile[len(machine_front_profile)-1];
+ below_point = 0.5 * ( first_rear + first_front ) + [ 0, -40 ];
+ pol = concat( machine_rear_profile,
+ [ below_point ],
+ machine_front_profile);
+ skew_angle = atan2( first_front[1] - first_rear[1],
+ first_front[0] - first_rear[0] );
+ echo(below_point, pol, skew_angle);
+ rotate([0,0, -skew_angle ]){
+ polygon(pol);
+ }
+}
+
+module Machine_Rear(){ ////toplevel
+ big_rad = rearcurve_total_len - rearcurve_strt_len + rearcurve_rad;
+ small_rad = rearcurve_rad + rearcurve_rad_slop;
+ translate([ tile01_tr[0] - cutout_l_end_x + rearedge_len,
+ cutout_tile11_y,
+ 0 ]){
+ //%cube([20,20,20]);
+ translate([ -reartablet_x,
+ -1,
+ -reartablet_z])
+ mirror([0,0,1])
+ cube([ reartablet_x+1,
+ reartablet_y+1,
+ 20 ]);
+ translate([ rearcurve_strt_len,
+ 0,
+ 0 ]){
+ translate([ 0,
+ 0,
+ -rearcurve_rad
+ ]){
+ rotate([0,-90,0]){
+ rotate([0,0, 360/8/2])
+ cylinder(r = small_rad, h= rearcurve_strt_len);
+ }
+ }
+ translate([ 0,
+ 0,
+ big_rad - rearcurve_rad ]) {
+ intersection(){
+ rotate([90,0,0]){
+ rotate_extrude(convexity=10) {
+ translate([ big_rad,
+ 0 ]) {
+ hull(){
+ circle(r= small_rad);
+ translate([200,0])
+ circle(r= small_rad);
+ }
+ }
+ }
+ }
+ mirror([0,0,1])
+ cube([150,150,150]);
+ }
+ }
+ }
+ }
+}
+
+module Machine(){ ////toplevel
+ Machine_Arm();
+ Machine_Rear();
+}