3d-stuff/openscad/foreign/parametric-helix_haystack-mod/helix_haystack.scad

97 lines
6.5 KiB
OpenSCAD
Raw Normal View History

// number of fragments | a higher fragment count will result in slower render times '20' is sufficient.
fn = 30; // [0:100]
// "sugar phosphate backbones" | part of helix_base module | if adjusted also consider adjusting 'post_distance_apart' or 'center_bridge_length'.
post_radius = 3.5; // [0:500]
post_hole_radius = 1.25; // [0:500]
// part of helix_base module | if adjusted also consider adjusting 'center_bridge_length'.
post_distance_apart = 15; // [0:500]
// "base pairs" length between "sugar phosphate backbones" | part of helix_base module | if adjusted also consider adjusting 'post_distance_apart'.
center_bridge_length = 24; // [0:500]
// part of helix_base module | thickness of "basepairs" in relevence to the the Y-axis of 'helix_base' before "linear_extrude" is implemented. further explanation is below.
center_bridge_width = .8; // [0:0.1:500]
// 'helix_height' adjusts the height of the linear_extruded 'helix_base' module | 'helix_height, helix_twists, helix_twists' all work hand in hand and should be experimented to fully understand the linear_extrude's nature.
helix_height = 120; // [0:500]
// 'helix_twists' adjusts the degree of twist in the linear_extruded 'helix_base' module.
helix_twists = 400; // [0:3600]
// 'helix_slices' adjusts the number of slices used in the linear_extruded 'helix_base' module | more slices = higher resolution and longer render times, less slices = the contrary | 200 is sufficient.
helix_slices = 600; // [0:500]
// this is fun try changing from 0-3 to scale 'helix_base' as it reaches its specified height in 'helix_height' | '1' = 1to1 scale, 0 = 1to0, 2 = 1to2 scale and so on in sequential order.
helix_scale = 1; // [0:10]
// the radius of the differenced circle that creates the spaces between each "base pair" | if adjusted you may also want to adjust 'center_bridge_length' and 'post_distance_apart'.
spacer_radius = 11.6; // [0:500]
// the height of the differenced circle changing this will result in a visual thickness change, in the Z-axis, of each "basepair".
spacer_height = 4; // [0:550]
// the point in the Z-axis at which the spacers will start appearing | 'spacer_start, spacer_increment_distance, and spacer_increment_height all work together to create the "base pairs/ bridges" that appear between each "sugar phosphate backbone/post".
spacer_start = 0; // [0:550]
// the distance between each spacer changing this will result in a visual thickness change, in the Z-axis, of each "basepair".
spacer_increment_distance = 6; // [0:500]
// the height to which the spacers ascend to and then stop being produced.
spacer_increment_height = helix_height; // [0:500]
// the radius of the circle where the standing platform is located at the base of the helix.
base_platform_radius = 30; // [0:500]
base_platform_inner_radius = 25;
// the height of the above said platform.
base_platform_height = 12; // [0:100]
// the controls the number of sides the platform has, 0 defaults to 'fn'. 3, 4, 5, 6 ...
base_platform_shape = 6; // [0:50]
usb_mount_hole_spacing = 15; // 19-(2*2) ?
usb_mount_hole_dia = 2.0; // ?
usb_height = 4.1;
usb_rectangular_width = 11+1; //presumeably this is 19-4-4 = 11 plus one for wiggle room. needs testing.
module helix_basic(){
translate([-post_distance_apart,0,0]){
difference(){
circle(post_radius,$fn = fn);
circle(post_hole_radius,$fn = fn);
}
}
translate([post_distance_apart,0,0]){
difference(){
circle(post_radius, $fn = fn);
circle(post_hole_radius, $fn = fn);
}
}
square([center_bridge_length,center_bridge_width],center = true);
}
// the basic 2D shape that the helix is extruded upon.
union(){
difference(){
linear_extrude(height = helix_height, twist = helix_twists, slices = helix_slices, scale = helix_scale){
helix_basic();
}
for (a = [ spacer_start : spacer_increment_distance : spacer_increment_height])
translate([0, 0, a]) {
linear_extrude(height = spacer_height, center = true){
circle(spacer_radius, $fn = fn);
}
}
}
2025-03-14 13:48:05 +01:00
rotate([0,0,helix_twists+90+3*post_radius-0.5]){
translate([post_distance_apart,0,helix_height])scale([1,1,0.25])sphere(r = post_radius, $fn = fn);
translate([-post_distance_apart,0,helix_height])scale([1,1,0.25])sphere(r = post_radius, $fn = fn);
}
}
translate([0,0,-base_platform_height/2])difference(){
hull(){ // base
translate([0,0,base_platform_height/3])cylinder(r = base_platform_radius-(base_platform_height/2), h = base_platform_height/3, center = true, $fn = base_platform_shape);
translate([0,0,-base_platform_height/4])cylinder(r = base_platform_radius, h = base_platform_height/2, center = true, $fn = base_platform_shape);
}
2025-03-14 13:48:05 +01:00
translate([post_distance_apart,0,(base_platform_height/2)-(base_platform_height/4)])cylinder(r1 = post_hole_radius*2, r2 = post_hole_radius, h = base_platform_height/2+0.2, center = true, $fn = fn);
translate([-post_distance_apart,0,(base_platform_height/2)-(base_platform_height/4)])cylinder(r1 = post_hole_radius*2, r2 = post_hole_radius, h = base_platform_height/2+0.2, center = true, $fn = fn);
translate([0,0,-base_platform_height/2+0.01])cylinder(r = base_platform_inner_radius, h = base_platform_height, center = true, $fn = base_platform_shape);
translate([0,0,-base_platform_height/2+1-0.01])cylinder(r = base_platform_inner_radius+2, h = 2, center = true, $fn = base_platform_shape);
// todo: add cutout through base for filament-leds, because they don't reach to the bottom!
// usb-module:
translate([0,base_platform_radius*0.75,- base_platform_height/6])rotate([90,0,0])cube([usb_rectangular_width,usb_height,15],center=true); //cylinder(d = usb_height, h = 10, center = true, $fn = fn);
translate([usb_mount_hole_spacing/2,base_platform_radius*0.75,- base_platform_height/6])rotate([90,0,0])cylinder(d = usb_mount_hole_dia, h = 10, center = true, $fn = base_platform_shape);
translate([-usb_mount_hole_spacing/2,base_platform_radius*0.75,- base_platform_height/6])rotate([90,0,0])cylinder(d = usb_mount_hole_dia, h = 10, center = true, $fn = base_platform_shape);
}
// baseplate with pry-hole:
//translate([0,0,-15])difference(){
// translate([0,0,(-base_platform_height/2+1-0.01)])cylinder(r = base_platform_inner_radius+2, h = 2-0.2, center = true, $fn = base_platform_shape);
// for (x = [ base_platform_radius*0.75 , -base_platform_radius*0.75 ])translate([0,x,(-base_platform_height/2+1-0.01)])cube([10,2,2+0.01], center=true);
//}