1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 01:34:12 +02:00

optimization

This commit is contained in:
Justin Lin
2022-05-14 17:20:53 +08:00
parent eb901f5bba
commit 0fd3841ecc

View File

@@ -45,9 +45,10 @@ module sf_thicken(points, thickness, direction = "BOTH", convexity = 1) {
leng_points = len(points); leng_points = len(points);
leng_point0 = len(points[0]); leng_point0 = len(points[0]);
x_range = [0:leng_point0 - 1];
if(is_list(direction)) { if(is_list(direction)) {
dir_v = direction / norm(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 * [ surface_another = points + thickness * [
for(y = [0:leng_points - 1]) for(y = [0:leng_points - 1])
dir_vs dir_vs
@@ -67,7 +68,7 @@ module sf_thicken(points, thickness, direction = "BOTH", convexity = 1) {
else { else {
vertex_normals = [ vertex_normals = [
for(y = [0:leng_points - 1]) 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") { if(direction == "BOTH") {