From d9f118e44fbd87b2fd5e579190866b6ecb2618de Mon Sep 17 00:00:00 2001 From: Cedric Vincent Date: Fri, 24 Feb 2023 20:54:11 +0100 Subject: [PATCH] Fix "linear_sweep(..., texture=..., scale=..., twist=...)". The commit 'Fix "linear_sweep(..., texture=..., scale=...)" was not enough. This one fixes linear_sweep(..., texture=...) when scale and/or twist parameters are specified. Code to reproduce the fixed issue: linear_sweep(ellipse(d = [5, 10]), 5, twist = 45, texture = "bricks", scale = 0.5); --- skin.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skin.scad b/skin.scad index 78b5a29..96b88d6 100644 --- a/skin.scad +++ b/skin.scad @@ -3489,8 +3489,8 @@ function _textured_linear_sweep( if (i != counts.y || ti == 0) let( v = (i + (ti/texcnt.y)) / counts.y, - sc = lerp(scale, [1,1,1], v), - mat = down((v-0.5)*h) * + sc = lerp([1, 1, 1], scale, v), + mat = up((v-0.5)*h) * scale(sc) * zrot(twist*v) ) apply(mat, tile_rows[ti])