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

don't call ptf_xxx_twist when 0

This commit is contained in:
Justin Lin
2022-05-15 09:53:58 +08:00
parent 762c8b6859
commit fcf97a77e1

View File

@@ -19,23 +19,21 @@ module sf_square(levels, thickness, depth, x_twist = 0, y_twist = 0, invert = fa
surface = _sf_square_surfaces(levels, thickness, dp, invert);
off = [0, 0, invert ? thickness : 0];
xt = x_twist != 0;
yt = y_twist != 0;
sf_solidify(
[
for(row = surface[0]) [
for(p = row)
ptf_y_twist(size,
ptf_x_twist(size, p + off, x_twist),
y_twist
)
let(p_off = p + off, p_xt = xt ? ptf_x_twist(size, p_off, x_twist) : p_off)
yt ? ptf_y_twist(size, p_xt, y_twist) : p_xt
]
],
[
for(row = surface[1]) [
for(p = row)
ptf_y_twist(size,
ptf_x_twist(size, p, x_twist),
y_twist
)
let(p_xt = xt ? ptf_x_twist(size, p, x_twist) : p)
yt ? ptf_y_twist(size, p_xt, y_twist) : p_xt
]
],
convexity = convexity