Skip to content

Added parametric label height #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gridfinity_basic_cup.scad
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ withLabel = "disabled"; // ["disabled", "left", "right", "center", "leftchamber"
fingerslide = true;
// Width of the label in number of units, or zero means full width
labelWidth = 0; // .01
// Height of the label in mm, default uses 12mm, common are 12, 9 and 6
labelHeight = 12;
// Minimum thickness above cutouts in base (Zack's design is effectively 1.2)
floor_thickness = 0.7;
// Wall thickness (Zack's design is 0.95)
Expand Down Expand Up @@ -55,6 +57,7 @@ else if (irregular_subdivisions) {
num_z=height,
withLabel=withLabel,
labelWidth=labelWidth,
labelHeight=labelHeight,
fingerslide=fingerslide,
magnet_diameter=magnet_diameter,
screw_depth=screw_depth,
Expand All @@ -75,6 +78,7 @@ else {
chambers=chambers,
withLabel=withLabel,
labelWidth=labelWidth,
labelHeight=labelHeight,
fingerslide=fingerslide,
magnet_diameter=magnet_diameter,
screw_depth=screw_depth,
Expand Down
16 changes: 12 additions & 4 deletions gridfinity_cup_modules.scad
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ default_chambers = 1;
default_withLabel = "disabled"; //[disabled: no label, left: left aligned label, right: right aligned label, center: center aligned label, leftchamber: left aligned chamber label, rightchamber: right aligned chamber label, centerchamber: center aligned chamber label]
// Width of the label in number of units, or zero for full width
default_labelWidth = 0; // 0.01
// Height of the label in mm
default_labelHeight = 12;
// Include larger corner fillet
default_fingerslide = true;
// Set magnet diameter and depth to 0 to print without magnet holes
Expand Down Expand Up @@ -35,6 +37,7 @@ basic_cup(
chambers=default_chambers,
withLabel=default_withLabel,
labelWidth=default_labelWidth,
labelHeight=default_labelHeight,
magnet_diameter=default_magnet_diameter,
screw_depth=default_screw_depth,
floor_thickness=default_floor_thickness,
Expand All @@ -57,6 +60,7 @@ module basic_cup(
chambers=default_chambers,
withLabel=default_withLabel,
labelWidth=default_labelWidth,
labelHeight=default_labelHeight,
fingerslide=default_fingerslide,
magnet_diameter=default_magnet_diameter,
screw_depth=default_screw_depth,
Expand All @@ -75,7 +79,8 @@ module basic_cup(
difference() {
grid_block(num_x, num_y, num_z, magnet_diameter, screw_depth, hole_overhang_remedy=hole_overhang_remedy, half_pitch=half_pitch, box_corner_attachments_only=box_corner_attachments_only);
color("red") partitioned_cavity(num_x, num_y, num_z, withLabel=withLabel,
labelWidth=labelWidth, fingerslide=fingerslide, magnet_diameter=magnet_diameter,
labelWidth=labelWidth,
labelHeight=labelHeight, fingerslide=fingerslide, magnet_diameter=magnet_diameter,
screw_depth=screw_depth, floor_thickness=floor_thickness, wall_thickness=wall_thickness,
efficient_floor=efficient_floor, separator_positions=separator_positions, lip_style=lip_style);
}
Expand All @@ -89,6 +94,7 @@ module irregular_cup(
num_z,
withLabel=default_withLabel,
labelWidth=default_labelWidth,
labelHeight=default_labelHeight,
fingerslide=default_fingerslide,
magnet_diameter=default_magnet_diameter,
screw_depth=default_screw_depth,
Expand All @@ -103,15 +109,17 @@ module irregular_cup(
difference() {
grid_block(num_x, num_y, num_z, magnet_diameter, screw_depth, hole_overhang_remedy=hole_overhang_remedy, half_pitch=half_pitch, box_corner_attachments_only=box_corner_attachments_only);
color("red") partitioned_cavity(num_x, num_y, num_z, withLabel=withLabel,
labelWidth=labelWidth, fingerslide=fingerslide, magnet_diameter=magnet_diameter,
labelWidth=labelWidth,
labelHeight=labelHeight, fingerslide=fingerslide, magnet_diameter=magnet_diameter,
screw_depth=screw_depth, floor_thickness=floor_thickness, wall_thickness=wall_thickness,
efficient_floor=efficient_floor, separator_positions=separator_positions, lip_style=lip_style);
}
}


module partitioned_cavity(num_x, num_y, num_z, withLabel=default_withLabel,
labelWidth=default_labelWidth, fingerslide=default_fingerslide,
labelWidth=default_labelWidth,
labelHeight=default_labelHeight, fingerslide=default_fingerslide,
magnet_diameter=default_magnet_diameter, screw_depth=default_screw_depth,
floor_thickness=default_floor_thickness, wall_thickness=default_wall_thickness,
efficient_floor=default_efficient_floor, separator_positions=[], lip_style=default_lip_style) {
Expand All @@ -123,7 +131,7 @@ module partitioned_cavity(num_x, num_y, num_z, withLabel=default_withLabel,
bar_d = 1.2;
zpoint = gridfinity_zpitch*num_z;

yz = [[ (num_y-0.5)*gridfinity_pitch-14, zpoint-bar_d/2 ],
yz = [[ (num_y-0.5)*gridfinity_pitch-labelHeight-2, zpoint-bar_d/2 ],
[ (num_y-0.5)*gridfinity_pitch, zpoint-bar_d/2 ],
[ (num_y-0.5)*gridfinity_pitch, zpoint-bar_d/2-10.18 ]
];
Expand Down