diff --git a/DNA_Double_Helix/main.scad b/DNA_Double_Helix/main.scad new file mode 100644 index 0000000..94edbd9 --- /dev/null +++ b/DNA_Double_Helix/main.scad @@ -0,0 +1,9 @@ +// Author: Edward Middleton-Smith +// Project: DNA Double Helix +// Technology: Main +// Feature: + +include ; +use ; + +DNA_Double_Helix(radius_rotation_helix, radius_strand_helix, angle_twist_total, height, rise, length_discretisation, pi, angle_incline); \ No newline at end of file diff --git a/DNA_Double_Helix/modules/constants.scad b/DNA_Double_Helix/modules/constants.scad new file mode 100644 index 0000000..b0be000 --- /dev/null +++ b/DNA_Double_Helix/modules/constants.scad @@ -0,0 +1,17 @@ +// Author: Edward Middleton-Smith +// Project: DNA Double Helix +// Technology: Constants and Variables +// Feature: + +// constants +radius_rotation_helix = 80; // radius of helix (displacement of any part of helix from central axis) +radius_strand_helix = 20; +angle_twist_total = 1440; +height = 1300; +rise = 240; // vertical spacing between base-pair rungs +length_discretisation = 1; // length_discretisationretisation of points per units length +pi = 3.14159265359; // rounded + +// intermediate variables +angle_incline = asin(height * 360 / angle_twist_total / 2 / pi / radius_rotation_helix); +echo("angle_incline: ", angle_incline); diff --git a/DNA_Double_Helix/modules/dna_double_helix.scad b/DNA_Double_Helix/modules/dna_double_helix.scad new file mode 100644 index 0000000..e5b0395 --- /dev/null +++ b/DNA_Double_Helix/modules/dna_double_helix.scad @@ -0,0 +1,45 @@ +// Author: Edward Middleton-Smith +// Project: Miscellaneous +// Technology: DNA Double Helix +// Feature: Main + +include ; +use ; + +module DNA_Double_Helix(radius_rotation_helix, radius_strand_helix, angle_twist_total, height, rise, length_discretisation, pi, angle_incline) { + union() { + difference() { + union() { + linear_extrude(height = height, center = false, convexity = 10, twist = angle_twist_total, slices = height * length_discretisation) translate([radius_rotation_helix, 0, 0]) scale([1, 2, 1]) circle(radius_strand_helix); + linear_extrude(height = height, center = false, convexity = 10, twist = angle_twist_total, slices = height * length_discretisation) translate([-radius_rotation_helix, 0, 0]) scale([1, 2, 1]) circle(radius_strand_helix); + } + + // grooves + + + // tip removal - forces faces at ends of helix to be tangential to helix circumference at that point + for (index_tip_helix = [1:4]) { + rotate([0, 0, -7]) tip_cutting_cube(radius_rotation_helix, radius_strand_helix, index_tip_helix, angle_incline, height, angle_twist_total); + } + } + + // knobs - balls at ends of helixes + rotate([0, 0, -25]) translate([radius_rotation_helix, radius_strand_helix * (1 - sin(angle_incline)),radius_strand_helix * cos(angle_incline)]) sphere(radius_strand_helix); + rotate([0, 0, 155]) translate([radius_rotation_helix, radius_strand_helix * (1 - sin(angle_incline)),radius_strand_helix * cos(angle_incline)]) sphere(radius_strand_helix); + rotate([0, 0, 39]) mirror([0, 0, 1]) translate([0, 0, -height]) { + rotate([0,0,-25]) translate([radius_rotation_helix, radius_strand_helix * (1 - sin(angle_incline)),radius_strand_helix * cos(angle_incline)]) sphere(radius_strand_helix); + rotate([0,0,155]) translate([radius_rotation_helix, radius_strand_helix * (1 - sin(angle_incline)),radius_strand_helix * cos(angle_incline)]) sphere(radius_strand_helix); + } + + + // base-pair rungs + for (index_rung = [1 : (height - height % rise) / rise]) { + echo("index rung: ", index_rung); + position_rung = rise * index_rung / height * angle_twist_total; + echo("position rung: ", position_rung); + translate([0, 0, rise * index_rung - radius_strand_helix * 3/2]) rotate([-angle_incline, 90, -position_rung]) scale([1/2, 1, 1]) cylinder(2 * radius_rotation_helix, radius_strand_helix, radius_strand_helix, center = true); + } + } +} + +DNA_Double_Helix(radius_rotation_helix, radius_strand_helix, angle_twist_total, height, rise, length_discretisation, pi, angle_incline); \ No newline at end of file diff --git a/DNA_Double_Helix/modules/tip_cutting_cube.scad b/DNA_Double_Helix/modules/tip_cutting_cube.scad new file mode 100644 index 0000000..157258d --- /dev/null +++ b/DNA_Double_Helix/modules/tip_cutting_cube.scad @@ -0,0 +1,21 @@ +// Author: Edward Middleton-Smith +// Project: Miscellaneous +// Technology: DNA Double Helix +// Feature: Main + +include ; + +module tip_cutting_cube (radius_rotation_helix, radius_strand_helix, index_tip_helix, angle_incline, height, angle_twist_total) { + dx = radius_rotation_helix / 2 + radius_strand_helix * 2; + dy = radius_strand_helix * 2 * (1 - cos(angle_incline)); + edge_size = 3 * radius_strand_helix; + echo("cutting cube edge size: ", edge_size); + requires_rotation_to_alternative_tip_at_end = (index_tip_helix == 1 || index_tip_helix == 4); + tip_is_at_top = (index_tip_helix == 3 || index_tip_helix == 4); + height_tip_top = height; + rotate([0, 0, (requires_rotation_to_alternative_tip_at_end ? 180 : 0) + (tip_is_at_top ? 0 : 0)]) translate([dx, dy, tip_is_at_top ? height_tip_top : 0]) rotate([-angle_incline, 0, 0]) cube(edge_size, center = true); +} + +index_tip_helix = 1; // 1 - 4 + +tip_cutting_cube(radius_rotation_helix, radius_strand_helix, index_tip_helix, angle_incline, height, angle_twist_total); diff --git a/DNA_Double_Helix/output/DNA_Double_Helix.png b/DNA_Double_Helix/output/DNA_Double_Helix.png new file mode 100644 index 0000000..da97613 Binary files /dev/null and b/DNA_Double_Helix/output/DNA_Double_Helix.png differ diff --git a/DNA_Double_Helix/output/DNA_Double_Helix.stl b/DNA_Double_Helix/output/DNA_Double_Helix.stl new file mode 100644 index 0000000..2bf871d Binary files /dev/null and b/DNA_Double_Helix/output/DNA_Double_Helix.stl differ