update puzzle to latest version to match solution instructions
[ozzloy@gmail.com/3d-printables] / crazyflie-2.0-housing.scad
index 654f6831b92f0d2fc1f68a0b8f86bc8cb7e8cedc..f4f59cc781fd1f47c1dfa1986d76fecaa017c101 100644 (file)
@@ -9,27 +9,56 @@
    wrapped around the motor shaft.
  */
 
-across_body_screws_outside_measured = 33.3;
-across_body_screws_inside_measured = 32.0;
+$fn = 300;
 
-inside_ = 28.0;
+// propeller diameter was measured with calipers
+propeller_radius = 46.35 / 2;
+// 7mm from spec
+motor_grippable_height = 8;
+motor_gripper_height = motor_grippable_height / 2;
+holder_height = motor_grippable_height * 1.1;
 
-main_body_width_measured = 28.0;
-main_body_length_measured = 31.0;
-main_body_height_measured = 1.5;
+propeller_radius_measured = 46.35 / 2;
+holder_wall_thickness = 1.2;
+propeller_guard_wall_thickness = 1.2;
 
+motor_diameter = 7;
+motor_height_measured = 17;
+motor_radius = motor_diameter / 2;
 
-arm_width_measured = 3.6;
-arm_length_measured = 79.0;
-arm_height_measured = main_body_height_measured;
+module propeller_protector(motor_radius,
+                           holder_wall_thickness,
+                           propeller_guard_wall_thickness,
+                           motor_gripper_height,
+                           holder_height,
+                           propeller_radius) {
+  propeller_guard_inner_radius = propeller_radius + 1.5;
+  holder_outer_radius = motor_radius + holder_wall_thickness;
+  number_of_arms = 3;
+  linear_extrude(height = motor_gripper_height) {
+    // part that holds the motor
+    difference() {
+      circle(r = holder_outer_radius);
+      circle(r = motor_radius); }
+    for(arm_number = [0: (number_of_arms - 1)]) {
+      rotate(arm_number * (360 / number_of_arms)) {
+        translate([-propeller_guard_inner_radius,
+                   -holder_wall_thickness / 2]) {
+          square([propeller_guard_inner_radius - motor_radius,
+                  holder_wall_thickness]); } } } }
+  // prop protector
+  linear_extrude(height = holder_height) {
+    difference() {
+      circle(propeller_guard_inner_radius +
+             propeller_guard_wall_thickness);
+      circle(propeller_guard_inner_radius); } } }
 
-cube([main_body_width_measured,
-      main_body_length_measured,
-      main_body_height_measured]);
-
-cube([arm_width_measured,
-      arm_length_measured,
-      arm_height_measured]);
+propeller_protector(motor_radius,
+                    holder_wall_thickness,
+                    propeller_guard_wall_thickness,
+                    motor_gripper_height,
+                    holder_height,
+                    propeller_radius_measured);
 
 /*
   This file is part of 3d-printables.