Break Gridfinity Refined thumbscrew out to a separate function

Also move constants to standard.scad.
This commit is contained in:
Arthur Moore 2024-10-27 09:56:21 -04:00
parent bf7bbed27a
commit fa942bf5f5
2 changed files with 21 additions and 15 deletions

View file

@ -306,6 +306,18 @@ module base_polygon() {
polygon(solid_profile); polygon(solid_profile);
} }
/**
* @brief Internal function to create the negative for a Gridfinity Refined thumbscrew hole.
* @details Magic constants are what the threads.ScrewHole function does.
*/
module _base_thumbscrew() {
ScrewThread(
1.01 * BASE_THUMBSCREW_OUTER_DIAMETER + 1.25 * 0.4,
BASE_HEIGHT,
BASE_THUMBSCREW_PITCH
);
}
/** /**
* @brief A single Gridfinity base. With holes (if set). * @brief A single Gridfinity base. With holes (if set).
* @param hole_options @see block_base_hole.hole_options * @param hole_options @see block_base_hole.hole_options
@ -325,13 +337,6 @@ module block_base(hole_options, off=0, top_dimensions=BASE_TOP_DIMENSIONS, thumb
str("Minimum size of a single base must be greater than ", 2*BASE_TOP_RADIUS) str("Minimum size of a single base must be greater than ", 2*BASE_TOP_RADIUS)
); );
thumbscrew_outerdiam = 15;
thumbscrew_height = 5;
thumbscrew_tolerance = 0.4;
thumbscrew_tooth_angle = 30;
thumbscrew_pitch = 1.5;
render(convexity = 2) render(convexity = 2)
difference() { difference() {
union(){ union(){
@ -343,14 +348,7 @@ module block_base(hole_options, off=0, top_dimensions=BASE_TOP_DIMENSIONS, thumb
} }
if (thumbscrew) { if (thumbscrew) {
ScrewThread( _base_thumbscrew();
1.01 * thumbscrew_outerdiam + 1.25 * thumbscrew_tolerance,
thumbscrew_height,
thumbscrew_pitch,
thumbscrew_tooth_angle,
thumbscrew_tolerance,
tooth_height=0
);
} }
// 4 holes // 4 holes
// Need this fancy code to support refined holes and non-square bases. // Need this fancy code to support refined holes and non-square bases.

View file

@ -196,6 +196,14 @@ function base_bottom_dimensions(top_dimensions = BASE_TOP_DIMENSIONS) =
[top_dimensions.x - 2*BASE_PROFILE_MAX.x, [top_dimensions.x - 2*BASE_PROFILE_MAX.x,
top_dimensions.y - 2*BASE_PROFILE_MAX.x]; top_dimensions.y - 2*BASE_PROFILE_MAX.x];
// ***************
// Gridfinity Refined Thumbscrew
// See https://www.printables.com/model/413761-gridfinity-refined
// ***************
BASE_THUMBSCREW_OUTER_DIAMETER=15;
BASE_THUMBSCREW_PITCH=1.5;
// **************************************** // ****************************************
// Baseplate constants // Baseplate constants
// Based on https://gridfinity.xyz/specification/ // Based on https://gridfinity.xyz/specification/