Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
27 changes: 17 additions & 10 deletions models/core/lib/lockpin.scad
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,38 @@ module lockpin(grip_type = "standard") {
*
* Creates the grip part of the lock pin.
* If grip_type is "no_grip", no grip arms are created.
* If grip_type is "standard", two grip arms are created on both sides.
* If grip_type is "standard", a symmetric two-stage grip is created.
* If grip_type is "extended", standard grip with an extended outer arm for improved stability.
* If grip_type is "z_grip", a Z-shaped grip variant is created (not implemented yet).
*/
module grip(grip_type = "standard") {
if (grip_type != "no_grip") {
grip_base_dimensions = [lockpin_width_outer, lockpin_height, grip_base_length];
grip_outer_dimensions = [grip_width, lockpin_height, grip_thickness_outer];
// --- Dimensions ----------------------------------------------------------
grip_base_dimensions = [lockpin_width_outer, lockpin_height, grip_base_length];
grip_inner_dimensions = [grip_width, lockpin_height, grip_thickness_inner];
outer_height = grip_type == "extended" ? lockpin_height * 2 : lockpin_height;
grip_outer_dimensions = [grip_width, outer_height, grip_thickness_outer];

base_translation = lockpin_prismoid_length + lockpin_endpart_length - lockpin_chamfer - TOLERANCE/2;
// --- Positioning ----------------------------------------------------------
base_translation = lockpin_prismoid_length + lockpin_endpart_length - lockpin_chamfer - TOLERANCE / 2;

// --- Geometry ------------------------------------------------------------
union() {
// Base part of the grip
translate([0, 0, -base_translation - grip_base_length / 2])
cuboid(grip_base_dimensions, chamfer=lockpin_chamfer, except=TOP);
cuboid(grip_base_dimensions, chamfer=lockpin_chamfer, except=TOP);

if(grip_type == "standard") {
if (grip_type == "standard" || grip_type == "extended") {
// Outer grip arm
translate([0, 0, -base_translation - grip_base_length + grip_thickness_outer / 2])
cuboid(grip_outer_dimensions, chamfer=lockpin_chamfer, except=TOP);
// Inner part of the grip
translate([0, 0, -base_translation - grip_base_length + grip_thickness_outer + grip_thickness_inner / 2 + grip_distance])
cuboid(grip_inner_dimensions, chamfer=lockpin_chamfer, except=TOP);
cuboid(grip_outer_dimensions, chamfer=lockpin_chamfer, except=TOP);
// Inner grip arm
translate([0, 0, -base_translation - grip_base_length + 1.5 * grip_thickness_outer + 0.5 * grip_thickness_inner + grip_distance])
cuboid(grip_inner_dimensions, chamfer=lockpin_chamfer, except=TOP);
} else if (grip_type == "z_grip") {
// TODO: Z-Grip variant has only 1 arm on each side but each arm is thicker
echo("Z-Grip variant not implemented yet.");

}
}
}
Expand Down
30 changes: 17 additions & 13 deletions models/core/makerworld/lockpin.scad
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include <BOSL2/std.scad>
/* [Parameters] */

// Type of grip for the lock pin
grip_type = "standard"; // ["standard","no_grip"]
grip_type = "standard"; // ["standard","extended","no_grip"]

// --- Examples ---

Expand All @@ -13,7 +13,10 @@ grip_type = "standard"; // ["standard","no_grip"]
// Example 2: Create a lock pin with no grip
// lockpin(grip_type="no_grip");

// Example 3: Create a lock pin with grip_type as set above
// Example 3: Create a lock pin with "extended" grip
// lockpin(grip_type="extended");

// Example 4: Create a lock pin with grip_type as set above
color(HR_YELLOW)
lockpin(grip_type=grip_type);

Expand Down Expand Up @@ -307,31 +310,32 @@ module lockpin(grip_type = "standard") {

module grip(grip_type = "standard") {
if (grip_type != "no_grip") {
grip_base_dimensions = [lockpin_width_outer, lockpin_height, grip_base_length];
grip_outer_dimensions = [grip_width, lockpin_height, grip_thickness_outer];
grip_base_dimensions = [lockpin_width_outer, lockpin_height, grip_base_length];
grip_inner_dimensions = [grip_width, lockpin_height, grip_thickness_inner];
outer_height = grip_type == "extended" ? lockpin_height * 2 : lockpin_height;
grip_outer_dimensions = [grip_width, outer_height, grip_thickness_outer];

base_translation = lockpin_prismoid_length + lockpin_endpart_length - lockpin_chamfer - TOLERANCE/2;
base_translation = lockpin_prismoid_length + lockpin_endpart_length - lockpin_chamfer - TOLERANCE / 2;

union() {

translate([0, 0, -base_translation - grip_base_length / 2])
cuboid(grip_base_dimensions, chamfer=lockpin_chamfer, except=TOP);
cuboid(grip_base_dimensions, chamfer=lockpin_chamfer, except=TOP);

if(grip_type == "standard") {
if (grip_type == "standard" || grip_type == "extended") {
translate([0, 0, -base_translation - grip_base_length + grip_thickness_outer / 2])
cuboid(grip_outer_dimensions, chamfer=lockpin_chamfer, except=TOP);

translate([0, 0, -base_translation - grip_base_length + grip_thickness_outer + grip_thickness_inner / 2 + grip_distance])
cuboid(grip_inner_dimensions, chamfer=lockpin_chamfer, except=TOP);
cuboid(grip_outer_dimensions, chamfer=lockpin_chamfer, except=TOP);
translate([0, 0, -base_translation - grip_base_length + 1.5 * grip_thickness_outer + 0.5 * grip_thickness_inner + grip_distance])
cuboid(grip_inner_dimensions, chamfer=lockpin_chamfer, except=TOP);
} else if (grip_type == "z_grip") {

// TODO: Z-Grip variant has only 1 arm on each side but each arm is thicker
echo("Z-Grip variant not implemented yet.");

}
}
}
}


module end_parts(grip_type = "standard") {
end_part_half(true);
mirror([0, 0, 1]) end_part_half(grip_type == "no_grip");
Expand Down
7 changes: 5 additions & 2 deletions models/core/parts/lockpin.scad
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include <../main.scad>
/* [Parameters] */

// Type of grip for the lock pin
grip_type = "standard"; // ["standard","no_grip"]
grip_type = "standard"; // ["standard","extended","no_grip"]

// --- Examples ---

Expand All @@ -18,6 +18,9 @@ grip_type = "standard"; // ["standard","no_grip"]
// Example 2: Create a lock pin with no grip
// lockpin(grip_type="no_grip");

// Example 3: Create a lock pin with grip_type as set above
// Example 3: Create a lock pin with "extended" grip
// lockpin(grip_type="extended");

// Example 4: Create a lock pin with grip_type as set above
color(HR_YELLOW)
lockpin(grip_type=grip_type);
3 changes: 3 additions & 0 deletions models/core/presets/lockpins.scad
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ module lockpins_grid(grid=10, grip_type="standard") {
// Standard grip grid (50 pins)
// lockpins_grid(grid=grid, grip_type="standard");

// Extended grip grid (50 pins)
// lockpins_grid(grid=grid, grip_type="extended");

// Uncomment for no-grip variant:
lockpins_grid(grid=grid, grip_type="no_grip");
Loading