include <BOSL2/std.scad>
include <BOSL2/turtle3d.scad>
include <BOSL2/beziers.scad>
use <smooth_skin.scad>
previewEpsilon = 0.01;//$render ? 0 : 0.01;
translate([200, 0, 0])
//back_half()
difference() {
skin(
smooth_profiles(
subdivide_and_slice([
path3d(circle(r=40)),
path3d(circle(r=50)),
path3d(circle(r=40)),
], 0),
steps=10,
transforms=[
up(0 - previewEpsilon),
up(20),
//up(35),
up(40 + previewEpsilon),
],
speeds=[
"fastslow",
//"linear",
"slowfast",
],
),
method="fast_distance",
slices=0
);
skin(
smooth_profiles(
subdivide_and_slice([
path3d(circle(r=30)),
path3d(circle(r=20)),
path3d(circle(r=20)),
path3d(circle(r=30)),
//path3d(circle(5, $fn=3)),
], 0),
steps=10,
transforms=[
up(0 - previewEpsilon),
up(5),
up(35),
up(40 + previewEpsilon),
],
speeds=[
"fastslow",
"linear",
"slowfast",
"fastfast",
// "slowfast",
],
),
method="fast_distance",
slices=0
);
}Another:
include <BOSL2/std.scad>
include <BOSL2/structs.scad>
include <BOSL2/rounding.scad>
id=14;
od=20;
or=od/2;
leg_length=30;
thickness=6;
hole_round_r=1;
center=[or, leg_length - or];
holefront=center - [0, id/2];
echo(arc(width=od, thickness=od/2));
//circle(d=od, anchor=FRONT) {
// attach(CENTER)
// square([od, leg_length - od / 2], anchor=BACK);
//}
function hull_polys(pts) =
[for (i=hull(pts)) pts[i]];
function plate(insets=0, hole=false) =
let (radius=or - insets)
hole
? apply(
translate(center),
// circle(id / 2 + insets)
teardrop2d(id / 2 + insets)
)
:
// struct_set([], [
// "path",
round_corners(
hull_polys(concat(
apply(translate(center), teardrop2d(d=od - 2*insets)),
//teardrop2d(d=od - 2*insets),
apply(translate([od/2, 0]), arc(10, width=od, thickness=od/2)),
//square([od, or/10]),
//apply(translate([insets, 0, 0]), square([od - 2 * insets, leg_length - or])),
))
, radius=2
)
;
// turtle([
// "move", od - insets,
// "left",
// "move", center.y,
// "arcsteps", 20,
// "arcleft", radius, 180,
// "move", center.y,
// ]),
// ]);
//function geom_get_path(geom) =
// struct_val(geom, "path");
//function geom_get_attachment(geom, name) =
// struct_val(struct_val(geom, "attachments"), name);
use <smooth_skin.scad>
previewEpsilon = 0.1;//$render ? 0 : 0.01;
//translate([0, 0, 0])
module hole()
//back_half()
top_half()
mirror([0, 1, 0]) {
*skin(
smooth_profiles(
subdivide_and_slice([
path3d(apply(translate([-od/2, -thickness]), square([od, thickness]))),
path3d(apply(translate([-od, -3*thickness]), square([2*od, 3*thickness]))),
], 0),
steps=10,
transforms=[
xrot(-45),
up(0),
],
transitions=[
"slowfast",
],
),
method="distance",
slices=0
);
xrot(45) translate(-holefront)
// translate(-geom_get_attachment(plate(0), "holefront"))
difference() {
skin(
smooth_profiles(
subdivide_and_slice([
path3d(plate(2)),
path3d(plate(0)),
path3d(plate(2)),
], 0),
steps=10,
transforms=[
up(0 - previewEpsilon),
up(thickness / 2),
up(thickness + previewEpsilon),
],
transitions=[
"fastslow",
//"linear",
"slowfast",
],
),
method="distance",
slices=0
);
skin(
smooth_profiles(
subdivide_and_slice([
path3d(plate(2, hole=true)),
path3d(plate(0, hole=true)),
path3d(plate(0, hole=true)),
path3d(plate(2, hole=true)),
], 0),
steps=10,
transforms=[
up(0 - previewEpsilon),
up(hole_round_r),
up(thickness - hole_round_r),
up(thickness + previewEpsilon),
],
transitions=[
"fastslow",
"linear",
"slowfast",
],
),
method="distance",
slices=0
);
*skin(
smooth_profiles(
subdivide_and_slice([
path3d(circle(r=30)),
path3d(circle(r=20)),
path3d(circle(r=20)),
path3d(circle(r=30)),
//path3d(circle(5, $fn=3)),
], 0),
steps=10,
transforms=[
up(0 - previewEpsilon),
up(5),
up(35),
up(40 + previewEpsilon),
],
transitions=[
"fastslow",
"linear",
"slowfast",
"fastfast",
// "slowfast",
],
),
method="fast_distance",
slices=10
);
}
}
module pole() {
mirror([0, 1, 0])
skin(
smooth_profiles(
subdivide_and_slice([
path3d(apply(translate([-plate_size/2, -plate_size]), square([plate_size, plate_size]))),
path3d(apply(translate([0, -pole_d/2]), circle(d=pole_d))),
path3d(apply(translate([0, -pole_d/2]), circle(d=pole_d))),
path3d(apply(translate([0, -pole_d*f/2]), circle(d=f*pole_d))),
path3d(apply(translate([0, -pole_d]), circle(d=pole_d))),
], 0),
steps=20,
transforms=[
up(0),
xrot(-45),
xrot(-45) * translate([0, 0, pole_len]),
xrot(-45) * translate([0, 0, pole_len + thickness / 2]),
xrot(-45) * translate([0, 0, pole_len + thickness]),
],
transitions=[
"fastslow",
"linear",
"slowslow",
"slowfast",
],
),
method="fast_distance",
slices=10
);
}
plate_size=40;
//cube([plate_size, plate_size, thickness], anchor=TOP+FRONT);
hole();
translate([0, plate_size, 0]) mirror([0, 1, 0]) pole();
translate([plate_size/2, plate_size/2, 0]) zrot(90) pole();
translate([-plate_size/2, plate_size/2, 0]) mirror([1, 0, 0]) zrot(90) hole();
plate_top=
path3d(
apply(
translate([0, plate_size/2]),
round_corners(
square(plate_size, center=true),
radius=2
)
)
);
skin(
smooth_profiles(
subdivide_and_slice([
plate_top,
path3d(
apply(
translate([0, plate_size/2]),
round_corners(
square(plate_size - 2, center=true),
radius=2
)
)
),
], 0),
steps=20,
transforms=[
down(thickness),
up(0),
],
transitions=[
"slowfast",
],
),
method="fast_distance",
slices=10
);
wiggle=4;
pole_d=id - wiggle;
pole_len=2*thickness;
f=1.5;
translate([0, -wiggle/2, 0])
mirror([0, 1, 0])
pole();


