mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2025-01-08 15:19:43 +00:00
chore: remove cutByRatio helper util (for now)
This commit is contained in:
parent
c0a34d6fce
commit
621b5ec128
2 changed files with 1 additions and 49 deletions
|
@ -68,13 +68,6 @@ c_depth = 1;
|
|||
// chamfer around the top rim of the holes
|
||||
c_chamfer = 0.5; // .1
|
||||
|
||||
/* [Split Compartments] */
|
||||
// divide into 2 compartments by this ratio
|
||||
ratiox = 0; // [0:0.001:1]
|
||||
// divide into 2 compartments by this ratio
|
||||
ratioy = 0; // [0:0.001:1]
|
||||
|
||||
|
||||
/* [Height] */
|
||||
// determine what the variable "gridz" applies to based on your use case
|
||||
gridz_define = 0; // [0:gridz is the height of bins in units of 7mm increments - Zack's method,1:gridz is the internal height in millimeters, 2:gridz is the overall external height of the bin in millimeters]
|
||||
|
@ -120,11 +113,7 @@ hole_options = bundle_hole_options(refined_holes, magnet_holes, screw_holes, cru
|
|||
color("tomato") {
|
||||
gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap), height_internal, sl=style_lip, extra=[extrax,extray]) {
|
||||
|
||||
if ((ratiox > 0 && ratiox < 1) || (ratioy > 0 && ratioy < 1)) {
|
||||
|
||||
cutByRatio(rx = ratiox, ry = ratioy, style_tab = style_tab, scoop_weight = scoop, place_tab = place_tab);
|
||||
|
||||
} else if (divx > 0 && divy > 0) {
|
||||
if (divx > 0 && divy > 0) {
|
||||
|
||||
cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop, place_tab = place_tab);
|
||||
|
||||
|
|
|
@ -148,43 +148,6 @@ module cutCylinders(n_divx=1, n_divy=1, cylinder_diameter=1, cylinder_height=1,
|
|||
}
|
||||
}
|
||||
|
||||
// Create two or four cutters for the bin divided by the given ratio (max 4 cutouts per bin)
|
||||
//
|
||||
// rx: ratio to divide x-axis by
|
||||
// ry: ratio to divide y-axis by
|
||||
// style_tab: tab style for all compartments. see cut()
|
||||
// scoop_weight: scoop toggle for all compartments. see cut()
|
||||
// place_tab: tab suppression for all compartments. see "gridfinity-rebuilt-bins.scad"
|
||||
module cutByRatio(rx=1, ry=1, style_tab=1, scoop_weight=1, place_tab=1) {
|
||||
n_divx=rx > 0 && rx < 1 ? 2 : 1;
|
||||
n_divy=ry > 0 && ry < 1 ? 2 : 1;
|
||||
|
||||
// opposite cut ratio
|
||||
orx=1 - rx;
|
||||
ory=1 - ry;
|
||||
|
||||
for (i = [1:n_divx])
|
||||
for (j = [1:n_divy]) {
|
||||
// disable style_tab if only Top-Left Division checked
|
||||
tab_style=place_tab == 1 && (i != 1 || j != n_divy) ? 5 : style_tab;
|
||||
|
||||
cut(
|
||||
(i - 1)*rx*$gxx,
|
||||
(j - 1)*ry*$gyy,
|
||||
(i == 1 ? rx : orx)*$gxx,
|
||||
(j == 1 ? ry : ory)*$gyy,
|
||||
tab_style,
|
||||
scoop_weight,
|
||||
offsets=[
|
||||
($extrax < 0 ? (i == 1 ? 1 : orx) : (i-1)*rx)*$extrax,
|
||||
($extray < 0 ? (j == 1 ? 1 : ory) : (j-1)*ry)*$extray,
|
||||
(i == 1 ? rx : orx)*abs($extrax),
|
||||
(j == 1 ? ry : ory)*abs($extray)
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// initialize gridfinity
|
||||
// sl: lip style of this bin.
|
||||
// 0:Regular lip, 1:Remove lip subtractively, 2:Remove lip and retain height
|
||||
|
|
Loading…
Reference in a new issue