7 changed files with 110 additions and 0 deletions
@ -0,0 +1,14 @@ |
|||
# An alveolar reinforcement |
|||
|
|||
This example shows how to reinforce the bottom of a box with an alveolar |
|||
structure. |
|||
|
|||
## Showcase |
|||
|
|||
A round box with reinforced bottom: |
|||
 |
|||
 |
|||
|
|||
A square box with reinforced bottom: |
|||
 |
|||
 |
|||
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 48 KiB |
@ -0,0 +1,44 @@ |
|||
use <../../pattern.scad> |
|||
|
|||
thickness = 0.5; |
|||
alveolus_size = 5; |
|||
xstep = cos(30) * (thickness + sqrt(3) * alveolus_size / 2); |
|||
ystep = sin(30) * (thickness + sqrt(3) * alveolus_size / 2); |
|||
xmove = [ 2 * xstep, 0 ]; |
|||
ymove = [ xstep, ystep ]; |
|||
reinforcement_height = 2; |
|||
height = 10; |
|||
|
|||
module reinforced_box(thickness, height, reinforcement_height) { |
|||
// Reinforce the bottom |
|||
difference() { |
|||
linear_extrude(height = reinforcement_height) |
|||
children(0); |
|||
translate([0,0, thickness]) |
|||
children(1); |
|||
} |
|||
|
|||
// Build the walls |
|||
linear_extrude(height = height) { |
|||
difference() { |
|||
children(0); |
|||
offset(-thickness) |
|||
children(0); |
|||
} |
|||
} |
|||
} |
|||
|
|||
// The first box has a square base |
|||
translate([100, 0]) |
|||
reinforced_box(thickness, height, reinforcement_height) { |
|||
square([40, 40], center=true); |
|||
spray_pattern([[-20,-20], [20, 20]], [ xmove, ymove]) |
|||
cylinder(d = alveolus_size, h = reinforcement_height, center = true, $fn = 6); |
|||
} |
|||
|
|||
// The second one has a circular base |
|||
reinforced_box(thickness, height, reinforcement_height) { |
|||
circle(d=40, center=true); |
|||
spray_pattern([[-20,-20], [20, 20]], [ xmove, ymove]) |
|||
cylinder(d = alveolus_size, h = reinforcement_height, center = true, $fn = 6); |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
/* |
|||
* Pattern spraying tutorial |
|||
* |
|||
* In this tutorial, we will spray the famous pattern of a football ball. |
|||
*/ |
|||
|
|||
// First, include the module |
|||
use <../../pattern.scad> |
|||
|
|||
// Define the base shape: an octogon and a square |
|||
// "r" is the radius of the circle defining the octogon |
|||
// The size and the position of the square is determined also from this value |
|||
module mypattern(r) { |
|||
// The octogon |
|||
rotate([0,0,22.5]) |
|||
circle(r=r, center=true, $fn=8); |
|||
|
|||
// The square |
|||
l = 2 * r * sin(22.5); |
|||
translate([r,r,0]) |
|||
rotate([0,0,45]) |
|||
square([l,l], center=true); |
|||
} |
|||
|
|||
// Instanciate the base shape, once. |
|||
r = 2; |
|||
mypattern(r); |
|||
|
|||
// Define our moves: how the pattern is sprayed |
|||
moves = [ |
|||
[ 2*r, 0], // For the first move, we will translate on x by two times the radius |
|||
[ 0, 2*r], // For the second move, we will translate on y by two times the radius |
|||
]; |
|||
|
|||
// Define the boundaries: the area to spray is defined by a rectangle |
|||
bounding_box = [ |
|||
[0,0], // Lower left corner |
|||
[20, 20] // upper right corner |
|||
]; |
|||
|
|||
// Spray our pattern in the bounding box |
|||
translate([-40, 0, 0]) |
|||
spray_pattern(bounding_box, moves) |
|||
mypattern(r); |
|||
|
|||
// Because we love clean edges, we cut the sprayed pattern at the bounding box size. |
|||
translate([20, 0, 0]) |
|||
intersection() { |
|||
spray_pattern(bounding_box, moves) |
|||
mypattern(r); |
|||
square(bounding_box[1] - bounding_box[0]); |
|||
} |
|||
Loading…
Reference in new issue