From 24727457074c4bb78416e7c67328c13427b00467 Mon Sep 17 00:00:00 2001 From: Quinn Date: Fri, 7 Jan 2022 22:27:14 -0800 Subject: [PATCH] Add octn poly --- poly_gates.scad | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/poly_gates.scad b/poly_gates.scad index a4f10f2..e9f1f84 100644 --- a/poly_gates.scad +++ b/poly_gates.scad @@ -20,6 +20,17 @@ oct_poly = let(corner = 1 / sqrt(2))[ [corner, -corner], ]; +octn_poly = let(corner = 1 / sqrt(2 / 1.2))[ + [1,0], + [corner, corner], + [0,1], + [-corner, corner], + [-1,0], + [-corner, -corner], + [0,-1], + [corner, -corner], +]; + 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); @@ -40,7 +51,7 @@ module shape_gate (shape, throw, shaft_r, sharpness = 1) { echo(throw_points(sq_poly, 15)); echo(throw_faces(throw_points(sq_poly, 15))); -points = throw_points(oct_poly, 15); +points = throw_points(octn_poly, 15); faces = throw_faces(points); minkowski() {