From 07f774767a6da337621a78d2a2185f7e695d23c3 Mon Sep 17 00:00:00 2001 From: Quinn Date: Fri, 7 Jan 2022 20:09:00 -0800 Subject: [PATCH] Start setting up helpers for poly gates --- poly_gates.scad | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 poly_gates.scad diff --git a/poly_gates.scad b/poly_gates.scad new file mode 100644 index 0000000..0ab1a20 --- /dev/null +++ b/poly_gates.scad @@ -0,0 +1,22 @@ +gate_height = 50; + +sq_poly = [ + [sqrt(2), sqrt(2)], + [-sqrt(2), sqrt(2)], + [-sqrt(2), -sqrt(2)], + [sqrt(2), -sqrt(2)] +]; + +function scale_xy_z(m, xy, z) = [ for (i = [0 : len(m) - 1]) [m[i].x * xy, m[i].y * xy, z]]; + +function throw_end(throw) = gate_height * tan(throw); + +function throw_points(shape, throw) = concat([[0,0,0]],scale_xy_z(shape, throw_end(throw), gate_height)); + +module shape_gate (shape, throw, shaft_r, sharpness = 1) { + +} + +//echo(concat([[0,0,0]],scale_xy_z(sq_poly, 3, 3))); + +echo(throw_points(sq_poly, 15));