From 3719378f492fdb2bdc937b4a2dc1107ce101de51 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Thu, 18 Jul 2019 21:27:57 -0400 Subject: [PATCH] Changed make_path_valid to check_and_fix_path --- geometry.scad | 8 ++++++-- rounding.scad | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/geometry.scad b/geometry.scad index 7214de5..a61619f 100644 --- a/geometry.scad +++ b/geometry.scad @@ -702,13 +702,17 @@ function is_region(x) = is_list(x) && is_path(x.x); // Closes all paths within a given region. function close_region(region, eps=EPSILON) = [for (path=region) close_path(path, eps=eps)]; -// Function: make_path_valid() +// Function: check_and_fix_path() // Usage: // make_path_valid(path, [valid_dim], [closed]) // Description: // Checks that the input is a path. If it is a region with one component, converts it to a path. // valid_dim specfies the allowed dimension of the points in the path. -// If the path is closed, removed duplicate endpoint if present. +// If the path is closed, removed duplicate endpoint if present. +// Arguments: +// path = path to process +// valid_dim = list of allowed dimensions for the points in the path, e.g. [2,3] to require 2 or 3 dimensional input. If left undefined do not perform this check. Default: undef +// closed = set to true if the path is closed, which enables a check for endpoint duplication function make_path_valid(path,valid_dim=undef,closed=false) = let( path = is_region(path) ? assert(len(path)==1,"Region supplied as path does not have exactly one component") diff --git a/rounding.scad b/rounding.scad index 6a344ec..008f76c 100644 --- a/rounding.scad +++ b/rounding.scad @@ -589,7 +589,7 @@ module rounded_sweep(path, height, top=[], bottom=[], offset="round", r=0, steps ["points", []], ]; - path = make_path_valid(path, [2], closed=true); + path = check_and_fix_path(path, [2], closed=true); top = struct_set(argspec, top, grow=false); bottom = struct_set(argspec, bottom, grow=false);