1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 14:56:47 +02:00
This commit is contained in:
Justin Lin
2019-09-26 08:53:47 +08:00
parent ea0fee1148
commit e4ac6dcb98
35 changed files with 500 additions and 456 deletions

View File

@@ -20,8 +20,12 @@ module bearing_captured_in_mobius_cut(ball_radius, mobius_radius, ring_radius, s
circle_points = [for(p = circle_path(ball_track_radius)) p + trans_pt]; circle_points = [for(p = circle_path(ball_track_radius)) p + trans_pt];
difference() { difference() {
rotate_extrude() translate([ring_radius, 0, 0]) circle(mobius_radius); rotate_extrude()
translate([ring_radius, 0, 0])
circle(mobius_radius);
ring_extrude(circle_points, radius = ring_radius, twist = 180); ring_extrude(circle_points, radius = ring_radius, twist = 180);
rotate([180, 0, 0]) rotate([180, 0, 0])
ring_extrude(circle_points, radius = ring_radius, twist = 180); ring_extrude(circle_points, radius = ring_radius, twist = 180);
} }

View File

@@ -136,7 +136,9 @@ module blocks(points) {
module cactus(w) { module cactus(w) {
linear_extrude(w * 3) { linear_extrude(w * 3) {
translate([2 * w, w * 7]) scale(w) blocks( translate([2 * w, w * 7])
scale(w)
blocks(
px_polygon([ px_polygon([
[0, 2], [0, 2],
[3, 2], [3, 2],
@@ -150,7 +152,9 @@ module cactus(w) {
], filled = true) ], filled = true)
); );
translate([-2 * w, w * 5]) scale(w) blocks( translate([-2 * w, w * 5])
scale(w)
blocks(
px_polygon([ px_polygon([
[-1, 0], [-1, 0],
[-3, 0], [-3, 0],
@@ -164,7 +168,8 @@ module cactus(w) {
], filled = true) ], filled = true)
); );
scale(w) blocks( scale(w)
blocks(
px_polygon([ px_polygon([
[-2, 0], [-2, 0],
[2, 0], [2, 0],
@@ -182,14 +187,14 @@ module base(w, base_x_blocks, base_y_blocks) {
linear_extrude(w) { linear_extrude(w) {
translate([0, -w]) translate([0, -w])
square([base_x_blocks * w, base_y_blocks * w + 2 * w]); square([base_x_blocks * w, base_y_blocks * w + 2 * w]);
translate([0, base_y_blocks * w / 2]) scale(w) blocks(
px_circle(base_y_blocks / 2, filled = true) translate([0, base_y_blocks * w / 2])
); scale(w)
blocks(px_circle(base_y_blocks / 2, filled = true));
translate([base_x_blocks * w, base_y_blocks * w / 2]) translate([base_x_blocks * w, base_y_blocks * w / 2])
scale(w) blocks( scale(w)
px_circle(base_y_blocks / 2, filled = true) blocks(px_circle(base_y_blocks / 2, filled = true));
);
} }
} }
@@ -214,7 +219,8 @@ else if(part == "BASE") {
} }
else if(part == "DEMO") { else if(part == "DEMO") {
wd = 5; wd = 5;
translate([0, wd * 5.5, wd * 5]) rotate([90, 0, 0]) { translate([0, wd * 5.5, wd * 5])
rotate([90, 0, 0]) {
color("DimGray") chrome_dino(wd, true); color("DimGray") chrome_dino(wd, true);
color("white") color("white")
linear_extrude(wd * 5) linear_extrude(wd * 5)
@@ -223,18 +229,24 @@ else if(part == "DEMO") {
color("white") base(wd, 10, 6); color("white") base(wd, 10, 6);
translate([wd * 25, wd * 10, 0]) { translate([wd * 25, wd * 10, 0]) {
translate([wd * 4.25, wd * 4.25, 0]) color("SlateGray") rotate([90, 0, 0]) translate([wd * 4.25, wd * 4.25, 0])
color("SlateGray")
rotate([90, 0, 0])
cactus(wd); cactus(wd);
color("white") base(wd, 10, 6); color("white") base(wd, 10, 6);
} }
translate([-wd * 35, wd * 10, 0]) { translate([-wd * 35, wd * 10, 0]) {
color("SlateGray") { color("SlateGray") {
translate([wd * 4.25, wd * 4, 0]) rotate([90, 0, 0]) translate([wd * 4.25, wd * 4, 0])
mirror([1, 0, 0]) cactus(wd); rotate([90, 0, 0])
mirror([1, 0, 0])
cactus(wd);
scale(0.75) scale(0.75)
translate([wd * 30, wd * 5, 0]) rotate([90, 0, 0]) translate([wd * 30, wd * 5, 0])
rotate([90, 0, 0])
cactus(wd); cactus(wd);
} }
color("white") base(wd, 30, 6); color("white") base(wd, 30, 6);

View File

@@ -16,6 +16,7 @@ module floor_stand(width, height, thickness, spacing) {
translate([0, -half_h, 0]) translate([0, -half_h, 0])
difference() { difference() {
polygon(points); polygon(points);
translate([0, -half_h, 0]) translate([0, -half_h, 0])
scale([0.6, 0.1]) scale([0.6, 0.1])
polygon(points); polygon(points);
@@ -52,6 +53,7 @@ module floor_stand(width, height, thickness, spacing) {
board_base(); board_base();
square([width, height / 3], center = true); square([width, height / 3], center = true);
} }
translate([0, -height / 12 - spacing / 2, 0]) translate([0, -height / 12 - spacing / 2, 0])
difference() { difference() {
square([width / 1.5 - double_spacing, height / 6 + spacing], center = true); square([width / 1.5 - double_spacing, height / 6 + spacing], center = true);
@@ -68,7 +70,8 @@ module floor_stand(width, height, thickness, spacing) {
module border() { module border() {
translate([0, 0, half_th]) translate([0, 0, half_th])
color("black") linear_extrude(half_th / 2) color("black")
linear_extrude(half_th / 2)
hollow_out(shell_thickness = font_size / 4) hollow_out(shell_thickness = font_size / 4)
offset(half_w / 10) offset(half_w / 10)
scale([0.75, 0.675]) scale([0.75, 0.675])
@@ -87,8 +90,7 @@ module floor_stand(width, height, thickness, spacing) {
difference() { difference() {
union() { union() {
color("yellow") children(); color("yellow") children();
translate([0, -height / 1.8, 0]) translate([0, -height / 1.8, 0]) border();
border();
} }
// slot // slot
translate([0, -half_h - thickness, -half_th]) translate([0, -half_h - thickness, -half_th])

View File

@@ -17,11 +17,11 @@ cut = false; // [true,false]
module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) { module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
$fn = fn; $fn = fn;
half_thickness = thickness / 2;
module bottom() { module bottom() {
rotate(180) rotate_extrude() { rotate(180)
rotate_extrude() {
translate([radius1 + radius2, 0, 0]) translate([radius1 + radius2, 0, 0])
polyline2d( polyline2d(
arc_path(radius = radius2, angle = [180, 360]) arc_path(radius = radius2, angle = [180, 360])
@@ -54,7 +54,7 @@ module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
[0, radius1 * 4, bottom_height], [0, radius1 * 4, bottom_height],
[0, radius1 * 3, bottom_height - radius1], [0, radius1 * 3, bottom_height - radius1],
[0, radius1 * 2, bottom_height - radius1 * 2], [0, radius1 * 2, bottom_height - radius1 * 2],
[0, radius1, bottom_height + thickness / 2 - radius1 * 3], [0, radius1, bottom_height + half_thickness - radius1 * 3],
[0, 0, bottom_height - radius1 * 4], [0, 0, bottom_height - radius1 * 4],
[0, 0, bottom_height - radius1 * 5] [0, 0, bottom_height - radius1 * 5]
]; ];
@@ -80,13 +80,13 @@ module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
bottom(); bottom();
path_extrude( path_extrude(
circle_path(radius1 + thickness / 2), circle_path(radius1 + half_thickness),
tube_path tube_path
); );
} }
path_extrude( path_extrude(
circle_path(radius1 - thickness / 2), circle_path(radius1 - half_thickness),
tube_path2 tube_path2
); );
} }

View File

@@ -26,6 +26,7 @@ module build_ramp_maze(rows, columns, blocks, block_width, wall_thickness, wall_
translate(point1) translate(point1)
linear_extrude(height, scale = top_scale) linear_extrude(height, scale = top_scale)
square(width, center = true); square(width, center = true);
translate(point2) translate(point2)
linear_extrude(height, scale = top_scale) linear_extrude(height, scale = top_scale)
square(width, center = true); square(width, center = true);

View File

@@ -30,6 +30,7 @@ module pyramid_maze(maze_rows, block_width, wall_thickness) {
block_width, block_width,
wall_thickness wall_thickness
); );
pyramid(leng + wall_thickness); pyramid(leng + wall_thickness);
} }
} }

View File

@@ -23,7 +23,8 @@ module clock(r, thickness, hour, minute) {
line2d([0, 0], [0, r - thickness * 3], thickness * 0.75, p1Style = "CAP_ROUND", p2Style = "CAP_ROUND", $fn = 4); line2d([0, 0], [0, r - thickness * 3], thickness * 0.75, p1Style = "CAP_ROUND", p2Style = "CAP_ROUND", $fn = 4);
for(i = [0: 11]) { for(i = [0: 11]) {
rotate(i * 30) translate([0, r - thickness * 4, 0]) rotate(i * 30)
translate([0, r - thickness * 4, 0])
square([thickness / 2, thickness * 2]); square([thickness / 2, thickness * 2]);
} }
} }
@@ -58,11 +59,12 @@ module melted_clock() {
mirror([1, 0, 0]) { mirror([1, 0, 0]) {
color("Gold") color("Gold")
translate([0, 0, thickness]) translate([0, 0, thickness])
melt(r, thickness, angle, frags, xscale) circle(r); melt(r, thickness, angle, frags, xscale)
circle(r);
color("Gainsboro") melt(r, thickness, sa, frags, xscale) color("Gainsboro")
melt(r, thickness, sa, frags, xscale)
clock(r - thickness * 2, thickness, hour, minute); clock(r - thickness * 2, thickness, hour, minute);
;
} }
} }

View File

@@ -55,8 +55,7 @@ module puzzle_piece_with_text(side_length, text, spacing) {
puzzle_piece(side_length, spacing); puzzle_piece(side_length, spacing);
translate([half_side_length, half_side_length]) translate([half_side_length, half_side_length])
rotate(-45) rotate(-45)
text(text, size = side_length / 3, text(text, size = side_length / 3, halign = "center", valign = "center");
halign = "center", valign = "center");
} }
} }

View File

@@ -52,10 +52,12 @@ function packing_circles(size, min_radius, max_radius, total_circles, attempts =
circles = packing_circles(size, min_radius, max_radius, total_circles); circles = packing_circles(size, min_radius, max_radius, total_circles);
mr = max([for(c = circles) c[2]]); mr = max([for(c = circles) c[2]]);
translate([0, 0, mr]) for(c = circles) { translate([0, 0, mr])
for(c = circles) {
translate([c[0], c[1]]) translate([c[0], c[1]])
sphere(c[2], $fn = 48); sphere(c[2], $fn = 48);
} }
for(c = circles) { for(c = circles) {
translate([c[0], c[1]]) translate([c[0], c[1]])
linear_extrude(mr) linear_extrude(mr)

View File

@@ -23,22 +23,20 @@ module pixel_vase(x1, x2, x3, thickness) {
leng = len(px_path); leng = len(px_path);
for(p = px_cylinder(px_path[0][0], 1, true)) { for(p = px_cylinder(px_path[0][0], 1, true)) {
linear_extrude(1) union() { linear_extrude(1)
translate([p[0], p[1]]) translate([p[0], p[1]])
square(1.1, center = true); square(1.1, center = true);
} }
}
for(i = [0:leng - 1]) { for(i = [0:leng - 1]) {
r = px_path[i][0]; r = px_path[i][0];
for(p = px_cylinder(r, 1, thickness = thickness)) { for(p = px_cylinder(r, 1, thickness = thickness)) {
translate([0, 0, i]) translate([0, 0, i])
linear_extrude(1) union() { linear_extrude(1)
translate([p[0], p[1]]) translate([p[0], p[1]])
square(1.1, center = true); square(1.1, center = true);
} }
} }
} }
}
pixel_vase(x1, x2, x3, thickness); pixel_vase(x1, x2, x3, thickness);

View File

@@ -7,7 +7,8 @@ tx = "3.141592653589793238462643383279502884197169399375105820974944592307816406
pts = [for(p = px_spiral(1, floor(sqrt(len(tx))) + 1)) p * 8]; pts = [for(p = px_spiral(1, floor(sqrt(len(tx))) + 1)) p * 8];
linear_extrude(2) linear_extrude(2)
for(i = [0:len(tx) - 1]) { for(i = [0:len(tx) - 1]) {
translate(pts[i]) difference() { translate(pts[i])
difference() {
square(7, center = true); square(7, center = true);
render() for(p = px_ascii(tx[i], center = true)) { render() for(p = px_ascii(tx[i], center = true)) {
translate(p) square(.8); translate(p) square(.8);

View File

@@ -18,7 +18,8 @@ module qr_coder() {
rotate([0, 180, 0]) rotate([0, 180, 0])
translate([0, 0, -qr_thickness - head_size]) translate([0, 0, -qr_thickness - head_size])
linear_extrude(qr_thickness) linear_extrude(qr_thickness)
mirror([1, 0, 0]) qrcode(t, head_size * 0.9, encoding, min_error_correction_level, mask, center = true); mirror([1, 0, 0])
qrcode(t, head_size * 0.9, encoding, min_error_correction_level, mask, center = true);
cube_character(head_size); cube_character(head_size);
} }
@@ -49,7 +50,8 @@ module cube_character(head_size) {
} }
difference() { difference() {
linear_extrude(body_size) union() { linear_extrude(body_size)
union() {
square(body_size, center = true); square(body_size, center = true);
// feet // feet
translate([0, -head_size * 0.4, 0]) translate([0, -head_size * 0.4, 0])

View File

@@ -54,17 +54,20 @@ module dog_back(head_r, peg_radius) {
$fn = 36; $fn = 36;
module foot() { module foot() {
translate([head_r, 0, 0]) union() { translate([head_r, 0, 0])
union() {
color("PapayaWhip") color("PapayaWhip")
ellipse_extrude(head_r / 3) polygon( ellipse_extrude(head_r / 3)
shape_ellipse([head_r / 3, head_r / 2]) polygon(shape_ellipse([head_r / 3, head_r / 2]));
);
color("Maroon") color("Maroon")
linear_extrude(head_r) circle(head_r / 8); linear_extrude(head_r)
circle(head_r / 8);
color("Goldenrod") translate([head_r / 45, 0, head_r / 2]) color("Goldenrod")
rotate([0, -15, 0]) rounded_cylinder( translate([head_r / 45, 0, head_r / 2])
rotate([0, -15, 0])
rounded_cylinder(
radius = [head_r / 5, head_r / 3.5], radius = [head_r / 5, head_r / 3.5],
h = head_r * 1.25, h = head_r * 1.25,
round_r = 2 round_r = 2
@@ -103,7 +106,8 @@ module dog_back(head_r, peg_radius) {
back(); back();
color("Goldenrod") translate([0, -head_r * 0.2, 0]) color("Goldenrod")
translate([0, -head_r * 0.2, 0])
rotate([90, 0, 0]) rotate([90, 0, 0])
connector_peg(peg_radius, spacing = spacing); connector_peg(peg_radius, spacing = spacing);
} }
@@ -176,8 +180,7 @@ module dog_front(head_r, peg_radius, spacing) {
translate([head_r / 2, -head_r / 1.75, head_r / 3]) translate([head_r / 2, -head_r / 1.75, head_r / 3])
rotate([-20, 5, 30]) rotate([-20, 5, 30])
scale([1.2, 0.5, 1]) { scale([1.2, 0.5, 1]) {
color("Goldenrod") color("Goldenrod") sphere(head_r / 3);
sphere(head_r / 3);
color("white") color("white")
translate([0, 0, -head_r / 15]) translate([0, 0, -head_r / 15])
@@ -242,17 +245,21 @@ module dog_front(head_r, peg_radius, spacing) {
module foot() { module foot() {
translate([head_r, -head_r / 11, 0]) union() { translate([head_r, -head_r / 11, 0]) {
color("PapayaWhip") color("PapayaWhip")
ellipse_extrude(head_r / 3) polygon( ellipse_extrude(head_r / 3)
polygon(
shape_ellipse([head_r / 3, head_r / 2]) shape_ellipse([head_r / 3, head_r / 2])
); );
color("Maroon") color("Maroon")
linear_extrude(head_r) circle(head_r / 8); linear_extrude(head_r)
circle(head_r / 8);
color("Goldenrod") color("Goldenrod")
translate([head_r / 45, 0, head_r / 2]) rotate([0, -15, 0]) rounded_cylinder( translate([head_r / 45, 0, head_r / 2])
rotate([0, -15, 0])
rounded_cylinder(
radius = [head_r / 5, head_r / 3.5], radius = [head_r / 5, head_r / 3.5],
h = head_r * 1.25, h = head_r * 1.25,
round_r = 2 round_r = 2
@@ -271,7 +278,8 @@ module dog_front(head_r, peg_radius, spacing) {
feet(); feet();
color("Goldenrod") color("Goldenrod")
scale([1, 1.25, 1]) difference() { scale([1, 1.25, 1])
difference() {
sphere(head_r); sphere(head_r);
translate([-head_r, head_r / 6, -head_r]) translate([-head_r, head_r / 6, -head_r])

View File

@@ -89,6 +89,7 @@ if(model == "Tetrahedron") {
rotate([0, 180, 0]) rotate([0, 180, 0])
translate([0, -leng / 2 * tan(30), 0]) translate([0, -leng / 2 * tan(30), 0])
string_tetrahedron(leng, thickness, segs_per_side, line_fn); string_tetrahedron(leng, thickness, segs_per_side, line_fn);
base(leng, thickness, line_fn); base(leng, thickness, line_fn);
} }

View File

@@ -34,6 +34,7 @@ module cargo_container_landmark() {
translate([cargo_height, 0, -cargo20ft_len]) translate([cargo_height, 0, -cargo20ft_len])
rotate([0, -90, 0]) rotate([0, -90, 0])
cargo20ft(); cargo20ft();
cargo40ft(); cargo40ft();
} }
@@ -43,6 +44,7 @@ module cargo_container_landmark() {
translate([cargo40ft_len + cargo_width, cargo_width - cargo20ft_len, 0]) translate([cargo40ft_len + cargo_width, cargo_width - cargo20ft_len, 0])
rotate(90) rotate(90)
cargo20ft(); cargo20ft();
translate([cargo20ft_len + cargo_width, -cargo20ft_len, 0]) translate([cargo20ft_len + cargo_width, -cargo20ft_len, 0])
cargo20ft(); cargo20ft();
@@ -54,6 +56,7 @@ module cargo_container_landmark() {
translate([cargo20ft_len, 0, cargo_height]) translate([cargo20ft_len, 0, cargo_height])
rotate([0, -90, 0]) rotate([0, -90, 0])
cargo40ft(); cargo40ft();
cargo20ft(); cargo20ft();
} }
@@ -86,6 +89,7 @@ module cargo_container(leng, width, height) {
step_x = leng / nums; step_x = leng / nums;
half_step_x = step_x * 0.5; half_step_x = step_x * 0.5;
points = [for(i = [0:nums - 1]) [-half_leng + i * step_x + half_step_x, 0]]; points = [for(i = [0:nums - 1]) [-half_leng + i * step_x + half_step_x, 0]];
along_with(points) along_with(points)
rotate([-90, 90, 0]) rotate([-90, 90, 0])
linear_extrude(thickness, scale = [0.7, 0.9], center = true) linear_extrude(thickness, scale = [0.7, 0.9], center = true)

View File

@@ -137,6 +137,7 @@ linear_extrude(1.5) difference() {
translate([6.5, -10]) translate([6.5, -10])
rotate(22.5) rotate(22.5)
polygon(shape_taiwan(250)); polygon(shape_taiwan(250));
render() for(dot = dots) { render() for(dot = dots) {
translate(dot[0]) translate(dot[0])
square(0.7 * dot[1]); square(0.7 * dot[1]);

View File

@@ -36,6 +36,7 @@ module spiral_cube(leng, leng_diff, min_leng) {
spiral_stack(leng) spiral_stack(leng)
translate([0, 0, thickness / 2]) translate([0, 0, thickness / 2])
cube([leng , leng, thickness], center = true); cube([leng , leng, thickness], center = true);
translate([0, 0, 0.001]) translate([0, 0, 0.001])
linear_extrude(leng) linear_extrude(leng)
square(leng, center = true); square(leng, center = true);
@@ -66,6 +67,7 @@ module base(leng) {
difference() { difference() {
difference() { difference() {
sphere(r); sphere(r);
translate([0, 0, -r]) translate([0, 0, -r])
linear_extrude(r) linear_extrude(r)
square(r * 2, center = true); square(r * 2, center = true);

View File

@@ -21,6 +21,7 @@ module text_container(t, font_size, font_name, r_round_edge, container_height, t
difference() { difference() {
linear_extrude(container_height) linear_extrude(container_height)
minkowski_text(t, font_size, font_name, r_round_edge); minkowski_text(t, font_size, font_name, r_round_edge);
translate([0, 0, thickness]) translate([0, 0, thickness])
linear_extrude(container_height - thickness) linear_extrude(container_height - thickness)
offset(r = -thickness) offset(r = -thickness)
@@ -34,7 +35,8 @@ module text_lid(t, font_size, font_name, r_round_edge, container_height, lid_hei
offset(r = spacing + thickness) offset(r = spacing + thickness)
minkowski_text(t, font_size, font_name, r_round_edge); minkowski_text(t, font_size, font_name, r_round_edge);
linear_extrude(lid_height) difference() { linear_extrude(lid_height)
difference() {
offset(r = spacing + thickness) offset(r = spacing + thickness)
minkowski_text(t, font_size, font_name, r_round_edge); minkowski_text(t, font_size, font_name, r_round_edge);
offset(r = spacing) offset(r = spacing)

View File

@@ -26,7 +26,8 @@ module text_sphere(tx, font_name, thickness) {
end_angle = end_angle end_angle = end_angle
); );
rotate(-180 / $fn) sphere_spiral_extrude( rotate(-180 / $fn)
sphere_spiral_extrude(
[ [
[thickness, half_thickness], [thickness, half_thickness],
[-half_thickness, half_thickness], [-half_thickness, half_thickness],
@@ -43,7 +44,8 @@ module text_sphere(tx, font_name, thickness) {
for(i = [0:len(points_angles) - 1]) { for(i = [0:len(points_angles) - 1]) {
pa = points_angles[i]; pa = points_angles[i];
translate(pa[0]) rotate(pa[1] + [0, 8, 0]) translate(pa[0])
rotate(pa[1] + [0, 8, 0])
rotate([90, 0, 90]) rotate([90, 0, 90])
linear_extrude(half_thickness) linear_extrude(half_thickness)
translate([0, -10, 0]) translate([0, -10, 0])

View File

@@ -53,6 +53,7 @@ module text_tower(tx, font_name, radius, height, thickness) {
translate([0, 0, -font_size - half_thickness]) translate([0, 0, -font_size - half_thickness])
body(); body();
rotate(-half_angle_step) rotate(-half_angle_step)
translate([0, 0, -font_size - thickness]) translate([0, 0, -font_size - thickness])
cylinder(h = font_size, r = radius + thickness); cylinder(h = font_size, r = radius + thickness);

View File

@@ -54,7 +54,10 @@ module triangle2square_box(type, tri_side_leng, height, spacing, ring_width, sha
box_extrude(height = ring_width * 2, shell_thickness = ring_width) box_extrude(height = ring_width * 2, shell_thickness = ring_width)
mirror([1, 0, 0]) mirror([1, 0, 0])
offset(-ring_width - spacing) 2d_tri_square(); offset(-ring_width - spacing) 2d_tri_square();
linear_extrude(ring_width) mirror([1, 0, 0]) 2d_tri_square();
linear_extrude(ring_width)
mirror([1, 0, 0])
2d_tri_square();
} }
} }

View File

@@ -59,7 +59,7 @@ module heart(radius, center = false) {
$fn = 48; $fn = 48;
translate([-radius * cos45, 0, 0]) translate([-radius * cos45, 0, 0])
rotate(-45) union() { rotate(-45) {
circle(radius); circle(radius);
translate([0, -radius, 0]) translate([0, -radius, 0])
square(diameter); square(diameter);
@@ -70,7 +70,7 @@ module heart(radius, center = false) {
offsetX = center ? 0 : radius + radius * cos(45); offsetX = center ? 0 : radius + radius * cos(45);
offsetY = center ? 1.5 * radius * sin45 - 0.5 * radius : 3 * radius * sin45; offsetY = center ? 1.5 * radius * sin45 - 0.5 * radius : 3 * radius * sin45;
translate([offsetX, offsetY, 0]) union() { translate([offsetX, offsetY, 0]) {
heart_sub_component(radius); heart_sub_component(radius);
mirror([1, 0, 0]) heart_sub_component(radius); mirror([1, 0, 0]) heart_sub_component(radius);
} }
@@ -85,7 +85,8 @@ if(shape == "Flower") {
} }
} }
} else if(shape == "Circle") { } else if(shape == "Circle") {
twist_bottle(model, height, thickness, twist, spacing, slices) difference() { twist_bottle(model, height, thickness, twist, spacing, slices)
difference() {
circle(radius); circle(radius);
union() { union() {
for(a = [0:120:240]) { for(a = [0:120:240]) {

View File

@@ -41,13 +41,10 @@ module vampire_pen_holder() {
rotate(-135) rotate(-135)
bend_extrude(size = [80, 20], thickness = thickness, angle = 90) bend_extrude(size = [80, 20], thickness = thickness, angle = 90)
translate([40, 10]) translate([40, 10]) {
union() {
polygon(glasses_path); polygon(glasses_path);
mirror([1, 0, 0]) polygon(glasses_path); mirror([1, 0, 0]) polygon(glasses_path);
} }
} }
module cloak() { module cloak() {

View File

@@ -61,9 +61,6 @@ module voronoi_vase(r, h, thickness, num_of_pts, fn, profile_step) {
linear_extrude(thickness) linear_extrude(thickness)
hollow_out(thickness) hollow_out(thickness)
polygon([for(pt = sections[last_section_i]) [pt[0], pt[1]]]); polygon([for(pt = sections[last_section_i]) [pt[0], pt[1]]]);
} }
voronoi_vase(r, h, thickness, num_of_pts, fn, profile_step); voronoi_vase(r, h, thickness, num_of_pts, fn, profile_step);

View File

@@ -47,7 +47,8 @@ module wall(radius, height, thickness) {
union() { union() {
for(i = [0:7]) { for(i = [0:7]) {
rotate(22.5 + i * 45) rotate(22.5 + i * 45)
translate([-ro, 0]) rotate(-22.5) { translate([-ro, 0])
rotate(-22.5) {
bk(); bk();
rotate(45) bk(); rotate(45) bk();
} }