// Simple wakeboard model
// (c) Vitaliy Filippov 2014, license: CC-BY-SA 4.0
// Print with Slic3r 1.1.3-dev rotated 45 degree to the edge with following settings
// 0.1mm layer, 0.3mm first layer, enforce support for first layers = 40,
// skirt distance = 0, skirt loops = 4, skirt height = 1 layer

$fn=20;

module boot()
{
  $fn=20;
  difference() {
    union() {
      linear_extrude(height=3) {
        hull() {
          translate([0, -17]) circle(r=10);
          circle(r=17);
          translate([0, 17]) circle(r=10);
        }
      }

      translate([0, 0, 8])
        hull() {
          translate([0, -17, -3]) scale([1, 1, 0.3]) cylinder(r1=10, r2=13, h=26, center=true);
          translate([0, -17, 3]) scale([1, 1, 0.3]) sphere(r=13);
          translate([0, 17, -3]) scale([1, 1, 0.3]) sphere(r=13);
          translate([0, 17, 3]) scale([1, 1, 0.3]) sphere(r=13);
        }

      hull() {
        translate([0, -17, 8]) cylinder(r=13, h=24);
        translate([0, -14, 8]) cylinder(r=13, h=11);
      }
      hull() {
        translate([0, -14, 8]) cylinder(r=13, h=11);
        translate([0, -10, 8]) cylinder(r=13, h=7);
      }
      hull() {
        translate([0, -10, 8]) cylinder(r=13, h=7);
        translate([0, 0, 8]) cylinder(r=13, h=3.8);
      }
    }
    translate([0, -17, 6]) cylinder(r=10, h=40);
  }
}

module board()
{
  $fn=500;
  // bend() is an experimental cylindric bend feature from my OpenSCAD fork -- github:vitalif/openscad
  bend(center=[30, 90, 500], fixed=[30, 90, 0], cyl=[60, 90, 0]) {
    translate([30, 90])
    linear_extrude(height=5) {
      intersection() {
        translate([270, 0]) circle(r=300);
        translate([-270, 0]) circle(r=300);
        hull() {
          translate([0, 40]) circle(r=50);
          translate([0, -40]) circle(r=50);
        }
      }
    }
  }
}

//board();

//boot();

rotate([0, 45, 0])
union() {
  //import("wake_bent.stl"); // Import wakeboard bent in Blender
  board(); // Use bend feature from github:vitalif/openscad
  translate([30, 90-500*sin(asin(90/500)*0.45), 1.4])
    rotate([0, asin(90/500)*0.45, 100]) translate([0, 0, 5]) scale(0.7) boot();
  translate([30, 90+500*sin(asin(90/500)*0.45), 1.4])
    rotate([0, -asin(90/500)*0.45, 80]) translate([0, 0, 5]) scale(0.7) boot();
}
