mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-12-30 10:39:39 +00:00
Rename h_base to BASE_HEIGHT
This commit is contained in:
parent
d47043fa51
commit
bf7bbed27a
6 changed files with 41 additions and 42 deletions
|
@ -266,7 +266,7 @@ module hole_pattern(){
|
|||
}
|
||||
|
||||
module cutter_countersink(){
|
||||
screw_hole(SCREW_HOLE_RADIUS + d_clear, 2*h_base,
|
||||
screw_hole(SCREW_HOLE_RADIUS + d_clear, 2*BASE_HEIGHT,
|
||||
false, BASEPLATE_SCREW_COUNTERSINK_ADDITIONAL_RADIUS);
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,7 @@ module cutter_counterbore(){
|
|||
screw_radius = SCREW_HOLE_RADIUS + d_clear;
|
||||
counterbore_height = BASEPLATE_SCREW_COUNTERBORE_HEIGHT + 2*LAYER_HEIGHT;
|
||||
union(){
|
||||
cylinder(h=2*h_base, r=screw_radius);
|
||||
cylinder(h=2*BASE_HEIGHT, r=screw_radius);
|
||||
difference() {
|
||||
cylinder(h = counterbore_height, r=BASEPLATE_SCREW_COUNTERBORE_RADIUS);
|
||||
make_hole_printable(screw_radius, BASEPLATE_SCREW_COUNTERBORE_RADIUS, counterbore_height);
|
||||
|
|
|
@ -90,7 +90,7 @@ module gridfinityLite(gridx, gridy, gridz, gridz_define, style_lip, enable_zsnap
|
|||
intersection() {
|
||||
difference() {
|
||||
gridfinityBase([gridx, gridy], [length, length], hole_options=style_hole, -d_wall*2, false, only_corners=only_corners);
|
||||
translate([-gridx*length/2,-gridy*length/2,2*h_base])
|
||||
translate([-gridx*length/2,-gridy*length/2,2*BASE_HEIGHT])
|
||||
cube([gridx*length,gridy*length,1000]);
|
||||
}
|
||||
translate([0,0,-1])
|
||||
|
@ -98,11 +98,11 @@ module gridfinityLite(gridx, gridy, gridz, gridz_define, style_lip, enable_zsnap
|
|||
translate([0,0,bottom_layer])
|
||||
rounded_rectangle(gridx*1000, gridy*1000, 1000, r_f2);
|
||||
}
|
||||
translate([0,0,h_base+d_clear])
|
||||
rounded_rectangle(gridx*length-0.5005-d_wall*2, gridy*length-0.5005-d_wall*2, h_base, r_f2);
|
||||
translate([0,0,BASE_HEIGHT+d_clear])
|
||||
rounded_rectangle(gridx*length-0.5005-d_wall*2, gridy*length-0.5005-d_wall*2, BASE_HEIGHT, r_f2);
|
||||
}
|
||||
|
||||
translate([0,0,-4*h_base])
|
||||
translate([0,0,-4*BASE_HEIGHT])
|
||||
gridfinityInit(gridx, gridy, height(20,0), 0, length, sl=style_lip)
|
||||
children();
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ module gridfinityLite(gridx, gridy, gridz, gridz_define, style_lip, enable_zsnap
|
|||
intersection() {
|
||||
difference() {
|
||||
gridfinityBase([gridx, gridy], [length, length], hole_options=style_hole, -d_wall*2, false, only_corners=only_corners);
|
||||
translate([-gridx*length/2,-gridy*length/2,2*h_base])
|
||||
translate([-gridx*length/2,-gridy*length/2,2*BASE_HEIGHT])
|
||||
cube([gridx*length,gridy*length,1000]);
|
||||
}
|
||||
translate([0,0,-1])
|
||||
|
@ -129,7 +129,7 @@ module gridfinityLite(gridx, gridy, gridz, gridz_define, style_lip, enable_zsnap
|
|||
rounded_rectangle(gridx*1000, gridy*1000, 1000, r_f2);
|
||||
}
|
||||
|
||||
translate([0,0,-4*h_base])
|
||||
translate([0,0,-4*BASE_HEIGHT])
|
||||
gridfinityInit(gridx, gridy, height(20,0), 0, length, sl=style_lip)
|
||||
children();
|
||||
}
|
||||
|
|
|
@ -85,8 +85,8 @@ d_hole = 26; // center-to-center distance between holes
|
|||
d_bottom = layer*(max(bottom_layer,1));
|
||||
x_l = l_grid/2;
|
||||
|
||||
dht = (gridz_define==0)?gridz*7 : (gridz_define==1)?h_bot+gridz+h_base : gridz-(enable_lip?3.8:0);
|
||||
d_height = (enable_zsnap?((abs(dht)%7==0)?dht:dht+7-abs(dht)%7):dht)-h_base;
|
||||
dht = (gridz_define==0)?gridz*7 : (gridz_define==1)?h_bot+gridz+BASE_HEIGHT : gridz-(enable_lip?3.8:0);
|
||||
d_height = (enable_zsnap?((abs(dht)%7==0)?dht:dht+7-abs(dht)%7):dht)-BASE_HEIGHT;
|
||||
|
||||
d_fo1 = 2*+BASE_TOP_RADIUS;
|
||||
|
||||
|
@ -170,18 +170,18 @@ module gridfinityBaseVase() {
|
|||
difference() {
|
||||
intersection() {
|
||||
block_base_blank(0);
|
||||
translate([0,0,-h_base-1])
|
||||
rounded_square([l_grid-0.5-0.005, l_grid-0.5-0.005, h_base*10], BASE_TOP_RADIUS+0.001, center=true);
|
||||
translate([0,0,-BASE_HEIGHT-1])
|
||||
rounded_square([l_grid-0.5-0.005, l_grid-0.5-0.005, BASE_HEIGHT*10], BASE_TOP_RADIUS+0.001, center=true);
|
||||
}
|
||||
translate([0,0,0.01])
|
||||
difference() {
|
||||
block_base_blank(nozzle*4);
|
||||
translate([0,0,-h_base])
|
||||
translate([0,0,-BASE_HEIGHT])
|
||||
cube([l_grid*2,l_grid*2,d_bottom*2],center=true);
|
||||
}
|
||||
// magic slice
|
||||
rotate([0,0,90])
|
||||
translate([0,0,-h_base+d_bottom+0.01])
|
||||
translate([0,0,-BASE_HEIGHT+d_bottom+0.01])
|
||||
cube([0.001,l_grid*gridx,d_height+d_bottom*2]);
|
||||
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ module gridfinityBaseVase() {
|
|||
pattern_circular(4)
|
||||
intersection() {
|
||||
rotate([0,0,45])
|
||||
translate([-nozzle,3,-h_base+d_bottom+0.01])
|
||||
translate([-nozzle,3,-BASE_HEIGHT+d_bottom+0.01])
|
||||
cube([nozzle*2,l_grid*gridx,d_height+d_bottom*2]);
|
||||
|
||||
block_base_blank(nozzle*4-0.1);
|
||||
|
@ -202,8 +202,8 @@ module gridfinityBaseVase() {
|
|||
pattern_circular(4)
|
||||
block_magnet_blank(0, false);
|
||||
|
||||
translate([0,0,h_base/2])
|
||||
cube([l_grid*2, l_grid*2, h_base], center = true);
|
||||
translate([0,0,BASE_HEIGHT/2])
|
||||
cube([l_grid*2, l_grid*2, BASE_HEIGHT], center = true);
|
||||
}
|
||||
|
||||
if (style_base != 4)
|
||||
|
@ -214,24 +214,24 @@ module gridfinityBaseVase() {
|
|||
module block_magnet_blank(o = 0, half = true) {
|
||||
magnet_radius = MAGNET_HOLE_RADIUS + o;
|
||||
|
||||
translate([d_hole/2,d_hole/2,-h_base+0.1])
|
||||
translate([d_hole/2,d_hole/2,-BASE_HEIGHT+0.1])
|
||||
difference() {
|
||||
hull() {
|
||||
cylinder(r = magnet_radius, h = MAGNET_HOLE_DEPTH*2, center = true);
|
||||
cylinder(r = magnet_radius-(h_base+0.1-MAGNET_HOLE_DEPTH), h = (h_base+0.1)*2, center = true);
|
||||
cylinder(r = magnet_radius-(BASE_HEIGHT+0.1-MAGNET_HOLE_DEPTH), h = (BASE_HEIGHT+0.1)*2, center = true);
|
||||
}
|
||||
if (half)
|
||||
mirror([0,0,1])
|
||||
cylinder(r=magnet_radius*2, h = (h_base+0.1)*4);
|
||||
cylinder(r=magnet_radius*2, h = (BASE_HEIGHT+0.1)*4);
|
||||
}
|
||||
}
|
||||
|
||||
module block_base_blank(o = 0) {
|
||||
mirror([0,0,1]) {
|
||||
hull() {
|
||||
linear_extrude(h_base)
|
||||
linear_extrude(BASE_HEIGHT)
|
||||
rounded_square(l_grid-o-0.05-2*r_c2-2*r_c1, r_fo3, center=true);
|
||||
linear_extrude(h_base-r_c1)
|
||||
linear_extrude(BASE_HEIGHT-r_c1)
|
||||
rounded_square(l_grid-o-0.05-2*r_c2, r_fo2, center=true);
|
||||
}
|
||||
hull() {
|
||||
|
@ -247,7 +247,7 @@ module block_base_blank(o = 0) {
|
|||
module block_pinch(height_mm) {
|
||||
assert(is_num(height_mm));
|
||||
|
||||
translate([0, 0, -h_base])
|
||||
translate([0, 0, -BASE_HEIGHT])
|
||||
block_wall(gridx, gridy, l_grid) {
|
||||
translate([d_wall2-nozzle*2-d_clear*2,0,0])
|
||||
profile_wall(height_mm);
|
||||
|
@ -360,7 +360,7 @@ module block_funnel_outside() {
|
|||
module block_vase_base() {
|
||||
difference() {
|
||||
// base
|
||||
translate([0,0,-h_base]) {
|
||||
translate([0,0,-BASE_HEIGHT]) {
|
||||
translate([0,0,-0.1])
|
||||
color("firebrick")
|
||||
block_bottom(d_bottom, gridx, gridy, l_grid);
|
||||
|
|
|
@ -280,7 +280,7 @@ module block_base_hole(hole_options, o=0) {
|
|||
screw_radius = SCREW_HOLE_RADIUS - (o/2);
|
||||
magnet_radius = MAGNET_HOLE_RADIUS - (o/2);
|
||||
magnet_inner_radius = MAGNET_HOLE_CRUSH_RIB_INNER_RADIUS - (o/2);
|
||||
screw_depth = h_base-o;
|
||||
screw_depth = BASE_HEIGHT - o;
|
||||
// If using supportless / printable mode, need to add additional layers, so they can be removed later.
|
||||
supportless_additional_layers = screw_hole ? 2 : 3;
|
||||
magnet_depth = MAGNET_HOLE_DEPTH - o +
|
||||
|
|
|
@ -31,7 +31,7 @@ function fromGridfinityUnits(gridfinityUnit, includeLipHeight = false) =
|
|||
* @returns The final value in mm.
|
||||
*/
|
||||
function includingFixedHeights(mmHeight, includeLipHeight = false) =
|
||||
mmHeight + h_bot + h_base + (includeLipHeight ? STACKING_LIP_SIZE.y : 0);
|
||||
mmHeight + h_bot + BASE_HEIGHT + (includeLipHeight ? STACKING_LIP_SIZE.y : 0);
|
||||
|
||||
/**
|
||||
* @brief Three Functions in One. For height calculations.
|
||||
|
@ -63,7 +63,7 @@ function height (z,d=0,l=0,enable_zsnap=true) =
|
|||
hf(z,d,l)+7-abs(hf(z,d,l))%7
|
||||
)
|
||||
:hf(z,d,l)
|
||||
) -h_base;
|
||||
) - BASE_HEIGHT;
|
||||
|
||||
// Creates equally divided cutters for the bin
|
||||
//
|
||||
|
@ -169,7 +169,7 @@ module gridfinityInit(gx, gy, h, h0 = 0, l = l_grid, sl = 0) {
|
|||
// s: toggle the rounded back corner that allows for easy removal
|
||||
|
||||
module cut(x=0, y=0, w=1, h=1, t=1, s=1, tab_width=d_tabw, tab_height=d_tabh) {
|
||||
translate([0,0,-$dh-h_base])
|
||||
translate([0, 0, -$dh - BASE_HEIGHT])
|
||||
cut_move(x,y,w,h)
|
||||
block_cutter(clp(x,0,$gxx), clp(y,0,$gyy), clp(w,0,$gxx-x), clp(h,0,$gyy-y), t, s, tab_width, tab_height);
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ module cutEqualBins(bins_x=1, bins_y=1, len_x=1, len_y=1, pos_x=0, pos_y=0, styl
|
|||
// Translates an object from the origin point to the center of the requested compartment block, can be used to add custom cuts in the bin
|
||||
// See cut() module for parameter descriptions
|
||||
module cut_move(x, y, w, h) {
|
||||
translate([0,0,$dh0==0?$dh+h_base:$dh0+h_base])
|
||||
translate([0, 0, ($dh0==0 ? $dh : $dh0) + BASE_HEIGHT])
|
||||
cut_move_unsafe(clp(x,0,$gxx), clp(y,0,$gyy), clp(w,0,$gxx-x), clp(h,0,$gyy-y))
|
||||
children();
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ module gridfinityBase(grid_size, grid_dimensions=GRID_DIMENSIONS_MM, hole_option
|
|||
|
||||
// Top which ties all bases together
|
||||
if (final_cut) {
|
||||
translate([0, 0, h_base-TOLLERANCE])
|
||||
translate([0, 0, BASE_HEIGHT])
|
||||
rounded_square([grid_size_mm.x, grid_size_mm.y, h_bot], BASE_TOP_RADIUS, center=true);
|
||||
}
|
||||
|
||||
|
@ -338,8 +338,8 @@ module block_base(hole_options, off=0, top_dimensions=BASE_TOP_DIMENSIONS, thumb
|
|||
sweep_rounded(sweep_inner)
|
||||
base_polygon();
|
||||
|
||||
translate([0, 0, BASE_PROFILE_MAX.y/2])
|
||||
cube([cube_size.x, cube_size.y, BASE_PROFILE_MAX.y], center=true);
|
||||
translate([0, 0, BASE_HEIGHT/2])
|
||||
cube([cube_size.x, cube_size.y, BASE_HEIGHT], center=true);
|
||||
}
|
||||
|
||||
if (thumbscrew) {
|
||||
|
@ -450,13 +450,13 @@ module profile_wall2(height_mm) {
|
|||
}
|
||||
|
||||
module block_wall(gx, gy, l) {
|
||||
translate([0,0,h_base])
|
||||
translate([0, 0, BASE_HEIGHT])
|
||||
sweep_rounded([gx*l-2*r_base-0.5-0.001, gy*l-2*r_base-0.5-0.001])
|
||||
children();
|
||||
}
|
||||
|
||||
module block_bottom( h = 2.2, gx, gy, l ) {
|
||||
translate([0,0,h_base+0.1])
|
||||
translate([0, 0, BASE_HEIGHT + 0.1])
|
||||
rounded_rectangle(gx*l-0.5-d_wall/4, gy*l-0.5-d_wall/4, h, r_base+0.01);
|
||||
}
|
||||
|
||||
|
@ -482,7 +482,7 @@ module block_cutter(x,y,w,h,t,s,tab_width=d_tabw,tab_height=d_tabh) {
|
|||
ycutlast = abs(y+h-$gyy)<0.001 && $style_lip == 0;
|
||||
xcutfirst = x == 0 && $style_lip == 0;
|
||||
xcutlast = abs(x+w-$gxx)<0.001 && $style_lip == 0;
|
||||
zsmall = ($dh+h_base)/7 < 3;
|
||||
zsmall = ($dh+BASE_HEIGHT)/7 < 3;
|
||||
|
||||
ylen = h*($gyy*l_grid+d_magic)/$gyy-d_div;
|
||||
xlen = w*($gxx*l_grid+d_magic)/$gxx-d_div;
|
||||
|
@ -494,7 +494,7 @@ module block_cutter(x,y,w,h,t,s,tab_width=d_tabw,tab_height=d_tabh) {
|
|||
cut = (zsmall || t == 5) ? (ycutlast?v_cut_lip:0) : v_cut_tab;
|
||||
style = (t > 1 && t < 5) ? t-3 : (x == 0 ? -1 : xcutlast ? 1 : 0);
|
||||
|
||||
translate([0,ylen/2,h_base+h_bot])
|
||||
translate([0, ylen/2, BASE_HEIGHT+h_bot])
|
||||
rotate([90,0,-90]) {
|
||||
|
||||
if (!zsmall && xlen - tab_width > 4*r_f2 && (t != 0 && t != 5)) {
|
||||
|
|
|
@ -173,6 +173,11 @@ BASE_TOP_DIMENSIONS = [41.5, 41.5];
|
|||
*/
|
||||
BASE_PROFILE_MAX = BASE_PROFILE[3];
|
||||
|
||||
/**
|
||||
* @Summary Height of the base.
|
||||
*/
|
||||
BASE_HEIGHT = BASE_PROFILE_MAX.y;
|
||||
|
||||
/**
|
||||
* @Summary Corner radius of the bottom of the base.
|
||||
* @Details This is also how much BASE_PROFILE needs to be translated
|
||||
|
@ -191,12 +196,6 @@ function base_bottom_dimensions(top_dimensions = BASE_TOP_DIMENSIONS) =
|
|||
[top_dimensions.x - 2*BASE_PROFILE_MAX.x,
|
||||
top_dimensions.y - 2*BASE_PROFILE_MAX.x];
|
||||
|
||||
/**
|
||||
* @summary Height of the raw base
|
||||
* @Deprecated
|
||||
*/
|
||||
h_base = BASE_PROFILE_MAX.y;
|
||||
|
||||
// ****************************************
|
||||
// Baseplate constants
|
||||
// Based on https://gridfinity.xyz/specification/
|
||||
|
|
Loading…
Reference in a new issue