1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/examples/taiji.scad

84 lines
2.0 KiB
OpenSCAD
Raw Normal View History

2022-06-06 13:11:46 +08:00
use <arc.scad>
2019-11-22 17:04:54 +08:00
radius = 30;
thickness = 2.5;
spacing = 0.4;
fn = 48;
style = "SOLID"; // [SOLID, HOLLOW]
2019-11-22 20:06:53 +08:00
module half_taiji(radius, thickness, spacing, fn, style) {
2019-11-22 17:04:54 +08:00
$fn = fn;
half_spacing = spacing / 2;
big_cone_offset = half_spacing * 1.414213;
small_cone_offset = spacing / sin(atan(0.25));
module ball() {
if(style == "HOLLOW") {
rotate_extrude()
arc(
radius = radius,
angle = [-90, 90],
width = thickness,
width_mode = "LINE_INWARD"
);
}
else {
sphere(radius);
}
}
module cone(br, offset) {
translate([0, 0, -radius - offset])
linear_extrude(radius, scale = 0)
circle(br);
}
module c_shell() {
intersection() {
ball();
union() {
rotate_extrude(angle = 180)
polygon([
[big_cone_offset, 0],
[radius, -radius + big_cone_offset],
[radius, radius - big_cone_offset],
]);
rotate([0, 90, 0]) cone(radius, big_cone_offset);
rotate([0, -90, 0]) cone(radius, big_cone_offset);
}
}
}
module dot_df() {
intersection() {
ball();
union() {
rotate([0, 90, 0]) cone(radius / 4, 0);
rotate([0, -90, 0]) cone(radius / 4, 0);
}
}
}
difference() {
c_shell();
dot_df();
}
intersection() {
ball();
union() {
rotate([0, 90, 0]) cone(radius / 4, small_cone_offset);
rotate([0, -90, 0]) cone(radius/ 4, small_cone_offset);
}
}
}
rotate([0, 90, 180])
2019-11-22 20:06:53 +08:00
half_taiji(radius, thickness, spacing, fn, style);
2019-11-22 17:04:54 +08:00
2019-11-22 20:06:53 +08:00
half_taiji(radius, thickness, spacing, fn, style);