From c56a7dd8844923dd1768ce53602487359ea72946 Mon Sep 17 00:00:00 2001 From: Cory Cross Date: Mon, 11 Aug 2025 08:22:58 -0700 Subject: [PATCH 1/2] Add error message with solution to skin Maybe you're refactoring a bunch of nested arguments to skin and forget the first argument is supposed to be a list and you wasted an embarrassing amount of time figuring it out :) In this case, the error message changes from Profiles [0, 1, 2, 3, 4, 5, 6, 7, 8] are not a paths or have length less than 3. to The first argument to `skin` must be a list of paths --- skin.scad | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skin.scad b/skin.scad index 332fde06..9b5991f1 100644 --- a/skin.scad +++ b/skin.scad @@ -412,6 +412,8 @@ function skin(profiles, slices, refine=1, method="direct", sampling, caps, close assert(in_list(atype, _ANCHOR_TYPES), "\nAnchor type must be \"hull\" or \"intersect\".") assert(is_def(slices),"\nThe slices argument must be specified.") assert(is_list(profiles) && len(profiles)>1, "\nMust provide at least two profiles.") + // If the user forgets the first element should be a list, the other messages aren't as precisely helpful + assert(is_list(profiles)&&is_list(profiles[0])&&is_list(profiles[0][0]), "\nThe first argument to `skin` must be a list of paths") let( profiles = [for(p=profiles) if (is_region(p) && len(p)==1) p[0] else p] ) From 96d4d6f211efa3f65b34de62f9fe9cfa65dafeaf Mon Sep 17 00:00:00 2001 From: Cory Cross Date: Tue, 12 Aug 2025 10:24:13 -0700 Subject: [PATCH 2/2] Simplify two is_list calls for one is_path This also checks the coordinates are all finite numbers, but that still matches the mentioned assertion. --- skin.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skin.scad b/skin.scad index 9b5991f1..b6344ca6 100644 --- a/skin.scad +++ b/skin.scad @@ -413,7 +413,7 @@ function skin(profiles, slices, refine=1, method="direct", sampling, caps, close assert(is_def(slices),"\nThe slices argument must be specified.") assert(is_list(profiles) && len(profiles)>1, "\nMust provide at least two profiles.") // If the user forgets the first element should be a list, the other messages aren't as precisely helpful - assert(is_list(profiles)&&is_list(profiles[0])&&is_list(profiles[0][0]), "\nThe first argument to `skin` must be a list of paths") + assert(is_list(profiles)&&is_path(profiles[0]), "\nThe first argument to `skin` must be a list of paths") let( profiles = [for(p=profiles) if (is_region(p) && len(p)==1) p[0] else p] )