mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2025-01-08 15:19:43 +00:00
if either grid size is 0, we should probably not render the grid
This commit is contained in:
parent
e1e5dcc49e
commit
7c217f8691
1 changed files with 29 additions and 27 deletions
|
@ -156,36 +156,38 @@ module gridfinityBaseplate(grid_size_bases, length, min_size_mm, sp, hole_option
|
||||||
difference() {
|
difference() {
|
||||||
union() {
|
union() {
|
||||||
// Baseplate itself
|
// Baseplate itself
|
||||||
pattern_linear(grid_size.x, grid_size.y, length) {
|
if (grid_size.x > 0 && grid_size.y > 0) {
|
||||||
// Single Baseplate piece
|
pattern_linear(grid_size.x, grid_size.y, length) {
|
||||||
difference() {
|
// Single Baseplate piece
|
||||||
if (minimal) {
|
difference() {
|
||||||
square_baseplate_lip(additional_height);
|
if (minimal) {
|
||||||
} else {
|
square_baseplate_lip(additional_height);
|
||||||
solid_square_baseplate(additional_height);
|
} else {
|
||||||
}
|
solid_square_baseplate(additional_height);
|
||||||
|
}
|
||||||
|
|
||||||
// Bottom/through pattern for the solid baseplates.
|
// Bottom/through pattern for the solid baseplates.
|
||||||
if (sp == 1) {
|
if (sp == 1) {
|
||||||
cutter_weight();
|
cutter_weight();
|
||||||
} else if (sp == 2 || sp == 3) {
|
} else if (sp == 2 || sp == 3) {
|
||||||
translate([0,0,-TOLLERANCE])
|
translate([0,0,-TOLLERANCE])
|
||||||
linear_extrude(additional_height + (2 * TOLLERANCE))
|
linear_extrude(additional_height + (2 * TOLLERANCE))
|
||||||
profile_skeleton();
|
profile_skeleton();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add holes to the solid baseplates.
|
// Add holes to the solid baseplates.
|
||||||
hole_pattern(){
|
hole_pattern(){
|
||||||
// Manget hole
|
// Manget hole
|
||||||
translate([0, 0, additional_height+TOLLERANCE])
|
translate([0, 0, additional_height+TOLLERANCE])
|
||||||
mirror([0, 0, 1])
|
mirror([0, 0, 1])
|
||||||
block_base_hole(hole_options);
|
block_base_hole(hole_options);
|
||||||
|
|
||||||
translate([0,0,-TOLLERANCE])
|
translate([0,0,-TOLLERANCE])
|
||||||
if (sh == 1) {
|
if (sh == 1) {
|
||||||
cutter_countersink();
|
cutter_countersink();
|
||||||
} else if (sh == 2) {
|
} else if (sh == 2) {
|
||||||
cutter_counterbore();
|
cutter_counterbore();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue