From 0fd3841ecc9e2f6cf67facd83785989c0de48be5 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sat, 14 May 2022 17:20:53 +0800 Subject: [PATCH] optimization --- src/surface/sf_thicken.scad | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/surface/sf_thicken.scad b/src/surface/sf_thicken.scad index a468ac05..00029a89 100644 --- a/src/surface/sf_thicken.scad +++ b/src/surface/sf_thicken.scad @@ -45,9 +45,10 @@ module sf_thicken(points, thickness, direction = "BOTH", convexity = 1) { leng_points = len(points); leng_point0 = len(points[0]); + x_range = [0:leng_point0 - 1]; if(is_list(direction)) { dir_v = direction / norm(direction); - dir_vs = [for(x = [0:leng_point0 - 1]) dir_v]; + dir_vs = [for(x = x_range) dir_v]; surface_another = points + thickness * [ for(y = [0:leng_points - 1]) dir_vs @@ -67,7 +68,7 @@ module sf_thicken(points, thickness, direction = "BOTH", convexity = 1) { else { vertex_normals = [ for(y = [0:leng_points - 1]) - vertex_normal_xs(points, [0:leng_point0 - 1], y) + vertex_normal_xs(points, x_range, y) ]; if(direction == "BOTH") {