mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-31 02:10:28 +02:00
use box_extrude to refactor
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
include <hollow_out.scad>;
|
include <box_extrude.scad>;
|
||||||
|
|
||||||
/* [Basic] */
|
/* [Basic] */
|
||||||
|
|
||||||
@@ -15,38 +15,29 @@ twist = 180;
|
|||||||
|
|
||||||
slices = 200;
|
slices = 200;
|
||||||
|
|
||||||
module twist_bottle(model, height, thickness, twist, spacing, convexity, slices) {
|
module twist_bottle(model, height, thickness, twist, spacing, slices) {
|
||||||
$fn = 48;
|
$fn = 48;
|
||||||
|
|
||||||
module outer_container() {
|
module bottle() {
|
||||||
translate([0, 0, thickness])
|
box_extrude(height = height + thickness, shell_thickness = thickness, twist = twist, slices = slices)
|
||||||
linear_extrude(height = height, twist = twist, slices = slices)
|
children();
|
||||||
hollow_out(thickness) children();
|
|
||||||
|
|
||||||
linear_extrude(thickness)
|
|
||||||
children();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module inner_container() {
|
module inner_container() {
|
||||||
linear_extrude(height = height, twist = twist, slices = slices)
|
bottle()
|
||||||
hollow_out(thickness)
|
offset(r = -thickness - spacing)
|
||||||
offset(r = -thickness - spacing)
|
children();
|
||||||
children();
|
|
||||||
|
|
||||||
translate([0, 0, height])
|
|
||||||
rotate(twist)
|
|
||||||
linear_extrude(thickness)
|
linear_extrude(thickness)
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(model == "Outer") {
|
if(model == "Outer") {
|
||||||
outer_container()
|
bottle()
|
||||||
children();
|
children();
|
||||||
} else if(model == "Inner") {
|
} else if(model == "Inner") {
|
||||||
translate([0, 0, height + thickness])
|
|
||||||
rotate([180, 0, 0])
|
|
||||||
inner_container()
|
inner_container()
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +68,8 @@ module heart(radius, center = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(shape == "Flower") {
|
if(shape == "Flower") {
|
||||||
twist_bottle(model, height, thickness, twist, spacing, slices) union() {
|
twist_bottle(model, height, thickness, twist, spacing, slices)
|
||||||
|
union() {
|
||||||
for(i = [0:3]) {
|
for(i = [0:3]) {
|
||||||
rotate(90 * i)
|
rotate(90 * i)
|
||||||
translate([radius * 0.5, 0, 0])
|
translate([radius * 0.5, 0, 0])
|
||||||
|
Reference in New Issue
Block a user