Skip to content
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

Add Raya 1-5 files #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
64 changes: 64 additions & 0 deletions src/main/scad/yavuz-demirhan/Raya1b.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
include <puzzlecad.scad>

box_puzzle_scale = 15;
box_puzzle_border = 6;
$burr_inset = 0.125;

interior_dim = [4, 3, 2] * box_puzzle_scale;

dim = interior_dim + [box_puzzle_border * 2, box_puzzle_border * 2, box_puzzle_border];


mid = box_puzzle_border / 2 + 0.5;
far = dim.y - mid;
far2 = dim.x - mid;

*pieces();
box();
cap();
Comment on lines +17 to +18
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be starred by default


module pieces() {
burr_plate([
["xx|xx"],["xx|xx"],["xx|xx"], //piece A-3 copies
["x..|xxx"],["x..|xxx"],["x..|xxx"], //piece B-3 copies
], $burr_scale = box_puzzle_scale,$plate_width = 150,$burr_bevel = 1.0);
Comment on lines +22 to +24
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code style: best is to put a space after each comma, for readability

}

module box() {

difference() {
beveled_cube(dim);
translate([box_puzzle_border - $burr_inset, box_puzzle_border - $burr_inset, box_puzzle_border- $burr_inset])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: add an extra $burr_inset on the z axis here:

translate([box_puzzle_border - $burr_inset, box_puzzle_border - $burr_inset, box_puzzle_border - 2 * $burr_inset])

This will provide a little more freedom of movement under the cap.

cube([
interior_dim.x + $burr_inset * 2,
interior_dim.y + $burr_inset * 2,
interior_dim.z + $burr_inset * 2]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you adopt the last suggestion, you'll want to enlarge the z axis here by a tiny amount:

interior_dim.z + $burr_inset * 2 + 0.001

this helps prevent rendering errors that can happen when two faces are exactly coincident in a difference() operation.

}
translate([mid, mid, dim.z]) cylinder(r = 2.2, h = 2, $fn = 32);
translate([mid, far, dim.z]) cylinder(r = 2.2, h = 2, $fn = 32);
translate([far2, far, dim.z]) cylinder(r = 2.2, h = 2, $fn = 32);
translate([far2, mid, dim.z]) cylinder(r = 2.2, h = 2, $fn = 32);

}

module cap() {
render(convexity = 2)
translate([0,0,dim.z])
difference() {
beveled_cube([dim.x, dim.y, box_puzzle_border]);
//first cutout removal
translate([box_puzzle_border+.5*box_puzzle_scale-$burr_inset,box_puzzle_border - $burr_inset,0])
cube([box_puzzle_scale*3+ $burr_inset * 2,box_puzzle_scale*2 + $burr_inset * 2,,box_puzzle_border]);
// second cutout removal
translate([box_puzzle_border+1.5*box_puzzle_scale-$burr_inset,box_puzzle_border-$burr_inset +2*box_puzzle_scale,0])
cube([box_puzzle_scale+2*$burr_inset,box_puzzle_scale+2*$burr_inset,box_puzzle_border]);
Comment on lines +46 to +54
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code style: for readability, best to put spaces after commas and between arithmetic operators, e.g.

5, x + y

rather than

5,x+y


// now remove the pins
translate([mid, mid, 0]) cylinder(r = 2.4, h = 2.15, $fn = 32);
translate([mid, far, 0]) cylinder(r = 2.4, h = 2.15, $fn = 32);
translate([far2, far, 0]) cylinder(r = 2.4, h = 2.15, $fn = 32);
translate([far2, mid, 0]) cylinder(r = 2.4, h = 2.15, $fn = 32);
}// end of main difference


}