From 4f3baccec7c4567939b0e037fbef10f45b8198ab Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 22 Sep 2020 00:21:12 -0700 Subject: [PATCH] Added corner_edges() --- edges.scad | 10 ++++++++++ version.scad | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/edges.scad b/edges.scad index 2027151..a81c591 100644 --- a/edges.scad +++ b/edges.scad @@ -385,6 +385,16 @@ CORNER_OFFSETS = [ // Array of XYZ offsets to each corner. ]; +// Function: corner_edges() +// Description: +// Returns [XCOUNT,YCOUNT,ZCOUNT] where each is the count of edges aligned with that axis that are in the edge set and touch the given corner. +// Arguments: +// edges = Standard edges array. +// v = Vector pointing to the corner to count edge intersections at. +function corner_edges(edges, v) = + let(u = (v+[1,1,1])/2) [edges[0][u.y+u.z*2], edges[1][u.x+u.z*2], edges[2][u.x+u.y*2]]; + + // Function: corner_edge_count() // Description: Counts how many given edges intersect at a specific corner. // Arguments: diff --git a/version.scad b/version.scad index e4af507..62e21cf 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,422]; +BOSL_VERSION = [2,0,423]; // Section: BOSL Library Version Functions